Table of Contents
- Download repo
git clone https://github.com/Mykhailo-Sichkaruk/TODO-list-api
- Change directory to downloaded repo
cd TODO-list-api
- Install dependencies:
npm install
- Setup Postgres
- Open
.env
file in project root - Set your password and login for postgress in
DATABASE_URL
topostgres://_YOUR_POSTRGES_LOGIN_:_YOUR_POSTGRES_PASSWORD_@localhost:5432/mydb?schema=public
(Without '_' symbols) - It shold be like this:
DATABASE_URL="postgres://postgres:todo@localhost:5432/mydb?schema=public"
- Open
- Run server:
npm start
- Follow instrunction in terminal
- Click Register
- Click Try it out
- Clisk Execute
- Copy token fron response`s header or body
- Scroll up and click Autorize
- Paste token
and clisck Autorize
Great You added token to header!
Read detailed about API in Swagger/Open API docs
- Sign up with login and password (POST /auth/register)
- Sign in with login and password (POST /auth/login)
- List has
- title (string)
- subscribers (array Users)
- author (string)
- tasks (array of strings)
- Create list (POST /list)
- Get list (GET /list/)
- Get all lists (GET /list)
- Update list (PUT /list)
- Delete list (DELETE /list)
- Task has
- id
- title
- body
- status (
ACTIVE
orIN_PROGRES
orDONE
orCLOSED
) - listId
- deadline
- authorId
- Create task (POST /task)
- Get task (GET /task/)
- Get all tasks (GET /task)
- Update task (PUT /task)
- Delete task (DELETE /task)
- Subscribe user to list (POST /list/subscribe)
- Database:
Postgres
- ORM:
Prisma
- Language:
TypeScript
- Execution environment:
Node.js
- Framework:
Express
- Documentation:
Swagger/Open API