Skip to content

Commit

Permalink
Merge branch 'docs' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Mar 14, 2024
2 parents 32d49cc + 8f46d31 commit 2b3554b
Show file tree
Hide file tree
Showing 30 changed files with 5,562 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ deptrac.yaml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
pint.json export-ignore
/docs export-ignore
package.json export-ignore
package-lock.json export-ignore
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [docs]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ vendor/
composer.lock
.phpunit.cache/
.deptrac.cache

# Vitepress
node_modules/
docs/.vitepress/dist/
docs/.vitepress/cache/
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,38 @@

**Write highly encapsulated and loosely coupled modules, for domain-centric architecture.**

## Documentation
## What is this?

This package provides a common PHP toolset for writing these modules.
You've decided to use domain-driven design (DDD) as your architectural approach. You've engaged with business experts,
maybe even held some Event Storming sessions, and can now talk fluently in the ubiquitous language of your domain. Now
you need to start writing the domain code.

But how?! :thinking:

How should your code be structured? How do you ensure that the bounded context you're writing is entirely
encapsulated? How do you enforce architectural boundaries between bounded contexts, and ensure that they are loosely
coupled?

Don't worry, we've got you!

This package provides a conceptual approach and a set of tooling to help you write loosely coupled and highly
encapsulated bounded contexts - or modules - in PHP.

Whether you are on a journey to split a monolith into a modular monolith, or building out a microservices architecture,
this package will help you keep your bounded contexts clean, highly unit-testable, and easy to reason about.
It also ensures you have code consistency across all bounded contexts, while allowing plenty of flexibility for
each context to be tailored to its specific needs.

## Where to Start?

This package provides a common PHP toolset for writing domain-centric modules.

**It can be tempting to dive straight into the code - you'll need to resist that temptation!**

The key to achieving highly encapsulated and loosely coupled modules is _how you use the tools in this package_. That is
described in the [documentation](https://github.com/cloudcreativity/ddd-modules/wiki) - so ensure you read the docs
before using these tools.
described in the documentation - so ensure you read the docs before using these tools.

[You can read the documentation here.](https://cloudcreativity.github.io/ddd-modules)

## Installation

Expand Down
93 changes: 93 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import {defineConfig} from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "DDD Modules",
description: "Modules for domain-driven implementations in PHP.",
base: '/ddd-modules/',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{
text: 'Guide',
link: '/guide/',
},
],

sidebar: {
'/guide/': [
{
text: 'Introduction',
collapsed: false,
items: [
{text: 'What is DDD Modules?', link: '/guide/'},
{text: 'Installation', link: '/guide/installation'},
],
},
{
text: 'Core Concepts',
collapsed: false,
items: [
{text: 'Overview', link: '/guide/concepts/'},
{text: 'Bounded Contexts', link: '/guide/concepts/bounded-contexts'},
{text: 'Layers', link: '/guide/concepts/layers'},
{text: 'Encapsulation', link: '/guide/concepts/encapsulation'},
{text: 'Modularisation', link: '/guide/concepts/modularisation'},
],
},
{
text: 'Domain Layer',
collapsed: false,
items: [
{text: 'Entities & Aggregates', link: '/guide/domain/entities'},
{text: 'Value Objects', link: '/guide/domain/value-objects'},
{text: 'Domain Events', link: '/guide/domain/events'},
{text: 'Services', link: '/guide/domain/services'},
],
},
{
text: 'Infrastructure Layer',
collapsed: true,
items: [
{text: 'Asynchronous Processing', link: '/guide/infrastructure/queues'},
{text: 'Outbox & Inbox', link: '/guide/infrastructure/outbox-inbox'},
{text: 'Persistence', link: '/guide/infrastructure/persistence'},
{text: 'Units of Work', link: '/guide/infrastructure/units-of-work'},
],
},
{
text: 'Application Layer',
collapsed: false,
items: [
{text: 'Commands', link: '/guide/application/commands'},
{text: 'Queries', link: '/guide/application/queries'},
{text: 'Integration Events', link: '/guide/application/events'},
],
},
{
text: 'Toolkit',
collapsed: true,
items: [
{text: 'Assertions', link: '/guide/toolkit/assertions'},
{text: 'Identifiers', link: '/guide/toolkit/identifiers'},
{text: 'Iterables', link: '/guide/toolkit/iterables'},
],
}
],
},

socialLinks: [
{
icon: 'github',
link: 'https://github.com/cloudcreativity/ddd-modules',
},
],

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2024 Cloud Creativity Ltd',
},

outline: 'deep',
},
})
Loading

0 comments on commit 2b3554b

Please sign in to comment.