Giter Site home page Giter Site logo

meaowai / clean-architecture-nestjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matheusalxds/clean-architecture-nestjs

0.0 0.0 0.0 249 KB

API developed using NestJS, TypeORM, TDD, PgMem and concepts of Clean Architecture

Shell 0.71% JavaScript 9.10% TypeScript 89.97% Dockerfile 0.22%

clean-architecture-nestjs's Introduction

The Powerful NestJS

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License

Clean Architecture

alt text

The project has been developed thinking about concepts of Clean Architecture, in a nutshell, I spread the functionalities in layers to better meet the responsibilities.

Our Domain is responsible to keep entities and use-cases. Application layer is responsible for introducing controllers. Infra layer has the responsibility to become a gateway between our application and third packages, and last but not least, there's the Main layer, better known as a "dirty layer", because the Main will connect each part of the project.

TypeORM

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8). Its goal is to always support the latest JavaScript features and provide additional features that help you to develop any kind of application that uses databases - from small applications with a few tables to large scale enterprise applications with multiple databases.

Getting Started

Installation

$ npm install

Creating the database

Before we start the application, it's necessary to create our database.

It's very simple to create our migration files, as simple as you can think, you just need to run the following command:

$ npm gen:migration <migration_name>

If you want to execute the migration file, you need to run the following command:

$ npm run:migration

Sometimes, we need to revert the migration, so we need to run the following command:

$ npm rev:migration

If you prefer to use the documentation for this, you can find it here.

Running the app

After you create the database, it is possible to start the application with the following command:

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

License

Nest is MIT licensed.

clean-architecture-nestjs's People

Contributors

matheusalxds 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.