Professional Documents
Culture Documents
Welcome File
Welcome File
INTRODUCTION
In this advanced module, you are tasked with creating a sophisticated project management platform
called "TaskMaster." This platform allows users to manage projects, tasks, teams, and deadlines with
complex interactions and advanced features, including role-based access control, nested tasks, and real-
time collaboration. The project is divided into two phases: the first phase focuses on creating a
comprehensive REST API, and the second phase involves developing a dynamic frontend application.
Detailed descriptions and tools are provided below.
1. Authentication
- Register
o Endpoint: /api/v1/auth/register
o Method: POST
o Description: For users to register an account.
o Request Body:
▪ full_name (required)
- Login
o Endpoint: /api/v1/auth/login
o Method: POST
o Description: For users to log into the system.
o Request Body:
▪ username
▪ password
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Login success",
"token": "generated_token",
"user": {
"id": 1,
"full_name": "John Doe",
"username": "john.doe"
}
}
- Logout
o Endpoint: /api/v1/auth/logout
o Method: POST
o Description: For users to log out.
o Request Headers: Authorization: Bearer <token>
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Logout success"
}
2. Project Management
- Create Project
o Endpoint: /api/v1/projects
o Method: POST
o Description: For users to create a new project.
o Request Headers: Authorization: Bearer <token>
o Request Body:
▪ name (required)
o Response:
▪ Success: HTTP Status Code 201
{
"message": "Project created successfully",
"project": {
"id": 1,
"name": "New Project",
"description": "Project description here",
"deadline": "2024-12-31",
"team_id": 1,
"created_at": "2024-06-03T12:00:00Z"
}
}
- Update Project
o Endpoint: /api/v1/projects/:id
o Method: PUT
o Description: For users to update an existing project. Only the project owner or an admin
can perform this action.
o Request Headers: Authorization: Bearer <token>
o Request Body:
▪ name (optional)
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Project updated successfully",
"project": {
"id": 1,
"name": "Updated Project",
"description": "Updated project description",
"deadline": "2024-12-31",
"team_id": 1,
"updated_at": "2024-06-03T12:00:00Z"
}
}
- Delete Project
o Endpoint: /api/v1/projects/:id
o Method: DELETE
o Description: For users to delete a project. Only the project owner or an admin can
perform this action.
o Request Headers: Authorization: Bearer <token>
o Response:
▪ Success: HTTP Status Code 204
▪ Unauthorized: HTTP Status Code 403
{
"message": "You do not have permission to delete this project"
}
o Response:
▪ Success: HTTP Status Code 201
{
"message": "Task created successfully",
"task": {
"id": 1,
"title": "New Task",
"description": "Task description here",
"assigned_to": 2,
"status": "pending",
"priority": "medium",
"due_date": "2024-12-31",
"project_id": 1,
"parent_task_id": null,
"created_at": "2024-06-03T12:00:00Z"
}
}
- Update Task
o Endpoint: /api/v1/projects/:project_id/tasks/:id
o Method: PUT
o Description: For users to update an existing task. Only the task creator or an admin can
perform this action.
o Request Headers: Authorization: Bearer <token>
o Request Body:
▪ title (optional)
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Task updated successfully",
"task": {
"id": 1,
"title": "Updated Task",
"description": "Updated task description",
"assigned_to": 2,
"status": "in-progress",
"priority": "high",
"due_date": "2024-12-31",
"project_id": 1,
"parent_task_id": null,
"updated_at": "2024-06-03T12:00:00Z"
}
}
▪ Unauthorized: HTTP Status Code 403
{
"message": "You do not have permission to update this task"
}
- Delete Task
o Endpoint: /api/v1/projects/:project_id/tasks/:id
o Method: DELETE
o Description: For users to delete a task. Only the task creator or an admin can perform
this action.
o Request Headers: Authorization: Bearer <token>
o Response:
▪ Success: HTTP Status Code 204
▪ Unauthorized: HTTP Status Code 403
{
"message": "You do not have permission to delete this task"
}
4. Team Management
- Create Team
o Endpoint: /api/v1/teams
o Method: POST
o Description: For users to create a new team.
o Request Headers: Authorization: Bearer <token>
o Request Body:
▪ name (required)
o Response:
▪ Success: HTTP Status Code 201
{
"message": "Team created successfully",
"team": {
"id": 1,
"name": "New Team",
"description": "Team description here",
"created_at": "2024-06-03T12:00:00Z",
"members": [
{
"id": 1,
"full_name": "John Doe",
"username": "john.doe"
},
{
"id": 2,
"full_name": "Jane Smith",
"username": "jane.smith"
}
]
}
}
- Update Team
o Endpoint: /api/v1/teams/:id
o Method: PUT
o Description: For users to update an existing team. Only team members or an admin can
perform this action.
o Request Headers: Authorization: Bearer <token>
o Request Body:
▪ name (optional)
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Team updated successfully",
"team": {
"id": 1,
"name": "Updated Team",
"description": "Updated team description",
"updated_at": "2024-06-03T12:00:00Z",
"members": [
{
"id": 1,
"full_name": "John Doe",
"username": "john.doe"
},
{
"id": 2,
"full_name": "Jane Smith",
"username": "jane.smith"
}
]
}
}
- Delete Team
o Endpoint: /api/v1/teams/:id
o Method: DELETE
o Description: For users to delete a team. Only the team owner or an admin can perform
this action.
o Request Headers: Authorization: Bearer <token>
o Response:
▪ Success: HTTP Status Code 204
▪ Unauthorized: HTTP Status Code 403
{
"message": "You do not have permission to delete this team"
}
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Role assigned successfully",
"role": {
"user_id": 1,
"role_id": 2,
"assigned_at": "2024-06-03T12:00:00Z"
}
}
- Revoke Role
o Endpoint: /api/v1/roles/revoke
o Method: POST
o Description: For admins to revoke roles from users.
o Request Headers: Authorization: Bearer <token>
o Request Body:
▪ user_id (required, user ID)
o Response:
▪ Success: HTTP Status Code 200
{
"message": "Role revoked successfully",
"role": {
"user_id": 1,
"role_id": 2,
"revoked_at": "2024-06-03T12:00:00Z"
}
}
General Requirements:
- Document title should reflect the current page.
- Display username and logout button on the navbar after login success.
- Clicking the username will go to the logged-in user's profile page.
- User can log out after clicking the logout button on the navbar.
Page Requirements:
- Register Page:
o If a user is logged in, the page should redirect to their profile page.
o Users can register an account.
o Display error messages if registration fails.
- Login Page:
o If a user is logged in, the page should redirect to their profile page.
o Users can log in with existing credentials.
o Display error messages if login fails.
- Homepage:
o Redirect to the login page if the user is not logged in.
o Display the user's projects and tasks.
o Allow users to navigate to project and task details.
- Project Page:
o Display project details, team members, and tasks.
o Allow users to create, update, and delete tasks within the project.
o Display error messages if operations fail.
- Task Page:
o Display task details, including nested tasks.
o Allow users to update task status, priority, and assignee.
o Display error messages if operations fail.
- User Profile Page:
o Display user's profile information, projects, and tasks.
o Allow users to update their profile.
o Display error messages if operations fail.
- Admin Panel:
o Only accessible by users with admin roles.
o Allow admins to manage users, teams, and roles.
o Display error messages if operations fail.
Additional Features:
- Implement real-time updates for project and task changes using WebSockets.
- Implement notifications for task assignments and deadlines.
- Implement a dashboard with analytics on project and task progress.
ER Diagram:
- Users table: id, full_name, email, username, password, created_at, updated_at
- Teams table: id, name, description, created_at, updated_at
- Projects table: id, name, description, deadline, team_id, created_at, updated_at
- Tasks table: id, title, description, assigned_to, status, priority, due_date, project_id,
parent_task_id, created_at, updated_at
- Roles table: id, name, created_at, updated_at
- UserRoles table: id, user_id, role_id, assigned_at, revoked_at