https://github.com/garyeung/todo_list_api
This is a RESTful API to allow users to manage their to-do list with user authentication.
https://github.com/garyeung/todo_list_api
crud-operation expressjs pg-promise restful-api typescript
Last synced: 5 months ago
JSON representation
This is a RESTful API to allow users to manage their to-do list with user authentication.
- Host: GitHub
- URL: https://github.com/garyeung/todo_list_api
- Owner: garyeung
- License: mit
- Created: 2024-10-14T08:04:45.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-11-02T13:12:06.000Z (11 months ago)
- Last Synced: 2025-02-16T20:33:46.748Z (8 months ago)
- Topics: crud-operation, expressjs, pg-promise, restful-api, typescript
- Language: TypeScript
- Homepage: https://roadmap.sh/projects/todo-list-api
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```sh
install postgretsql
install npm@latest
```
After creatting your own database, writing your .env file according to the .env.template file## Installation
```sh
git clone https://github.com/garyeung/todo_list_API.gitcd todo_list_API
npm install
```
## Usage
```sh
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 usertodoController:
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```