@fazio/nx-cross-ddd-plugin
v0.0.18-beta.6
Published
Nx plugin for structuring a monorepo with domains and layers as platform agnostic according to Nrwl's best practices and about DDD and SOLID programming software pattern
Downloads
27
Readme
This plugin allow you to build cross platform sorftware with typescript, supporting architecture for different platform/framework combinations. Nx Cross DDD Plugin is an added value pack for Nx Workspace which provides additional schematics which automate slicing your Nx workspace into domains, feature layers and platforms UI layers according to Nrwl's best practices and about DDD and SOLID programming software pattern.
Overview
Features
- ✅ Architect, test, and build software at any scale according DDD and SOLID programming sorftware pattern best practices
- ✅ Create domains with
domain
libraries including models and data services - ✅ Create features with
domain feature
libraries including facades, models, and data services - ✅ Create platforms UI with
platform feature
libraries including feature components build with multi framework available - ✅ Share libraries of a Monorepo
- ✅ Add linting rules for access restrictions between
domains
as proposed by Nrwl - ✅ Add linting rules for access restrictions between
domain features layers
andplatforms UI layers
as proposed by Nrwl - ✅ Support for many frontend and backend technologies
- ✅ Add tooling for build and publish registery librairies automation
Install
Add this plugin to an existing Nx workspace
- Run from Nx Project root folder:
npm i -D @fazio/nx-cross-ddd-plugin
Or create new Nx Workspace. Run the following command:
npx create-nx-workspace@latest
npm i -D @fazio/nx-cross-ddd-plugin
Usage
You can genetate libraries with Nx Editor Plugins or run following commandes:
Generate Domain
nx g @fazio/nx-cross-ddd-plugin:domain MyDomain --generateService
- --generateService (optional): Generate client service file.
- --generateRepository (optional): Generate backend service file.
Generate Domain feature
nx g @fazio/nx-cross-ddd-plugin:feature MyFeature --domain MyDomain
- --domain (required): Name of Domain.
Generate Platform UI feature
nx g @fazio/nx-cross-ddd-plugin:platform MyPlatformUI --domain MyDomain --feature MyFeature --generateComponent
- --domain (optional): Name of Domain.
- --feature (optional): Name of Domain Feature to extend.
- --directory (optional): The folder directory to generate library. By default will be created inside
--ui
parameter. Usefull to generateshared library
or library for different framework. - --framework (optional): Name of framework to build UI Component. If not provided, will use by default
Angular
. - --generateComponent (optional): Genereate default component extended with feature domain logic class
Generate Linting Rules for workspace
ng add @fazio/nx-cross-ddd-plugin
Architecture Overview
Recommended extra tooling
Credits
- Nx Workspace
- Nrwl's eBooks
- xPlat
- xPlat design doc
- Why it’s Hard to Decide on Technologies by Adam Klein
- @angular-architects/ddd -- DDD Plugin for Nx
- Design a DDD-oriented microservice
- DDD By Example - Paul Rayner - DDD Europe 2020 - Youtube Video
- Javascript fatigue & Domain-driven design by Bastien Duret - Youtube Video
Contribution
see CONTRIBUTING.md
About author
Hi, i'm Nicolas Fazio, a Senior Typescript Software Architect & teacher, living in Geneva Switzerland 🇨🇭. I build software architecture and cross platform application for almost 15 years. You can follow me on Twitter @FazioNico or checkout my own website https://nicolasfazio.ch