Nest + Prisma + TypeScript | REST API Starter repository
Nest + Prisma + TypeScript starter repository.
$ 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
axios
then you need to set: withCredentials: true
. Read more
fetch
then you need to set: credentials: 'include'
. Read more
Sync your IDE with project eslintrc.js.
Check Run ESLint --fix on save