Skip to main content

Project B: Task Management System

Description​

Develop a RESTful API for a project and task management system, allowing teams to collaborate, track progress, and manage their time.


Required Features​

1. User Management​

POST   /api/auth/register     - Registration
POST /api/auth/login - Login (returns JWT)
GET /api/users/me - User profile
PUT /api/users/me - Edit profile
GET /api/users - List users (ADMIN/MANAGER)

User Entity:

  • id, email, password, firstName, lastName
  • role (ADMIN, MANAGER, MEMBER)
  • department, createdAt

2. Project Management​

GET    /api/projects              - My projects
POST /api/projects - Create project
GET /api/projects/{id} - Project details
PUT /api/projects/{id} - Edit project
DELETE /api/projects/{id} - Delete project
POST /api/projects/{id}/members - Add member
DELETE /api/projects/{id}/members/{userId} - Remove member

Project Entity:

  • id, name, description
  • owner (User)
  • members (ManyToMany User)
  • status (PLANNING, ACTIVE, ON_HOLD, COMPLETED)
  • startDate, endDate, createdAt

3. Task Management​

GET    /api/projects/{id}/tasks       - Project tasks
POST /api/projects/{id}/tasks - Create task
GET /api/tasks/{id} - Task details
PUT /api/tasks/{id} - Edit task
DELETE /api/tasks/{id} - Delete task
PUT /api/tasks/{id}/status - Change status
PUT /api/tasks/{id}/assign - Assign task
GET /api/tasks/my-tasks - My tasks

Task Entity:

  • id, title, description
  • project (ManyToOne)
  • assignee (User)
  • priority (LOW, MEDIUM, HIGH, URGENT)
  • status (TODO, IN_PROGRESS, IN_REVIEW, DONE)
  • dueDate, estimatedHours, createdAt

4. Comments and Activity​

GET    /api/tasks/{id}/comments       - Comments
POST /api/tasks/{id}/comments - Add comment
DELETE /api/comments/{id} - Delete comment
GET /api/tasks/{id}/activity - Activity history

Comment Entity:

  • id, task, author, content, createdAt

Activity Entity:

  • id, task, user, action, details, createdAt

5. Time Tracking​

POST   /api/tasks/{id}/time-entries   - Log time
GET /api/tasks/{id}/time-entries - Task time
GET /api/time-entries/my-entries - My time
GET /api/projects/{id}/time-report - Project time report

TimeEntry Entity:

  • id, task, user, hours, description, date

Database Schema​

users
├── id (PK)
├── email (UNIQUE)
├── password
├── first_name
├── last_name
├── role
├── department
└── created_at

projects
├── id (PK)
├── name
├── description
├── owner_id (FK)
├── status
├── start_date
├── end_date
└── created_at

project_members
├── project_id (FK)
└── user_id (FK)

tasks
├── id (PK)
├── title
├── description
├── project_id (FK)
├── assignee_id (FK)
├── priority
├── status
├── due_date
├── estimated_hours
└── created_at

comments
├── id (PK)
├── task_id (FK)
├── author_id (FK)
├── content
└── created_at

activities
├── id (PK)
├── task_id (FK)
├── user_id (FK)
├── action
├── details
└── created_at

time_entries
├── id (PK)
├── task_id (FK)
├── user_id (FK)
├── hours
├── description
└── date

Business Rules​

Projects​

  • Only the owner or ADMIN can delete a project
  • MANAGER can create projects
  • A member can view the projects they belong to

Tasks​

  • Only project members can view tasks
  • Assigning a task creates an activity
  • Status change creates an activity

Task Status Transitions​

TODO -> IN_PROGRESS -> IN_REVIEW -> DONE
<- (can revert back)

Permissions​

RoleProjectsTasksMembers
ADMINCRUD allCRUD allManage all
MANAGERCRUD ownsCRUD projectsManage projects
MEMBERRead assignedCRUD assigned-

Detailed Endpoints​

Projects​

POST /api/projects
Authorization: Bearer <token>
Content-Type: application/json

{
"name": "Website Redesign",
"description": "Complete redesign of company website",
"startDate": "2024-02-01",
"endDate": "2024-04-30"
}

Response 201:
{
"id": 1,
"name": "Website Redesign",
"description": "Complete redesign of company website",
"owner": { "id": 1, "firstName": "John", "lastName": "Doe" },
"status": "PLANNING",
"startDate": "2024-02-01",
"endDate": "2024-04-30",
"members": [],
"createdAt": "2024-01-15T10:30:00"
}

Tasks​

POST /api/projects/1/tasks
Authorization: Bearer <token>
Content-Type: application/json

{
"title": "Design Homepage",
"description": "Create new homepage design mockups",
"priority": "HIGH",
"dueDate": "2024-02-15",
"estimatedHours": 16,
"assigneeId": 2
}

Response 201:
{
"id": 1,
"title": "Design Homepage",
"description": "Create new homepage design mockups",
"project": { "id": 1, "name": "Website Redesign" },
"assignee": { "id": 2, "firstName": "Jane", "lastName": "Smith" },
"priority": "HIGH",
"status": "TODO",
"dueDate": "2024-02-15",
"estimatedHours": 16
}

Time Tracking​

POST /api/tasks/1/time-entries
Authorization: Bearer <token>
Content-Type: application/json

{
"hours": 4.5,
"description": "Initial design concepts",
"date": "2024-02-01"
}

Response 201:
{
"id": 1,
"task": { "id": 1, "title": "Design Homepage" },
"user": { "id": 2, "firstName": "Jane" },
"hours": 4.5,
"description": "Initial design concepts",
"date": "2024-02-01"
}

Time Report​

GET /api/projects/1/time-report
Authorization: Bearer <token>

Response 200:
{
"project": { "id": 1, "name": "Website Redesign" },
"totalHours": 45.5,
"estimatedHours": 120,
"byUser": [
{ "user": "Jane Smith", "hours": 28.5 },
{ "user": "Bob Wilson", "hours": 17.0 }
],
"byTask": [
{ "task": "Design Homepage", "logged": 16, "estimated": 16 },
{ "task": "Implement Header", "logged": 12.5, "estimated": 24 }
]
}

Required Tests​

Unit Tests​

  • ProjectService: CRUD, member management
  • TaskService: CRUD, status transitions
  • TimeEntryService: logging, calculations

Integration Tests​

  • ProjectController: all endpoints
  • TaskController: task workflow
  • Security: role-based access

Bonus Points​

FeaturePoints
WebSocket notifications+5
Kanban board data endpoint+3
Email notifications (simulation)+3
Recurring tasks+3
PDF report export+3
Statistics dashboard+5

Time Estimation​

TaskHours
Project setup and DB2
Entities and repositories5
Business services8
REST Controllers5
Security and permissions5
Tests6
Documentation2
Bonus4-8
Total33-41

Back to Final Project