Project Management
Relevant source files
The following files were used as context for generating this wiki page:
Project Management in the Dashboard Task Management (DTM) system serves as the structural foundation for organizing team work. It enables the categorization of tasks into specific business initiatives, tied to departments and overseen by designated Project Managers (PMs). The system implements a hierarchical access model where project visibility and administrative capabilities are strictly governed by user roles and departmental affiliations.
The core purpose of this module is to provide a container for Tasks and subtasks, ensuring that resources are allocated correctly across the organization. Projects transition through various lifecycles, typically moving through statuses such as ACTIVE, COMPLETED, or ON_HOLD.
Sources: README.md:46-51, src/main/java/com/example/demo/services/ProjectService.java:18-24
Architecture and Data Flow
The project management architecture follows a standard Spring Boot Service-Controller pattern. Administrative actions are handled by AdminService, while general project lifecycle operations (creation, retrieval, updates) are managed by ProjectService.
Project Lifecycle Flow
The following diagram illustrates the creation and management flow of a project within the system.
Role-Based Access Control (RBAC)
Access to project data is highly restricted based on the user's organizational role. This ensures data isolation between departments and projects.
| Role | Permissions | Scope |
|---|---|---|
| ADMIN | Full CRUD | Global (All projects across all departments) |
| MANAGER | Create, Edit, View | Restricted to their assigned Department |
| PM | View, Edit (limited) | Only projects where they are assigned as PM |
| TEAM | View | Only projects where they are added as members |
Sources: README.md:20-40, src/main/java/com/example/demo/services/ProjectService.java:70-96
Core Components
Backend Services
- ProjectService: Manages the logic for filtering projects based on user roles and handling updates. It ensures that when a PM is assigned to a project, they belong to the same department as the project.
- AdminService: Provides extended management capabilities for administrators, including the ability to bypass departmental restrictions during creation and comprehensive user-to-project mapping.
Sources: src/main/java/com/example/demo/services/ProjectService.java:10-16, src/main/java/com/example/demo/services/AdminService.java:132-155
Frontend Representation
The user interface utilizes a grid-based layout to display project cards. Each card provides a high-level overview including:
- Project name and description.
- Status indicator.
- List of team members (visualized as avatars).
- The designated Project Manager.
Sources: src/main/resources/templates/projects.html:48-84
Entity Relationships
The Project entity is the central node connecting departments, users (as PMs), and members.
Technical Implementation Details
Project Validation Logic
When creating or updating a project, the system performs strict validation to maintain organizational integrity. For instance, a PM cannot be assigned to a project if they belong to a different department than the project itself.
// Logic from ProjectService.java
if (project.getDepartment() != null) {
if (pm.getDepartment() == null ||
!pm.getDepartment().getId().equals(project.getDepartment().getId())) {
throw new IllegalArgumentException("PM must belong to the same department as the project");
}
}
Sources: src/main/java/com/example/demo/services/ProjectService.java:128-133
API Endpoints (Admin)
The AdminController provides RESTful endpoints for global project management.
| Method | Endpoint | Description |
|---|---|---|
GET | /api/admin/projects | Retrieve all projects in the system. |
POST | /api/admin/projects | Create a new project (Admin context). |
PATCH | /api/admin/projects/{id} | Update project details (Name, PM, Dept, Status). |
DELETE | /api/admin/projects/{id} | Permanently remove a project. |
Sources: src/main/java/com/example/demo/controllers/AdminController.java:94-119
Conclusion
Project Management within DTM acts as the primary governance layer for the task tracking system. By enforcing strict departmental boundaries and role-based visibility, the system ensures that complex organizational structures can be managed securely. The tight coupling between projects, departments, and specific user roles (PMs and Managers) facilitates clear accountability and streamlined reporting.