https://github.com/kamilmysliwiec/nest/blob/master/Readme.md
https://github.com/sequelize/sequelize
This project is a starter kit which implement the following :
- Nest.js
- Sequelize (ORM)
- Umzug (Migration)
- Dotenv (Evironement variable)
- JWT (For Json Web Token authentication)
- To run lint and fix
npm run lint
- To run tests suite
npm run test
- Start the server
npm start
- To run up/down migration
npm run migrate {up/down}
To configure put all config file in the ./src/config/*
.
To use the env variable, remove .demo
from .env.demo
.
User (Model)
Which provide you an example to use Sequelize definitionUsersController
which provide you a full CRUD on the user instance modelAuthController
which provide a way to authenticate a userAuthMiddleware
Which verify the token provided in the Authorization header of each requestAuthService
Which implement JWT sign method to be used easily for the loginDispatchError
which provide a way to set the header before the response is send (DispatchError filter
) that catch MessageCodeError (which is a custom one, you can find it in./lib/error
), ValidationError (Sequelize validation), HttpException, Error.
And of course the migrations
folder with an example