Приложение представляет из себя простейший CRUD API для работы с объектами Board, имеющими формат
idBoard — уникальный идентфикатор доски (string, uuid)
nameBoard — имя доски (string, required)
descriptionBoard — описание доски (number, required)
columns — список колонок доски (array of strings or empty array, required)
- idСolumn — уникальный идентфикатор колонки (string, uuid)
- nameColumn — имя колонки (string, required)
- descriptionСolumn — описание колонки (number, required)
- tasks — список задач колонки (array of strings or empty array, required)
- idTask — уникальный идентфикатор задачи (string, uuid)
- nameTask — имя задачи (string, required)
- descriptionTask — описание задачи (number, required)
- GET
/api/board
получить все доски; - GET
/api/board/${boardID}
получить доску по id; - POST
/api/board
создать доску и добавить в database; - PUT
/api/board/{boardID}
обновить доску по айди; - DELETE
/api/board/${boardID}
удаляет доску по id;
- GET
/api/column/${boardID}
получить все колонки в доске по айди доски; - GET
/api/column/id/${columnID}
получить колонку по айди; - POST
/api/column/${boardID}
создать колонку в доске с айди; - PUT
/api/column/{columnID}
обновить колонку по айди; - DELETE
/api/column/${columnID}
удаляет колонку по idж
- GET
/api/task/${boardID}/${columnID}
получить все задачи в доске в колонке по айди доски и колонки; - GET
/api/task/id/${taskID}
получить задачу по id; - POST
/api/task/${boardID}/${columnID}
создать задачу в колонке с айди в доске с айди; - POST
/api/task/${columnID}
создать задачу в колонке с айди; - PUT
/api/task/${taskID}
обновить задачу по айди; - PUT
/api/task/move/${taskID}
переместить задачу в новую колонку; - DELETE
/api/task/${taskID}
удаляет задачу по id;
Получить все доски
-
URL
/api/board
-
Method
GET
-
URL
/column/move/:id
-
Method
PUT
-
Data parameters:
{
toBoardId: string,
newPosition: number
}
-
URL
/task/move/:id
-
Method
PUT
-
Data parameters:
{
toColumnId: string,
newPosition: number,
}
Registration user
Registration a new user
-
URL
/api/register
-
Method
POST
-
Data parameters:
{
firstName: string;
lastName: string;
email: string;
password: string;
}
- Returned value
{
id: string
firstName: string;
lastName: string;
email: string;
password: string;
token: string;
accessLevel: AccessLevel.User;
}
enum AccessLevel {
"Admin",
"User",
"Anonymous"
}
-
Errors:
400
- Not all required fields are filled409
- The User already exist
Login user
Login user with login and password
-
URL
/api/login
-
Method
POST
-
Data parameters:
{
email: string;
password: string;
}
- Returned value
{
id: string
firstName: string;
lastName: string;
email: string;
password: string;
token?: string;
accessLevel: AccessLevel.User;
expiresIn: Date;
}
enum AccessLevel {
"Admin",
"User",
"Anonymous"
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Get user info
Returns json data about specified user
-
URL
/api/user
-
Method
GET
-
Data parameters:
none
-
Returned value
{
id: string;
firstName: string;
lastName: string;
email: string;
accessLevel: AccessLevel;
gender: string;
registrationDate: Date;
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Update user info
Updates attributes of specified user.
-
URL
/api/user
-
Method
PUT
-
Data parameters:
{
firstName?: string;
lastName?: string;
password?: string;
gender?: string;
}
- Returned value
{
id: string;
firstName: string;
lastName: string;
email: string;
accessLevel: AccessLevel;
gender: string;
registrationDate: Date;
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Get checkbox by ID
Return json data about scpecified checkbox by ID
/api/checkbox/id/:id
-
Method
GET
-
Request parameters:
- id - checkbox id
-
Data parameters:
none
-
Returned value
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Get all checkboxes by task ID
Return json data about checkboxes in specified task by ID
/api/checkbox/:id
-
Method
GET
-
Request parameters:
- id - task id
-
Data parameters:
none
-
Returned value
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Create checkbox
Create a new checkbox in specified task
/api/checkbox/:id
-
Method
POST
-
Request URL parameters:
- id - task id
-
Data parameters:
{
nameCheckBox: string;
isChoose: boolean;
}
- Returned value
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Delete checkbox
Delete specified checkbox from task
-
URL
/api/checkbox/:id
-
Method
DELETE
-
Request URL parameters:
- id - checkbox id
-
Data parameters:
none
-
Returned value
none
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Update checkbox
Update attributes of specified checkbox
/api/checkbox/:id
-
Method
PUT
-
Request URL parameters:
- id - checkbox id
-
Data parameters:
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}
- Returned value
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
Update checklist
Update whole checklist
-
URL
/api/checklist
-
Method
PUT
-
Request URL parameters:
- id - task id
-
Data parameters:
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}[]
- Returned value
{
nameCheckBox: string;
isChoose: boolean;
idCheckBox: string;
}[]
-
Errors:
400
- Not all required fields are filled401
- Invalid credentials
{
nameBoard: 'Trello',
dateBoard: new Date('06.02.2023'),
descriptionBoard: 'creating app trello',
isChosen: true,
idBoard: '9e67fcee-8b69-40cd-a335-5c506655cf9c',
ownerId: '8e0bcefd-6af9-4383-a490-3a3f5897fcfd',
columns: [
{
nameColumn: 'need to do',
descriptionColumn: 'what need to do week#1',
idColumn: '082ad0bd-700f-4a80-9106-d57ccbe66424',
tasks: [
{
nameTask: 'create HTTP.CreateServer',
descriptionTask:
'specify port 3000, create get, post-requests(URL discuss with team)',
idTask: '89942407-f5ca-488f-9e4a-09b3e3e6f0b0',
checkLists: [
{
nameCheckBox: 'testing in Postman',
isChoose: false,
idCheckBox: 'd25fe3f5-6ef9-4c55-b823-9f90f4be3da2',
},
{
nameCheckBox: 'create get, post, update, put requests',
isChoose: false,
idCheckBox: '7e330f79-8e89-4fc6-9eb0-6a46b7544ae3',
},
{
nameCheckBox: 'discuss URL with team',
isChoose: false,
idCheckBox: '42a8750a-78b0-4130-b275-a4b5fe459dbf',
},
],
},
{
nameTask: 'updating.......',
descriptionTask: 'updating.......',
idTask: '1ca9c510-7110-45b5-90dc-adf5adf5d72c',
checkLists: [],
},
],
},
{
nameColumn: 'in process',
descriptionColumn: 'who perform a task',
idColumn: '35553eba-b2bb-4af4-a860-8fc71ceda6c8',
tasks: [
{
nameTask: 'create repository',
descriptionTask:
'create private repo, add collaboration, set up branch of deploy',
idTask: 'ef4d6c08-4984-454d-a30e-30f5efdb736c',
checkLists: [],
},
],
},
],
},
git clone {repository URL}
npm install или npm i
Запуск приложения в режиме разработки
npm run start:dev
npm run start:prod
Приложение прослушивает порт, указанный в .env (3000 по умолчанию). Вы можете указать другой (изменить SERVER_PORT=3000 в файле .env). Проверять работу приложения удобно с помощью Postman. Его можно установить себе на компьютер или использовать расширение для Chrome.
npm run test