Git Product home page Git Product logo

nest-nx-onion's Introduction

If you are looking for an example of a real application that follows the rules described in my article check out the Pimp My Pr

ToDo App

This project was generated using Nx.

๐Ÿ”Ž Nx is a set of Extensible Dev Tools for Monorepos.

Project description

Main domain: Eisenhower Matrix

A set of tasks that should be handled in a specific way. Eisenhower matrix image

The second one: Users

A group of users that can be created and each one has its own matrix that can maintain.

Comments

During the development of that project I had a vision of it described above, but the main reason for building this repo was to provide an example of the Nest.js, Nx and Onion Architecture. So you probably won't find here a full-featured project, especially on the fronted side which is skipped for now.

I encourage you to focus on the workflow of each feature/use case from the application through the ui, shell, application services and domain. Also on the composition of the application by ports and adapters.

Independence of framework

You can see a lot of duplicated classes from application-services layer inside the shell libraries like AddTaskHandlerImpl. It is an example of the implementation of the independence of framework.

In many projects, it is an over-engineering and the application-service layer could have its own module to provide the facade, CQRS handlers and other services. It will make shell modules much simpler. You could also use @CommandHandler and other decorators from @nestjs.

Sample dependency graph

Dependency graph

Setup

Run npm install to install project dependencies

Development

Run ng serve to run web application in development mode.

Run ng serve api to run api in development mode.

Run ng serve cli to recompile cli application on each change and run CLI_PATH=./dist/apps/cli/main.js npx nestjs-command user:create Maciek to execute sample cli command.

nest-nx-onion's People

Contributors

sikora00 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.