Project & Task Management
Relevant source files
The following files were used as context for generating this wiki page:
- packages/mcp-server/src/lib/schema.ts
- packages/ui-core/shared/src/lib/project/project-mutation/project-mutation.component.ts
- packages/mcp-server/src/lib/tools/tasks.ts
- apps/gauzy-e2e/src/integration/AddTasksTest.ts
- packages/core/src/lib/tasks/task.seed.ts
- packages/ui-core/shared/src/lib/project-module/project-module-mutation/project-module-mutation.component.ts
- README.md
Project and Task Management is a core feature of the Ever Gauzy platform, providing a comprehensive suite for organizing work, tracking progress, and managing resources. It is deeply integrated with other modules like Human Resource Management (HRM), Time Tracking, and Accounting to offer a unified business management experience.
This system allows users to define projects, break them down into tasks, assign them to employees or teams, and monitor their lifecycle from creation to completion. It supports various project types, billing methods, and task attributes, making it a flexible solution for different organizational needs.
Data Models and Schemas
The foundation of the Project & Task Management system is built upon a set of interconnected data entities. The primary entities are Project and Task, which are defined using Zod schemas for validation and type safety across the application, particularly within the MCP (Model Context Protocol) server.
Sources: packages/mcp-server/src/lib/schema.ts
Entity Relationship Diagram
The following diagram illustrates the key relationships between projects, tasks, and other core entities like organizations, employees, and teams.
This diagram shows that an ORGANIZATION can have multiple PROJECTs, EMPLOYEEs, and TEAMs. A PROJECT can contain TASKs, PROJECT_MODULEs, and SPRINTs. Both PROJECTs and TASKs can have EMPLOYEEs (members) and TEAMs assigned to them.
Sources: packages/mcp-server/src/lib/schema.ts:311-334, packages/mcp-server/src/lib/schema.ts:565-602
Project Schema
A Project is a high-level container for work. It includes properties for budgeting, billing, ownership, and team/member assignments.
| Field | Type | Description |
|---|---|---|
name | string | The name of the project. |
startDate | date | The start date of the project. |
endDate | date | The end date of the project. |
billing | string | Billing method (e.g., rate-based, flat fee). |
currency | CurrenciesEnum | The currency used for the project budget. |
public | boolean | Indicates if the project is publicly visible. |
owner | string | The owner of the project (e.g., client, internal). |
budget | number | The financial or time budget for the project. |
budgetType | string | The type of budget (e.g., hours, cost). |
members | Employee[] | Array of employees assigned to the project. |
teams | OrganizationTeam[] | Array of teams assigned to the project. |
tasks | Task[] | Array of tasks belonging to the project. |
modules | OrganizationProjectModule[] | Array of modules within the project. |
Sources: packages/mcp-server/src/lib/schema.ts:705-734
Task Schema
A Task represents a single unit of work within a project. It has attributes for status, priority, estimation, and assignments.
| Field | Type | Description |
|---|---|---|
title | string | The title of the task. |
description | string | A detailed description of the task. |
status | TaskStatusEnum | The current status (e.g., OPEN, IN_PROGRESS, COMPLETED). |
priority | TaskPriorityEnum | The priority level (e.g., LOW, MEDIUM, HIGH). |
size | TaskSizeEnum | The estimated size of the task (e.g., SMALL, LARGE). |
issueType | TaskTypeEnum | The type of task (e.g., BUG, FEATURE, STORY). |
estimate | number | The estimated time or points to complete the task. |
dueDate | date | The deadline for the task. |
projectId | string | The ID of the parent project. |
members | Employee[] | Array of employees assigned to the task. |
teams | OrganizationTeam[] | Array of teams assigned to the task. |
Sources: packages/mcp-server/src/lib/schema.ts:565-602
Frontend Architecture
The user interface for project and task management is built with Angular. It consists of dedicated modules for handling projects, tasks, and their related components.
Project & Task Modules
The main entry points for the UI are the ProjectsModule and TasksModule. These modules declare and import all the necessary components, services, and routes for managing projects and tasks.
This diagram shows how the main AppModule lazy-loads the PagesModule, which in turn contains the ProjectsModule and TasksModule.
Project Creation and Editing
The ProjectMutationComponent is a key UI component responsible for both creating new projects and editing existing ones.
Component Class Diagram
This diagram outlines the structure of the ProjectMutationComponent, showing its main properties and methods.
Form Structure
The component uses two reactive forms to manage project data:
form: Handles the main project attributes like name, dates, budget, members, and teams.projectSettingForm: Manages project-specific settings, such as task auto-synchronization with integrations like GitHub.
The main form is initialized with default values and validators to ensure data integrity.
// packages/ui-core/shared/src/lib/project/project-mutation/project-mutation.component.ts:50-75
static buildForm(fb: UntypedFormBuilder): UntypedFormGroup {
const form = fb.group(
{
imageUrl: [],
imageId: [],
tags: [],
teams: [],
public: [],
billable: [],
name: [null, Validators.required],
organizationContact: [],
billing: [ProjectBillingEnum.RATE],
currency: [environment.DEFAULT_CURRENCY],
startDate: [],
endDate: [],
owner: [ProjectOwnerEnum.CLIENT],
taskListType: [TaskListTypeEnum.GRID],
description: [],
code: [],
color: [],
budget: [],
budgetType: [OrganizationProjectBudgetTypeEnum.HOURS],
openSource: [],
projectUrl: [null, Validators.compose([Validators.pattern(new RegExp(patterns.websiteUrl))])],
openSourceProjectUrl: [null, Validators.compose([Validators.pattern(new RegExp(patterns.websiteUrl))])]
},
{
validators: [CompareDateValidator.validateDate('startDate', 'endDate')]
}
);
form.get('teams').setValue([]);
return form;
}
Sources: packages/ui-core/shared/src/lib/project/project-mutation/project-mutation.component.ts:50-75
API and Tooling
The backend provides a rich set of tools for interacting with tasks through the Model Context Protocol (MCP) server. These tools encapsulate the business logic for task management and are exposed as functions that can be called by clients.
The tools are registered in packages/mcp-server/src/lib/tools/tasks.ts.
| Tool Name | Description | Input Parameters |
|---|---|---|
get_tasks | Get a list of tasks for an organization or project. | projectId, employeeId, status, priority, page, limit, search, relations |
create_task | Create a new task. | task_data (object with task properties) |
get_task | Get a specific task by its ID. | id, relations |
update_task | Update an existing task. | id, task_data |
delete_task | Delete a task. | id |
bulk_create_tasks | Create multiple tasks in a single request. | tasks (array of task data objects) |
bulk_update_tasks | Update multiple tasks in a single request. | updates (array of objects with id and data) |
bulk_delete_tasks | Delete multiple tasks in a single request. | ids (array of task IDs) |
get_task_count | Get the total count of tasks. | projectId, employeeId, status |
get_my_tasks | Get tasks assigned to the current user. | status, priority, page, limit |
get_team_tasks | Get tasks assigned to a specific team. | teamId, status, page, limit |
get_task_statistics | Get task statistics for an organization. | projectId, employeeId, startDate, endDate |
assign_task_to_employee | Assign a task to an employee. | taskId, employeeId |
Sources: packages/mcp-server/src/lib/tools/tasks.ts
User Workflows
End-to-end tests provide a clear picture of user workflows for managing projects and tasks.
Creating a New Task
The following flowchart illustrates the typical steps a user takes to create a new task, as defined in the E2E tests. This process involves creating prerequisite entities like tags, projects, and employees before creating the task itself.
This workflow demonstrates the dependencies and sequence of actions required to successfully add a task to the system.
Sources: apps/gauzy-e2e/src/integration/AddTasksTest.ts:21-65, apps/gauzy-e2e/src/integration/TeamsTasksTest.ts:20-60
Data Seeding
For development and demonstration purposes, the Gauzy platform includes a data seeding mechanism for tasks. An interesting aspect of this seeder is its ability to fetch real-world data from public GitHub repositories.
The createDefaultTask and createRandomTask functions in packages/core/src/lib/tasks/task.seed.ts connect to the GitHub API to retrieve issues from the ever-co/ever-gauzy repository. These issues, along with their labels and descriptions, are then transformed into Task and Tag entities in the Gauzy database. This provides realistic and meaningful sample data for testing and demonstration.
// packages/core/src/lib/tasks/task.seed.ts:18-23
export const createDefaultTask = async (dataSource: DataSource, tenant: ITenant, organization: IOrganization) => {
const httpService = new HttpService();
console.log(`${GITHUB_API_URL}/repos/ever-co/ever-gauzy/issues`);
const issues$ = httpService
.get(`${GITHUB_API_URL}/repos/ever-co/ever-gauzy/issues`)
.pipe(map((response: AxiosResponse<any>) => response.data));
const issues: any[] = await lastValueFrom(issues$);
// ...
}
This process involves:
- Making an HTTP GET request to the GitHub API endpoint for issues.
- Parsing the response to extract issue data (title, body, labels).
- Creating corresponding
Tagentities from the issue labels. - Creating
Taskentities from the issue data, associating them with random projects and employees within the organization.
Sources: packages/core/src/lib/tasks/task.seed.ts:18-70
Conclusion
The Project & Task Management system is a cornerstone of the Ever Gauzy platform, designed for robust and flexible work management. It features well-defined data models, a modular frontend architecture, and a comprehensive set of API tools. The integration with other platform features and external services like GitHub highlights its extensibility and power as a central hub for business operations.