Skip to content

Mykhailo-Sichkaruk/TODO-list-api

Repository files navigation

TODO-list api

Table of Contents

Prerequirements

Installation

  • 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 to postgres://_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"
  • Run server:
npm start 
  • Follow instrunction in terminal

Authentication

  • Click Register register
  • Click Try it out registe-ty-it-out
  • Clisk Execute register-execute
  • Copy token fron response`s header or body copy-token
  • Scroll up and click Autorize click-autorize
  • Paste token paste-token and clisck Autorize

Great You added token to header!

API

Read detailed about API in Swagger/Open API docs

Autentication

  • Sign up with login and password (POST /auth/register)
  • Sign in with login and password (POST /auth/login)

List managment

  • 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 managment

  • Task has
    • id
    • title
    • body
    • status (ACTIVE or IN_PROGRES or DONE or CLOSED)
    • listId
    • deadline
    • authorId
  • Create task (POST /task)
  • Get task (GET /task/)
  • Get all tasks (GET /task)
  • Update task (PUT /task)
  • Delete task (DELETE /task)

Scbscribe user to list

  • Subscribe user to list (POST /list/subscribe)

Tech details

  • Database: Postgres
  • ORM: Prisma
  • Language: TypeScript
  • Execution environment: Node.js
  • Framework: Express
  • Documentation: Swagger/Open API

About

Rest-API with OpenAPI documentation for TODO-list app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages