Giter Club home page Giter Club logo

nestjs-ddd's Introduction

NestJs Clean Arquitecture

Mutation test - stiker This is an example of using DDD with nestjs, only for proof of concept and framework study If you want more documentation of it, click here Nest

A quick introduction to clean architecture

alt text

Branch Definitions

  • master: Flat structure with mongo connection
  • flat-structure-sql: Flat structure with connection to sqlite can be easily changed to any connection that allows sequelizejs
  • hexagonal-architecture: Exagonal structure with mongo connection

Getting Started

git clone [email protected]:ecaminero/nestjs-ddd.git

Structure

.
├── doc
│   ├── *.http
├── src
│   ├── app
│   │   ├── __test__
│   │   │   └── *.controller.spec.ts
│   │   ├── controller
│   │   │   └── *.controller.ts
│   │   ├── dto
│   │   │   └── *.dto.ts
│   │   ├── interceptors
│   │   │   └── *.interceptor.ts
│   │   └── middlewere
│   │       └── *.middleware.ts
│   ├── domain
│   │   ├── __test__
│   │   │   └── *.service.spec.ts
│   │   ├── entities
│   │   │   └── *.entity.ts
│   │   └── service
│   │       └── *.service.ts
│   ├── infrastructure
│   │   ├── database
│   │   │   └── *.providers.ts
│   │   ├── health
│   │   │   └── *.check.ts
│   │   ├── model
│   │   │   └── *.model.ts
│   │   └── repository
│   │       └── *.repository.ts
│   ├── main.ts
│   ├── app.module.ts
│   ├── constants.ts
├── test
│   ├── app.e2e-spec.ts
│   └── jest-e2e.json
├── jest.config.json
├── localhost.sqlite
├── nest-cli.json
├── nodemon-debug.json
├── nodemon.json
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.build.json
├── tsconfig.json
└── tslint.json

Prerequisites

  • node 10+
  • mongo DB
  • Sqlite
$ docker run --name dev-mongo -p 27017:27017 -d mongo

Installing

$ npm install 

If you see this everything all fine


added 898 packages from 578 contributors and audited 876746 packages in 11.087s
found 0 vulnerabilities

Running the tests

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# coverage
$ npm run test:cov

Built With

  • Nest - The framework used

  • Mongoosejs - elegant object modeling for Nodejs

  • node.js- Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine

  • jestjs Jest is a delightful JavaScript Testing Framework with a focus on simplicity

  • sequelizejs Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.

Authors

  • Edwin Caminero - Initial work - github

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Inspiration
  • Hexagonal architecture concept tests

nestjs-ddd's People

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.