Detailed expected request body, parameters, path and other information are documented in the codes in the backend. Below is an overview of the express server routes.
-
POST
/api/account/registrationDescription: Sign up for an account.
Expected request body:
interface ReqBody{ username: string; password: string; email: string; }
-
POST
/api/account/registrationAdminDescription: Sign up for an Admin account.
Expected request body:
interface ReqBody{ username: string; password: string; email: string; }
-
POST
/api/account/loginDescription: Login.
Expected request body:
interface ReqBody{ password: string; email: string; }
-
GET
/api/account/logoutLogin required
Description: Sign out.
No path parameters required since the server will use session to find the user.
-
GET
/api/account/user/:uuidLogin required
Description: Get information of an user.
uuidis the uuid of an user. -
GET
/api/account/usersAdmin required
Description: Get information of all users in database.
-
PATCH
/api/account/profileLogin required
Description: Modify profile of the current login user.
Expected request body:
interface ReqBody{ yearOfStudy?: number; program?: string; username?: string; exGPA?: number; bio?: string; courses?: string[]; }
-
POST
/api/account/comment/:uuidLogin required
Description: Add comment to an user.
Expected request body:
interface ReqBody{ comment: string; }
-
GET
/api/account/check-sessionDescription: Get user if the session is valid. Used for auto login.
-
GET
/api/project/Admin required
Description: Get all projects stored in the database.
-
GET
/api/project/id/:uuidLogin required
Description: Get information of a project.
uuidis the uuid of that project. -
POST
/api/project/Login required
Description: Create a new project.
Expected request body:
interface ReqBody{ title: string; description: string; courseCode: string; department: string; capacity: number; deadline: string; // a date string that can be parsed to Date object.(e.g. 2022-05-01) }
-
POST
/api/project/manageRequest/:uuidLogin required
Description: Manage a request sent by other users.
uuidis the uuid of a project. A request is used to join a project. Project owners can use this API to accept(decision = 0) or reject(decision = 1) a request.Expected request body:
interface ReqBody{ requesterId: string; // uuid of the requester decision: number; // 0 for approve; 1 for decline }
-
POST
/api/project/moveTask/:uuidLogin required
Description: Move a task in project with uuid
uuidto different sections. There are three sections: planning, developing and finished.- 0 -- planning
- 1 -- developing
- 2 -- finished
Expected request body:
interface ReqBody{ taskId: string; // uuid of the task previous: number; // section that this task is in before change. target: number; // section that this task is moving to. }
-
POST
/api/project/addRequest/:uuidLogin required
Description: Add a request to a project. A request is used to join a project.
Expected request body:
interface ReqBody{ info: string; }
-
PATCH
/api/project/:uuidLogin required
Description: update information of a project.
Expected request body:
interface ReqBody{ title?: string; description?: string; capacity?: number; courseCode?: string; department?: string; deadline?: string; // a date string that can be parsed to Date object.(e.g. 2022-05-01) }
-
DELETE
/api/project/delete/:uuidLogin required
Description: delete a project with uuid
uuid. -
DELETE
/api/project/deleteMember/:uuidLogin required
Description: remove a member from a project with uuid
uuid.Expected request body:
interface ReqBody{ memberId: string; // uuid of that member }
-
POST
/api/project/search?content=Description: search for projects with keyword provided in query parameter
content. An optional request body can be provided for further filtering.Expected request body (OPTIONAL):
interface ReqBody{ notFull?: boolean | null; department?: string | null; deadline?: string | null; // a date string that can be parsed to Date object.(e.g. 2022-05-01) groupSize?: string | null; }
-
GET
/api/task/Admin required
Description: Get all tasks stored in the database.
-
GET
/api/task/:uuidLogin required
Description: Get information of a task with uuid
uuid. -
POST
/api/task/Login required
Description: Create a new task.
Expected request body:
interface ReqBody{ projectId: string; // uuid of the project assigneeId: string; // uuid of the assignee title: string; description: string; dueDate: string; // a date string that can be parsed to Date object.(e.g. 2022-05-01) }
-
POST
/api/task/comment/:uuidLogin required
Description: Add new comment to a task with uuid
uuid.Expected request body:
interface ReqBody{ comment: string; }
-
PATCH
/api/task/:uuidLogin required
Description: Update information of a task with uuid
uuid.Expected request body:
interface ReqBody{ title?: string; description?: string; dueDate?: string; }
-
DELETE
/api/task/:uuidLogin required
Description: Delete a task with uuid
uuid.
-
POST
/api/report/Login required
Description: Report a comment.
Expected request body:
interface ReqBody{ comment: { targetId: string; // targetId in a comment object (a task uuid or an account uuid) userId: string; // userId in a comment object (commenter uuid) comment: string; } }
-
GET
/api/report/allAdmin required
Description: Get all reports.
-
DELETE
/api/report/delete/:uuidAdmin required
Description: Delete the comment that is mentioned in a report with uuid
uuid. -
DELETE
/api/report/ignore/:uuidAdmin required
Description: Ignore a report with uuid
uuid.