This is a starter pack REST API NodeJS based for fast develop advanced API services with Enterprise architecture.
npm install
Development mode
npm run start
Production
npm run start:prod
Run test
npm run test
- Typescript 3+
- NestJS 5 (Express powered)
- JWT
- Mongoose - typegoose
- Automapper
- Swagger
- Jest
- RxJS
All modules has last versions and regular updated
Inspired by Angular. Great thanks to NESTJS Go to docs for more information about framework and best practices
- config - contains
default.ts
with env parameters - src
- shared - complete features for any purposes
- todo - example implementation secure routes
- user - auth routes
Nest provides an out-of-the-box application architecture which allows for effortless creation of highly testable, scalable, loosely coupled, and easily maintainable applications. Use Nest CLI for correct creating new modules/services & controllers
sequenceDiagram
User ->> Service: Login & Password
Note right of Service: if one of creadentials <br/> not valid
Service--x User: 404 Bad request
Note right of Service: if all creadentials <br/> valid
Service ->> User: 200 Ok with token
Get more about Guards Two protection schemes have been implemented:
- JWT Guard - protect access by validation token
- Role Guard - protect access by user role
2.11.2018