Skip to content

garyeung/todo_list_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo List API

Description

(https://roadmap.sh/projects/todo-list-api)
This is a RESTful API to allow users to manage their to-do list with user authentication.

Prerequisites

install postgretsql
install npm@latest 

After creatting your own database, writing your .env file according to the .env.template file

Installation

git clone https://github.com/garyeung/todo_list_API.git

cd todo_list_API 

npm install 

Usage

npm run dev
npm run build
npm run start
npm run test

Projet Structure

/api
  .env: port, jwt_secret, dabaseURL
  /src
    server: load routers, start server 
    /routes
      userRoute: Routing login, register
      todoRoute: Routing CRUD todo with verifytoken

    /controllers
      userController: 
        register: create user in database and return a token
        login: authentication then return a token or not
        delete: delete user

      todoController:
        createTodo
        updateTodo
        deleteTodo
        getTodoList
       
    /models
        jwtPayload.interface
        user.interface
        todo.interface
        dabatase.interface

    /services
        connetctDB: database manipulation
        hash.service:  hashing password and compare passwords
        todoServer: todos table manipulation
        userServer: user table manipulation
        token.service: generate token and verify token

    /__tests__
        todo.test:  todo manipulation test
        user.test:  user manipulation test
    /@types
        express.d: declare request with payload called user

About

This is a RESTful API to allow users to manage their to-do list with user authentication.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published