A Backend application based on NestJS, where PostgreSQL acts as a database, to control the base used
Prisma. Also Using passport.js, and json web tokens (JWT). There is also e2e tests in the tests folder.
You can running Database from Docker ๐ฌ And you can run a second database for tests.
In file package.json
there is a command for this.
NestJS |
PostgresSQL |
Docker |
Prisma |
- Authentication and Authorization
- Sign Up
- Login
- Bookmarks
- User can create a bookmarks
- Create bookmarks, get, update, delete.
- User
- Create user, update and change password.
Check Bookmarks API Documentation for more info.๐
In postman create a global variable jwt
for token, and in test write this code:
In the authorization section, select the type of token "Bearer Token"
and write a variable {{jwt}}
. It will automatically refresh the token.
const token = pm.response.json().tokens.access;
pm.globals.set("jwt", token);
To start the Prisma run this command
$ npx prisma generate
You can also run Prisma Studio, by default Prisma run on localhost:5555
$ npx prisma studio
In file .env enter your environment variables
Follow the command:
docker-compose up
# -d - For launch in the background
# --build - for build containers
- Install postgreSQL with an official site
- Create a server copy and database, add the user and password as indicated in the .env file
- Make sure PostgreSQL is launched and works
- Install dependencies
# yarn package manager
yarn install
yarn start
# npm package manager
npm install
npm run start