New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nestjs-architects/nx-ddd-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs-architects/nx-ddd-plugin

Nx plugin for structuring a monorepo with domains and layers

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@nestjs-architects/nx-ddd-plugin -- DDD Plugin for Nx

This plugin installs schematics which automate slicing your Nx workspace into domains and layers according to DDD nad Onion Architecture.

domains and layers

The generated access restrictions prevent unwanted access between libraries respecting layers and domains:

access restrictions

Features

  • 🗺️ Generating domains with domain libraries
  • 🙅‍♂️ Adding linting rules for access restrictions between domains
  • 🙅‍♀️ Adding linting rules for access restrictions between layers as proposed by Onion Architecture

Usage

Add this plugin to an Nx workspace:

npm i -D @nestjs-architects/nx-ddd-plugin

Initialize linting rules

nx g @nestjs-architects/nx-ddd-plugin:add

Add domains:

nx g @nestjs-architects/nx-ddd-plugin:domain adoption

If you have a fullstack workspace you can separate those libraries from that for frontend by providing a grouping directory

nx g @nestjs-architects/nx-ddd-plugin:domain adoption --directory server

Generated Structure

The included schematics generate a folder for each domain. This folder contains all necessary libs to provide your domain use cases logic.

Folders structure

How to connect it with the App?

App should import an ui library as it is a way how the application provides the entrypoint to the business logic. This plugin doesn't generate ui library generator as it doesn't have to be a part of any domain. Ui library can implement a simple REST API for a specific domain, but also could represent a Backend for Frontend that orchestrate multiple domains or could produce a classic html views containing data from many domains.

Furthermore, there are many options of the communication protocol you could want to use.

Application structure

Contact

Maciej Sikorski - @_MaciejSikorski , LinkedIn

More

Acknowledgments

Credits

FAQs

Package last updated on 27 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc