# cos301-se-2026/timesheets-ai architecture

> Architecture diagram of the GitHub repository cos301-se-2026/timesheets-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cos301-se-2026/timesheets-ai
- Repository: https://github.com/cos301-se-2026/timesheets-ai

## Overview

Momently is a time-tracking and productivity-insights platform for an IT department. Users log work and manage tasks, projects, and timesheets; managers review team activity and insights. The backend provides the application services and stores domain data, while a separate AI service exposes analytics and forecast capabilities. The README documents Jira and GitHub integrations and AI-driven anomaly detection. Several runtime links are supported only by documentation or the sampled excerpts, so unverified links are marked dashed or omitted.

Main entry points: [`apps/frontend/client/src/app/app.routes.ts`](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/app.routes.ts) (Momently client), [`apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java`](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java) (Manager evidence review), [`apps/backend/src/main/java/timesheets/domain/TimeEntry.java`](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/domain/TimeEntry.java) (Application database), [`ai-service/app/main.py`](https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/main.py) (AI API routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["Momently client<br/>[app.routes.ts]"]
  node_work_ui["Work tracking"]
  node_timesheet_ui["Timesheets"]
  node_tasks_ui["Tasks and teams"]
  node_insights_ui["Insights views"]
end

subgraph group_core["Application backend"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_work_services["Time and timesheets"]
  node_project_services["Projects and tasks"]
  node_team_services["Teams and leave<br/>[TeamService.java]"]
  node_manager_review["Manager evidence review"]
  node_domain_store[("Application database<br/>[TimeEntry.java]")]
end

subgraph group_insights["AI insights"]
  node_ai_api["AI API routing<br/>[main.py]"]
  node_ai_analytics["Productivity analytics"]
  node_manager_analytics["Manager dashboard analytics"]
  node_forecast["Project forecasts"]
  node_ai_store[("AI data access<br/>[database.py]")]
end

subgraph group_connectors["External integrations"]
  node_github["GitHub activity<br/>[GitHubService.java]"]
  node_calendar["Calendar evidence"]
  node_jira["Jira integration<br/>[JiraAdapter.java]"]
end

node_user(("Employee or manager"))

node_user -->|"uses"| node_web
node_web -->|"routes to"| node_work_ui
node_web -->|"routes to"| node_timesheet_ui
node_web -->|"routes to"| node_tasks_ui
node_user -->|"reviews insights"| node_insights_ui
node_work_ui -.->|"submits work"| node_work_services
node_timesheet_ui -.->|"manages timesheets"| node_work_services
node_tasks_ui -.->|"manages tasks"| node_project_services
node_web -.->|"authenticates"| node_auth
node_work_services -.->|"persists entries"| node_domain_store
node_project_services -.->|"persists projects"| node_domain_store
node_team_services -.->|"reads membership"| node_domain_store
node_web -.->|"requests insights"| node_ai_api
node_ai_api -->|"dispatches routes"| node_ai_analytics
node_ai_api -->|"dispatches routes"| node_manager_analytics
node_manager_analytics -->|"queries data"| node_ai_store
node_manager_analytics -.->|"combines analytics"| node_forecast
node_manager_review -->|"fetches commits"| node_github
node_manager_review -->|"fetches events"| node_calendar
node_manager_review -->|"fetches issues"| node_jira
node_manager_review -.->|"reads timesheet entries"| node_domain_store

click node_web "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/app.routes.ts"
click node_work_ui "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/users/developer/logtime/logtime.component.ts"
click node_timesheet_ui "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/timesheets/timesheets.component.ts"
click node_tasks_ui "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/my-tasks/my-tasks.component.ts"
click node_insights_ui "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/insights/manager-insights/manager-insights.component.ts"
click node_auth "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/AuthService.java"
click node_work_services "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/TimeEntryService.java"
click node_project_services "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/ProjectService.java"
click node_team_services "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/TeamService.java"
click node_manager_review "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java"
click node_domain_store "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/domain/TimeEntry.java"
click node_ai_api "https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/main.py"
click node_ai_analytics "https://github.com/cos301-se-2026/timesheets-ai/tree/main/ai-service/app/api"
click node_manager_analytics "https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/api/manager_dashboard.py"
click node_forecast "https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/services/project_forecast.py"
click node_ai_store "https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/database.py"
click node_github "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/integration/github/GitHubService.java"
click node_calendar "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/integration/calendar/CalendarService.java"
click node_jira "https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/integration/issue/JiraAdapter.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_work_ui,node_timesheet_ui,node_tasks_ui,node_insights_ui toneBlue
class node_auth,node_work_services,node_project_services,node_team_services,node_manager_review,node_domain_store toneAmber
class node_ai_api,node_ai_analytics,node_manager_analytics,node_forecast,node_ai_store toneMint
class node_github,node_calendar,node_jira toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Momently client](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/app.routes.ts): `apps/frontend/client/src/app/app.routes.ts`
- [Work tracking](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/users/developer/logtime/logtime.component.ts): `apps/frontend/client/src/app/features/users/developer/logtime/logtime.component.ts`
- [Timesheets](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/timesheets/timesheets.component.ts): `apps/frontend/client/src/app/features/timesheets/timesheets.component.ts`
- [Tasks and teams](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/my-tasks/my-tasks.component.ts): `apps/frontend/client/src/app/features/my-tasks/my-tasks.component.ts`
- [Insights views](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/frontend/client/src/app/features/insights/manager-insights/manager-insights.component.ts): `apps/frontend/client/src/app/features/insights/manager-insights/manager-insights.component.ts`

### Application backend

- [Authentication](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/AuthService.java): `apps/backend/src/main/java/timesheets/service/AuthService.java`
- [Time and timesheets](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/TimeEntryService.java): `apps/backend/src/main/java/timesheets/service/TimeEntryService.java`
- [Projects and tasks](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/ProjectService.java): `apps/backend/src/main/java/timesheets/service/ProjectService.java`
- [Teams and leave](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/service/TeamService.java): `apps/backend/src/main/java/timesheets/service/TeamService.java`
- [Manager evidence review](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java): `apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java`
- [Application database](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/domain/TimeEntry.java): `apps/backend/src/main/java/timesheets/domain/TimeEntry.java`

### AI insights

- [AI API routing](https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/main.py): `ai-service/app/main.py`
- [Productivity analytics](https://github.com/cos301-se-2026/timesheets-ai/tree/main/ai-service/app/api): `ai-service/app/api`
- [Manager dashboard analytics](https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/api/manager_dashboard.py): `ai-service/app/api/manager_dashboard.py`
- [Project forecasts](https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/services/project_forecast.py): `ai-service/app/services/project_forecast.py`
- [AI data access](https://github.com/cos301-se-2026/timesheets-ai/blob/main/ai-service/app/database.py): `ai-service/app/database.py`

### External integrations

- [GitHub activity](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/integration/github/GitHubService.java): `apps/backend/src/main/java/timesheets/integration/github/GitHubService.java`
- [Calendar evidence](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/integration/calendar/CalendarService.java): `apps/backend/src/main/java/timesheets/integration/calendar/CalendarService.java`
- [Jira integration](https://github.com/cos301-se-2026/timesheets-ai/blob/main/apps/backend/src/main/java/timesheets/integration/issue/JiraAdapter.java): `apps/backend/src/main/java/timesheets/integration/issue/JiraAdapter.java`

### Other components

- **Employee or manager**

## Connections

- Employee or manager → Momently client: uses (evidence: `README.md`)
- Momently client → Work tracking: routes to (evidence: `apps/frontend/client/src/app/app.routes.ts`)
- Momently client → Timesheets: routes to (evidence: `apps/frontend/client/src/app/app.routes.ts`)
- Momently client → Tasks and teams: routes to (evidence: `apps/frontend/client/src/app/app.routes.ts`)
- Employee or manager → Insights views: reviews insights (evidence: `README.md`)
- Work tracking → Time and timesheets: submits work
- Timesheets → Time and timesheets: manages timesheets
- Tasks and teams → Projects and tasks: manages tasks
- Momently client → Authentication: authenticates
- Time and timesheets → Application database: persists entries
- Projects and tasks → Application database: persists projects
- Teams and leave → Application database: reads membership
- Momently client → AI API routing: requests insights
- AI API routing → Productivity analytics: dispatches routes (evidence: `ai-service/app/main.py`)
- AI API routing → Manager dashboard analytics: dispatches routes (evidence: `ai-service/app/main.py`)
- Manager dashboard analytics → AI data access: queries data (evidence: `ai-service/app/api/manager_dashboard.py`)
- Manager dashboard analytics → Project forecasts: combines analytics
- Manager evidence review → GitHub activity: fetches commits (evidence: `apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java`)
- Manager evidence review → Calendar evidence: fetches events (evidence: `apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java`)
- Manager evidence review → Jira integration: fetches issues (evidence: `apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java`)
- Manager evidence review → Application database: reads timesheet entries (evidence: `apps/backend/src/main/java/timesheets/managerassistant/ManagerAssistantScoringService.java`)
