# sofdev005/teamflow-backend-api architecture

> Architecture diagram of the GitHub repository sofdev005/teamflow-backend-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sofdev005/teamflow-backend-api
- Repository: https://github.com/sofdev005/teamflow-backend-api

## Overview

TeamFlow is a collaborative project and task-management API: users authenticate into organizations, work with projects and board columns, and create, view, update, move, and delete tasks. The application also exposes organization and project membership features, with project presence and a SignalR hub suggesting realtime collaboration. Application handlers use domain entities and a database-context abstraction; infrastructure supplies persistence and authentication services. Source excerpts show selected calls and context wiring, but not every controller, handler, or realtime route, so unverified links are omitted.

Main entry points: [`TeamFlow.Application/Common/Interfaces/IApplicationDbContext.cs`](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Application/Common/Interfaces/IApplicationDbContext.cs) (Database contract), [`TeamFlow.Application/Features/Projects`](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Projects) (Project management), [`TeamFlow.Application/Authentication`](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Authentication) (Register and login), [`TeamFlow.Application/Features/Boards`](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Boards) (Board columns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API access"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_boards_api["Boards API"]
  node_projects_api["Projects API"]
  node_tasks_api["Tasks API<br/>[TasksController.cs]"]
  node_orgs_api["Organizations API"]
  node_hub["Board realtime hub<br/>[BoardHub.cs]"]
end

subgraph group_features["Application features"]
  node_auth["Register and login<br/>[Authentication]"]
  node_boards["Board columns<br/>[Boards]"]
  node_projects["Project management<br/>[Projects]"]
  node_tasks["Task management<br/>[Tasks]"]
  node_org_features["Organization membership<br/>[Organizations]"]
  node_presence["Project presence"]
end

subgraph group_domain["Domain model"]
  node_domain_entities["Core entities<br/>[Entities]"]
  node_task_entity["Task behavior<br/>[TaskItem.cs]"]
  node_org_entity["Organization model<br/>[Organization.cs]"]
  node_project_entity["Project model<br/>[Project.cs]"]
end

subgraph group_infra["Infrastructure"]
  node_db_contract["Database contract"]
  node_db[("EF Core database")]
  node_jwt["JWT generator"]
  node_current_user["Current user context"]
  node_notifier["Realtime notifier"]
  node_worker["Background worker<br/>[Worker.cs]"]
end

node_user(("Team member"))

node_user -->|"authenticates"| node_auth_api
node_user -->|"manages boards"| node_boards_api
node_user -->|"manages projects"| node_projects_api
node_user -->|"manages tasks"| node_tasks_api
node_user -->|"manages membership"| node_orgs_api
node_boards_api -->|"dispatches"| node_boards
node_projects_api -->|"dispatches"| node_projects
node_tasks_api -->|"dispatches"| node_tasks
node_auth_api -.->|"dispatches"| node_auth
node_orgs_api -.->|"dispatches"| node_org_features
node_auth -->|"reads users"| node_db_contract
node_auth -->|"generates token"| node_jwt
node_boards -->|"reads and writes"| node_db_contract
node_boards -->|"checks access"| node_current_user
node_projects -->|"uses data"| node_db_contract
node_projects -.->|"includes presence"| node_presence
node_presence -->|"records activity"| node_db_contract
node_tasks -->|"uses data"| node_db_contract
node_db_contract -->|"implemented by"| node_db
node_db -->|"persists"| node_domain_entities
node_tasks -->|"moves tasks"| node_task_entity
node_projects -.->|"manages projects"| node_project_entity
node_org_features -.->|"manages organizations"| node_org_entity
node_hub -.->|"uses notifications"| node_notifier

click node_auth_api "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/AuthController.cs"
click node_boards_api "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/BoardsController.cs"
click node_projects_api "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/ProjectsController.cs"
click node_tasks_api "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/TasksController.cs"
click node_orgs_api "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/OrganizationsController.cs"
click node_auth "https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Authentication"
click node_boards "https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Boards"
click node_projects "https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Projects"
click node_tasks "https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Tasks"
click node_org_features "https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Organizations"
click node_presence "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Application/Features/Projects/Members/GetProjectMembersQuery.cs"
click node_hub "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Hubs/BoardHub.cs"
click node_domain_entities "https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Domain/Entities"
click node_task_entity "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Domain/Entities/TaskItem.cs"
click node_org_entity "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Domain/Entities/Organization.cs"
click node_project_entity "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Domain/Entities/Project.cs"
click node_db_contract "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Application/Common/Interfaces/IApplicationDbContext.cs"
click node_db "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure.Persistence/TeamFlowDbContext.cs"
click node_jwt "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure/Authentication/JwtTokenGenerator.cs"
click node_current_user "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure/Services/CurrentUserService.cs"
click node_notifier "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure/Services/SignalRRealtimeNotifier.cs"
click node_worker "https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.BackgroundJobs/Worker.cs"

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_auth_api,node_boards_api,node_projects_api,node_tasks_api,node_orgs_api,node_hub toneBlue
class node_auth,node_boards,node_projects,node_tasks,node_org_features,node_presence toneAmber
class node_domain_entities,node_task_entity,node_org_entity,node_project_entity toneMint
class node_db_contract,node_db,node_jwt,node_current_user,node_notifier,node_worker toneRose
class node_user toneIndigo
```

## Components

### API access

- [Authentication API](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/AuthController.cs): `TeamFlow.Api/Controllers/AuthController.cs`
- [Boards API](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/BoardsController.cs): `TeamFlow.Api/Controllers/BoardsController.cs`
- [Projects API](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/ProjectsController.cs): `TeamFlow.Api/Controllers/ProjectsController.cs`
- [Tasks API](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/TasksController.cs): `TeamFlow.Api/Controllers/TasksController.cs`
- [Organizations API](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Controllers/OrganizationsController.cs): `TeamFlow.Api/Controllers/OrganizationsController.cs`
- [Board realtime hub](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Api/Hubs/BoardHub.cs): `TeamFlow.Api/Hubs/BoardHub.cs`

### Application features

- [Register and login](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Authentication): `TeamFlow.Application/Authentication`
- [Board columns](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Boards): `TeamFlow.Application/Features/Boards`
- [Project management](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Projects): `TeamFlow.Application/Features/Projects`
- [Task management](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Tasks): `TeamFlow.Application/Features/Tasks`
- [Organization membership](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Application/Features/Organizations): `TeamFlow.Application/Features/Organizations`
- [Project presence](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Application/Features/Projects/Members/GetProjectMembersQuery.cs): `TeamFlow.Application/Features/Projects/Members/GetProjectMembersQuery.cs`

### Domain model

- [Core entities](https://github.com/sofdev005/teamflow-backend-api/tree/main/TeamFlow.Domain/Entities): `TeamFlow.Domain/Entities`
- [Task behavior](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Domain/Entities/TaskItem.cs): `TeamFlow.Domain/Entities/TaskItem.cs`
- [Organization model](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Domain/Entities/Organization.cs): `TeamFlow.Domain/Entities/Organization.cs`
- [Project model](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Domain/Entities/Project.cs): `TeamFlow.Domain/Entities/Project.cs`

### Infrastructure

- [Database contract](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Application/Common/Interfaces/IApplicationDbContext.cs): `TeamFlow.Application/Common/Interfaces/IApplicationDbContext.cs`
- [EF Core database](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure.Persistence/TeamFlowDbContext.cs): `TeamFlow.Infrastructure.Persistence/TeamFlowDbContext.cs`
- [JWT generator](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure/Authentication/JwtTokenGenerator.cs): `TeamFlow.Infrastructure/Authentication/JwtTokenGenerator.cs`
- [Current user context](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure/Services/CurrentUserService.cs): `TeamFlow.Infrastructure/Services/CurrentUserService.cs`
- [Realtime notifier](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.Infrastructure/Services/SignalRRealtimeNotifier.cs): `TeamFlow.Infrastructure/Services/SignalRRealtimeNotifier.cs`
- [Background worker](https://github.com/sofdev005/teamflow-backend-api/blob/main/TeamFlow.BackgroundJobs/Worker.cs): `TeamFlow.BackgroundJobs/Worker.cs`

### Other components

- **Team member**

## Connections

- Team member → Authentication API: authenticates
- Team member → Boards API: manages boards
- Team member → Projects API: manages projects
- Team member → Tasks API: manages tasks
- Team member → Organizations API: manages membership
- Boards API → Board columns: dispatches (evidence: `TeamFlow.Api/Controllers/BoardsController.cs`)
- Projects API → Project management: dispatches (evidence: `TeamFlow.Api/Controllers/ProjectsController.cs`)
- Tasks API → Task management: dispatches (evidence: `TeamFlow.Api/Controllers/TasksController.cs`)
- Authentication API → Register and login: dispatches
- Organizations API → Organization membership: dispatches
- Register and login → Database contract: reads users (evidence: `TeamFlow.Application/Authentication/Queries/Login/LoginQueryHandler.cs`)
- Register and login → JWT generator: generates token (evidence: `TeamFlow.Application/Authentication/Queries/Login/LoginQueryHandler.cs`)
- Board columns → Database contract: reads and writes (evidence: `TeamFlow.Application/Features/Boards/Queries/GetBoardColumns/GetBoardColumnsQueryHandler.cs`)
- Board columns → Current user context: checks access (evidence: `TeamFlow.Application/Features/Boards/Queries/GetBoardColumns/GetBoardColumnsQueryHandler.cs`)
- Project management → Database contract: uses data (evidence: `TeamFlow.Application/Features/Projects/Members/GetProjectMembersQuery.cs`)
- Project management → Project presence: includes presence
- Project presence → Database contract: records activity (evidence: `TeamFlow.Application/Features/Projects/Members/GetProjectMembersQuery.cs`)
- Task management → Database contract: uses data (evidence: `TeamFlow.Application/Features/Tasks/Queries/GetTasks/GetTasksQueryHandler.cs`)
- Database contract → EF Core database: implemented by (evidence: `TeamFlow.Infrastructure.Persistence/TeamFlowDbContext.cs`)
- EF Core database → Core entities: persists (evidence: `TeamFlow.Infrastructure.Persistence/TeamFlowDbContext.cs`)
- Task management → Task behavior: moves tasks (evidence: `TeamFlow.Application/Features/Tasks/Commands/MoveTask/MoveTaskCommandHandler.cs`)
- Project management → Project model: manages projects (evidence: `TeamFlow.Application/Features/Projects/Members/GetProjectMembersQuery.cs`)
- Organization membership → Organization model: manages organizations
- Board realtime hub → Realtime notifier: uses notifications
