Skip to content

SerhiiNikif/todo-list-nest

Repository files navigation

How to use

1. Clone Project into your local machine

git clone https://github.com/SerhiiNikif/todo-list-nest.git

2. Go into project folder

cd todo-list-nest

3. Setting environment file .env.

Create an .development.env file in the root of the project and fill it with the values ​​from the .development.env.example file.

PORT=7000
POSTGRES_HOST=postgres
POSTGRES_USER=db_user
POSTGRES_PASSWORD=db_password
POSTGRES_DB=db_name
POSTGRES_PORT=5432
PRIVATE_KEY=secret_key

Depending on how you run the project, the value of the POSTGRES_HOST variable will change:

docker: POSTGRES_HOST=postgres

locally: POSTGRES_HOST=localhost

4. Start project

Docker need to be installed in your OS. To install Docker, please click here.

Enter this command so that the dist folder appears (it is needed in the Dockerfile)

npm run build
docker-compose up

Or run the project locally

npm install
npm run start:dev

5. Play with APIs now !

Now, you are ready to test all APIs. Just simply open your browser http://localhost:5000/api/docs.

All APIs are protected by accessToken (JWT).

When calling these protected APIs, make sure you add %BearerToken% in Authorization request Header.

Authorization: Bearer <accessToken>

How to get accessToken ?

When user login sucessfully, an unique accessToken will be returned.