Skip to content

ThanhDeveloper/NestJsORM

Repository files navigation

Nest Logo

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

Description

This project is implemented using nestjs - a framework based on nodejs

This application includes:

  • Backend: NestJs (Nodejs framework)
  • Database: Postgres SQL
  • ORM library for Nodejs: Sequelize
  • Service layer and repository pattern, module pattern, dependence injection, automapper, rate limiter, etc...
  • Unit testing: Jest (JavaScript Testing Framework - Meta)

Installation

$ npm install

Set up Environment

please create file .env similar to file .env.sample and change your config

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Sequelize

# install sequelize cli to run command
$ npm install -g sequelize-cli

# create database
$ sequelize db:create

# migration database
$ sequelize db:migrate

Nest

# install nest cli to run command
$ npm i -g @nestjs/cli

# CLI's CRUD generator
$ nest g resource [name] 

# create a controller 
$ $ nest g controller [controller_name] 

API sample

HTTP Requests URL Method
Index entry point / GET
Login api/v1/users POST
SignUp api/v1/users POST
Get all users api/v1/users GET
Get user by id api/v1/users/:id GET

Swagger docs

  • Open API documentation with nestjs/swagger

Document

  • Nest is an MIT-licensed open source project. read document alter using this repository at NestJsDocs.
  • 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 at SequelizeDocs.
  • Automapper: https://www.npmjs.com/package/@automapper/nestjs (current highest version v7)

Docker supports

# run docker compose on detach mode
$ docker-compose up --detach

CI/CD

This project using GitHub Action for config ci/cd

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published