this a project in dev init 2 borntodev make by Korarit Saengthong
This project used Programming language
/ libary
/ framework
- Typescript
- ExpressJS
- Express-session
- Mysql2
- Moment-timezone
- Bcrypt
Database use Mysql
OR Mariadb
auto unit testing used Jest
+ Suppertest
you can use this command to install package for use project
npm install
# API PORT
SERVER_PORT=3000
# session secret key
SESSION_SECRET=secret_adafmakaaffafa
# Database Config
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=123
DB_NAME=final_borntodev
you can use Mysql
OR Mariadb
import file final_borntodev.sql to database server
POST /users/regiser
for regiser new userPOST /users/login
for loginGET /logs
for get all user logPOST /logs
for add user logGET /logs/:id
for get log by idPUT /logs/:id
for update log by idDELETE /logs/:id
for delete log by idGET /todos
for get all user todosPOST /todos
for add user todosGET /todos/:id
for get todos by idPUT /todos/:id
for update todos by idDELETE /todos/:id
for delete todos by idGET /events
for get all user eventsPOST /events
for add user eventsGET /events/:id
for get events by idPUT /events/:id
for update events by idDELETE /events/:id
for delete events by id
POST /users/regiser
This example payload for path
{
"username" : "test0022",
"email" : "k22@gmail.com",
"password" : "123456789"
}
POST /users/login
This example payload for path
{
"username" : "test0022",
"password" : "123456789"
}
POST /logs
This example payload for path
{
"content":"test test 23"
}
PUT /logs/:id
:id paste log id This example payload for path
{
"content":"test test 23"
}
GET /logs
not have payload for get all user logs
GET /logs/:id
:id paste log not have payload for get log data by id
DELETE /logs/:id
for delete log by id not have payload
POST /todos
This example payload for path
{
"title":"test 02",
"description": "test test test",
"due_date": "2567-05-27",
"priority": 1,
"status": true
}
PUT /todos/:id
:id paste log id This example payload for path
{
"title":"test 02",
"description": "test test test",
"due_date": "2024-05-27",
}
GET /todos
not have payload for get all user todos
GET /todos/:id
not have payload for get todo data by id
DELETE /todos/:id
for delete todo by id not have payload
POST /events
This example payload for path
{
"title": "test 50",
"description": "test test",
"start_date" : "2567-05-22 21:28:55",
"end_date": "2024-05-30 22:28:55"
}
PUT /events/:id
:id paste log id This example payload for path
{
"title": "test 50",
}
GET /events
not have payload for get all user events
GET /events/:id
not have payload for get events data by id
DELETE /events/:id
for delete events by id not have payload
-
import file final_borntodev.sql to database server
-
user this command for install package
npm install
- use this command for run test
npm run dev
-
import file final_borntodev.sql to database server
-
user this command for install package
npm install
- use this command for auto unit test but you need to fix you fix id in test case delete logs / todos / events By Id and test case regiser If you don't do it, there will be an error.
npm test