-
This project is a task manager, in which the user can organize his own tasks in cards and boards.
-
The project was developed by five people from My Tech Mind organization.
- User creation, update, log-in, detail, and deletion
- Board creation, edition, detail, listing (including filter by favorited or not), and deletion
- Card creation, edition, detail, ordering, and deletion
- Task creation, edition, detail, ordering, and deletion
- JavaScript
- SQL
- Node.js
- PostgreSQL
- Bcrypt
- Cors
- Date-fns
- Express
- Joi
- Jsonwebtoken
- Knex
- Pg
- Supabase (for database)
- Render (for deployment)
Deploy link: https://new-board-54mj.onrender.com
- Node installed on your machine
- npm installed on your machine
-
Clone the repository:
git clone git@github.com:My-Tech-Mind/new-board.git
-
Navigate to the project directory:
cd new-board
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
npm install
Run the development server: npm run dev
Database
-
users
- id
- name
- password
-
boards
- id
- title
- favorited
- user_id
- creation_date
- update_date
-
cards
- id
- title
- board_id
- ordenation
-
tasks
- id
- title
- description
- card_id
- ordenation
Routers
Users
Description: This route is used to create a user in the application.
Sent data: name, email, password
Return data: id, name, email
// POST/user
{
"name": "testuser",
"email": "testuser@email.com",
"password": "*Testtest1"
}
// HTTP Status 201
{
"id": 1,
"name": "testuser",
"email": "testuser@email.com",
}
Description: This route is used to log in a user in the application.
Sent data: email, password
Return data: user (id, name, email), token
// POST/login
{
"email": "testuser@email.com",
"password": "*Testtest1"
}
// HTTP Status 200
{
"user": {
"id": 1,
"name": "testuser",
"email": "testuser@email.com"
},
"token":
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OSwiaWF0IjoxNzEyMjczMDg3LCJleHAiOjE3MTIzNTk0ODd9.geQfWbB2iEPXFH7rUMD_6MtMEDk1Ej_SLJKL7U9TwjA"
}
Description: This route is used to update the data of a logged-in user in the application.
Sent data: name, email, password
Return data: id, name, email
// PUT/user
{
"name": "testuser1",
"email": "testuser1@email.com",
"password": "*Testtest1"
}
// HTTP Status 200
{
"id": 1,
"name": "testuser1",
"email": "testuser1@email.com",
}
Description: This route is used to show the data of a logged-in user in the application.
Sent data: N/A
Return data: id, name, email
// GET/user
// No content in the request body
// HTTP Status 200
{
"id": 1,
"name": "testuser1",
"email": "testuser1@email.com",
}
Description: This route is used to delete the data of a logged-in user in the application.
Sent data: N/A
Return data: N/A
// DELETE/user
// No content in the request body
// HTTP Status 204
// No content in the return
Boards
Description: This route is used to create a board, with the initial cards cards (to, doing, done), for the logged-in user in the application.
Sent data: title, favorited
Return data: id, title, favorited, user_id, creation_date, update_date, cards (to, doing, done) with tasks []
// POST/board
{
"title": "Week tasks",
"favorited": "false"
}
// HTTP Status 201
{
"id": 62,
"title": "Week tasks",
"favorited": false,
"user_id": 9,
"creation_date": "2024-04-15 20:37:47",
"update_date": "2024-04-15 20:37:47",
"cards": [
{
"id": 90,
"title": "to do",
"board_id": 62,
"ordenation": 0,
"tasks": []
},
{
"id": 91,
"title": "doing",
"board_id": 62,
"ordenation": 1,
"tasks": []
},
{
"id": 92,
"title": "done",
"board_id": 62,
"ordenation": 2,
"tasks": []
}
]
}
Description: This route is used to edit a board owned by the logged-in user in the application.
Sent data: title, favorited
Return data: id, title, favorited, user_id, creation_date, update_date
// PUT/board/1
{
"title": "Week tasks",
"favorited": "true"
}
// HTTP Status 200
{
"id": 1,
"title": "Week tasks",
"favorited": "true",
"user_id": 2,
"creation_date": "2024-03-23 15:21:57",
"update_date": "2024-03-24 10:43:25"
}
Description: This route is used to show the data of a board owned by the logged-in user in the application.
Sent data: N/A
Return data: id, title, favorited, user_id, creation_date, update_date, cards (id, title, board_id, ordenation) with tasks (id, title, description, card_id, ordenation)
// GET/board/1
// No content in the request body
// HTTP Status 200
{
"id": 1,
"title": "Week tasks",
"favorited": "true",
"user_id": 2,
"creation_date": "2024-03-23 15:21:57",
"update_date": "2024-03-24 10:43:25",
"cards": [
{
"id": 1,
"title": "Home",
"board_id": 1,
"ordenation": 1,
"tasks": [
{
"id": 1,
"title": "Food",
"description": "Prepare the week's meals",
"card_id": 1,
"ordenation": 1
},
{
"id": 2,
"title": "Cleaning",
"description": "Clean the house",
"card_id": 1,
"ordenation": 2
}
]
},
{
"id": 2,
"title": "Others",
"board_id": 1,
"ordenation": 2,
"tasks": []
}
]
}
Description: This route is used to show the list of boards (or only the favorited ones), owned by the logged-in user in the application.
Sent data: N/A
Return data: boards owned by the logged-in user
// GET/board
// No content in the request body
// HTTP Status 200
[
{
"id": 1,
"title": "Week tasks",
"favorited": "true",
"user_id": 2,
"creation_date": "2024-03-23 15:21:57",
"update_date": "2024-03-24 10:43:25"
},
{
"id": 2,
"title": "Monthly commitments",
"favorited": "true",
"user_id": 2,
"creation_date": "2024-04-01 14:28:32",
"update_date": "2024-04-01 14:28:32"
}
]
Description: This route is used to delete a board owned by the logged-in user in the application.
Sent data: N/A
Return data: N/A
// DELETE/board/1
// No content in the request body
// HTTP Status 204
// No content in the return
Ordenate Cards
Description: This route is used to change the ordenation number (position) of a card owned by the logged-in user in the application.
Sent data: cardId, cardSourcePosition, cardDestinationPosition
Return data: N/A
// PUT/card/ordenation
{
"cardSourcePosition": 6,
"cardDestinationPosition": 3,
"cardId": 87
}
// HTTP Status 204
// No content in the return
Ordenate Tasks
Description: Description: This route is used to change the ordenation number (position) of a task owned by the logged-in user in the application.
Sent data: taskSourcePosition, taskDestinationPosition, cardIdDestination, cardIdSource, taskId
Return data: N/A
// POST/task/ordenation
{
"taskSourcePosition": 2,
"taskDestinationPosition": 3,
"cardIdDestination": 96,
"cardIdSource": 97,
"taskId": 102
}
// HTTP Status 204
// No content in the return
Cards
Description: This route is used to create a card on the board owned by the logged-in user in the application.
Sent data: title, board_id
Return data: id, title, board_id, ordenation, tasks of the card (starts with [])
// POST/card
{
"title": "test cards",
"board_id": "64"
}
// HTTP Status 201
{
"id": 110,
"title": "test cards",
"board_id": 64,
"ordenation": 4,
"tasks": []
}
Description: This route is used to edit a card owned by the logged-in user in the application.
Sent data: title, board_id
Return data: id, title, board_id, ordenation, tasks of the card
// PUT/card/96
{
"title": "Random tasks",
"board_id": "61"
}
// HTTP Status 200
{
"id": 96,
"title": "Random tasks",
"board_id": 61,
"ordenation": 3,
"tasks": [
{
"id": 102,
"title": "Go to the gym",
"description": "Observation: before the lunch",
"card_id": 96,
"ordenation": 0
},
{
"id": 103,
"title": "Buy groceries",
"description": "Don't forget the fruits",
"card_id": 96,
"ordenation": 1
},
{
"id": 104,
"title": "Feed the cat",
"description": "Observation: before the afternoon",
"card_id": 96,
"ordenation": 2
}
]
}
Description: This route is used to detail a card owned by the logged-in user in the application.
Sent data: N/A
Return data: id, title, board_id, ordenation, tasks of the card
// GET/card/96
// No content in the request body
// HTTP Status 200
{
"id": 96,
"title": "Random tasks",
"board_id": 61,
"ordenation": 3,
"tasks": [
{
"id": 102,
"title": "Go to the gym",
"description": "Observation: before the lunch",
"card_id": 96,
"ordenation": 0
},
{
"id": 103,
"title": "Buy groceries",
"description": "Don't forget the fruits",
"card_id": 96,
"ordenation": 1
},
{
"id": 104,
"title": "Feed the cat",
"description": "Observation: before the afternoon",
"card_id": 96,
"ordenation": 2
}
]
}
Description: This route is used to delete a card owned by the logged-in user in the application.
Sent data: N/A
Return data: N/A
// DELETE/card/45
// No content in the request body
// HTTP Status 204
// No content in the return
Tasks
Description: This route is used to create a task on the card owned by the logged-in user in the application.
Sent data: title, description, card_id
Return data: id, title, description, card_id, ordenation
// POST/task
{
"title": "Review annotations",
"description": "Read portuguese and math annotations "
"card_id": "96"
}
// HTTP Status 201
{
"id": 104,
"title": "Review annotations",
"description": "Read portuguese and math annotations ",
"card_id": 96,
"ordenation": 2
}
Description: This route is used to edit a task owned by the logged-in user in the application.
Sent data: title, description, card_id
Return data: id, title, description, card_id, ordenation
// PUT/task/80
{
"title": "Do the homework",
"description": "Finish at least 5 exercises",
"card_id": 45
}
// HTTP Status 200
{
"id": 80,
"title": "Do the homework",
"description": "Finish at least 5 exercises",
"card_id": 45
"ordenation": 2
}
Description: This route is used to detail a task owned by the logged-in user in the application.
Sent data: N/A
Return data: id, title, description, card_id, ordenation
// GET/task/80
// No content in the request body
// HTTP Status 200
{
"id": 80,
"title": "Do the homework",
"description": "Finish at least 5 exercises",
"card_id": 45
"ordenation": 2
}
Description: This route is used to delete a task owned by the logged-in user in the application.
Sent data: N/A
Return data: N/A
// DELETE/task/78
// No content in the request body
// HTTP Status 204
// No content in the return