Nest + Prisma + TypeScript starter repository.
- Error Handling (Exception Filters)
- Logging System
- DB Seeds/Migrations
- Built-in AuthModule, using JWT. Route Guards
- Model Events Listener (onCreated, …)
- Deployable. CI/CD pipeline using Github Actions.
- Advanced ESLint/TSLint config. (e.g: auto-fix will remove unused imports)
- Shared services/constants/helpers
- Middlewares/Interceptors implementation example.
- Add Mail Service
- Add Recap.DEV integration - Tracing/Monitoring service
- Add Unit tests.
- Add Social Media Auth
- Add documentation for setting the GitHub Secrets for the CI/CD pipeline
- Add API Throttling - https://docs.nestjs.com/security/rate-limiting
- ...
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
# IDE for your database
$ npx prisma studio
# run migrations (apply schema changes)
$ npx prisma migrate dev
# run migrations on CI/CD
$ npx prisma migrate deploy
# apply db schema changes to the prisma client
$ npx prisma generate
This implementation uses httpOnly
(server-side) cookie-based authentication. Read more
That means that the JWT Token
is never stored on the client.
Usually it was stored in localStorage
/ sesionStorage
/ cookies
(browser), but this is not secure.
Storing the token on a server side cookie is more secure, but it requires a small adjustment on frontend HTTP requests in order to work.
Frontend adjustments
- If you're using
axios
then you need to set:withCredentials: true
. Read more - If you're using
fetch
then you need to set:credentials: 'include'
. Read more
Sync your IDE with project eslintrc.js.
Check Run ESLint --fix on save
- Author - Igor Mardari | GarryOne
- Website - 7code.ro
- Github - @7codeRO