# aanchal2208/concurrent-hub- architecture

> Architecture diagram of the GitHub repository aanchal2208/concurrent-hub-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aanchal2208/concurrent-hub-
- Repository: https://github.com/aanchal2208/concurrent-hub-

## Overview

ConcurrentHub is a collaborative task-management web application. Users register or sign in, then browse, create, update, and delete tasks; updates carry a version so conflicting edits can be rejected, while per-task scheduling and reusable buffers support concurrent work. Successful task changes are persisted in PostgreSQL, recorded in the activity log, and broadcast to connected browsers. The map includes authentication, health/metrics, and live updates as supporting capabilities. Relationships reflect the README and shown source references; unsampled route and scheduler internals are not expanded beyond documented behavior.

Main entry points: [`backend/services.py`](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/services.py) (Task service), [`backend/main.py`](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/main.py) (FastAPI application), [`backend/routes.py`](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/routes.py) (HTTP routes), [`frontend/app.js`](https://github.com/aanchal2208/concurrent-hub-/blob/main/frontend/app.js) (Task interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_frontend["Task interface<br/>[app.js]"]
end

subgraph group_api["API and identity"]
  node_app["FastAPI application<br/>[main.py]"]
  node_routes["HTTP routes<br/>[routes.py]"]
  node_schemas["API models<br/>[schemas.py]"]
  node_auth["Authentication<br/>[auth.py]"]
end

subgraph group_work["Task processing"]
  node_service["Task service<br/>[services.py]"]
  node_scheduler["Per-task scheduler<br/>[scheduler.py]"]
  node_conflict["Conflict checks"]
  node_version["Version checks<br/>[version_check.py]"]
  node_buffers["Reusable buffer pool<br/>[object_pool.py]"]
end

subgraph group_data["Persistence"]
  node_repository["Task repository<br/>[repository.py]"]
  node_connections["PostgreSQL pool<br/>[postgres_db.py]"]
  node_postgres[("PostgreSQL")]
  node_schema["Database schema<br/>[schema.sql]"]
end

subgraph group_live["Live updates"]
  node_manager["Connection manager"]
  node_events["Task event builders<br/>[events.py]"]
  node_ws["WebSocket endpoint"]
end

node_user(("Collaborator"))

node_user -->|"uses"| node_frontend
node_frontend -->|"calls API"| node_app
node_frontend -->|"connects live"| node_ws
node_app -->|"mounts routes"| node_routes
node_routes -->|"validates data"| node_schemas
node_routes -->|"authenticates"| node_auth
node_routes -->|"delegates tasks"| node_service
node_app -->|"configures"| node_service
node_service -->|"schedules updates"| node_scheduler
node_service -->|"leases buffers"| node_buffers
node_service -->|"reads and writes"| node_repository
node_scheduler -.->|"checks conflicts"| node_conflict
node_scheduler -.->|"checks versions"| node_version
node_repository -->|"borrows connections"| node_connections
node_connections -->|"queries"| node_postgres
node_postgres -->|"stores tables"| node_schema
node_auth -->|"uses database pool"| node_connections
node_service -->|"builds broadcasts"| node_events
node_service -->|"broadcasts updates"| node_manager
node_app -->|"registers endpoint"| node_ws
node_ws -->|"manages connections"| node_manager
node_manager -->|"sends events"| node_frontend

click node_frontend "https://github.com/aanchal2208/concurrent-hub-/blob/main/frontend/app.js"
click node_app "https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/main.py"
click node_routes "https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/routes.py"
click node_schemas "https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/schemas.py"
click node_auth "https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/auth.py"
click node_service "https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/services.py"
click node_scheduler "https://github.com/aanchal2208/concurrent-hub-/blob/main/Scheduler/scheduler.py"
click node_conflict "https://github.com/aanchal2208/concurrent-hub-/blob/main/Scheduler/conflict_detector"
click node_version "https://github.com/aanchal2208/concurrent-hub-/blob/main/Scheduler/version_check.py"
click node_buffers "https://github.com/aanchal2208/concurrent-hub-/blob/main/resource_pool/object_pool.py"
click node_repository "https://github.com/aanchal2208/concurrent-hub-/blob/main/database/repository.py"
click node_connections "https://github.com/aanchal2208/concurrent-hub-/blob/main/database/postgres_db.py"
click node_schema "https://github.com/aanchal2208/concurrent-hub-/blob/main/database/schema.sql"
click node_manager "https://github.com/aanchal2208/concurrent-hub-/blob/main/realtime/connection_manager.py"
click node_events "https://github.com/aanchal2208/concurrent-hub-/blob/main/realtime/events.py"
click node_ws "https://github.com/aanchal2208/concurrent-hub-/blob/main/realtime/websocket_server.py"

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_frontend toneBlue
class node_app,node_routes,node_schemas,node_auth toneAmber
class node_service,node_scheduler,node_conflict,node_version,node_buffers toneMint
class node_repository,node_connections,node_postgres,node_schema toneRose
class node_manager,node_events,node_ws,node_user toneIndigo
```

## Components

### Browser client

- [Task interface](https://github.com/aanchal2208/concurrent-hub-/blob/main/frontend/app.js): `frontend/app.js`

### API and identity

- [FastAPI application](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/main.py): `backend/main.py`
- [HTTP routes](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/routes.py): `backend/routes.py`
- [API models](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/schemas.py): `backend/schemas.py`
- [Authentication](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/auth.py): `backend/auth.py`

### Task processing

- [Task service](https://github.com/aanchal2208/concurrent-hub-/blob/main/backend/services.py): `backend/services.py`
- [Per-task scheduler](https://github.com/aanchal2208/concurrent-hub-/blob/main/Scheduler/scheduler.py): `Scheduler/scheduler.py`
- [Conflict checks](https://github.com/aanchal2208/concurrent-hub-/blob/main/Scheduler/conflict_detector): `Scheduler/conflict_detector`
- [Version checks](https://github.com/aanchal2208/concurrent-hub-/blob/main/Scheduler/version_check.py): `Scheduler/version_check.py`
- [Reusable buffer pool](https://github.com/aanchal2208/concurrent-hub-/blob/main/resource_pool/object_pool.py): `resource_pool/object_pool.py`

### Persistence

- [Task repository](https://github.com/aanchal2208/concurrent-hub-/blob/main/database/repository.py): `database/repository.py`
- [PostgreSQL pool](https://github.com/aanchal2208/concurrent-hub-/blob/main/database/postgres_db.py): `database/postgres_db.py`
- **PostgreSQL**
- [Database schema](https://github.com/aanchal2208/concurrent-hub-/blob/main/database/schema.sql): `database/schema.sql`

### Live updates

- [Connection manager](https://github.com/aanchal2208/concurrent-hub-/blob/main/realtime/connection_manager.py): `realtime/connection_manager.py`
- [Task event builders](https://github.com/aanchal2208/concurrent-hub-/blob/main/realtime/events.py): `realtime/events.py`
- [WebSocket endpoint](https://github.com/aanchal2208/concurrent-hub-/blob/main/realtime/websocket_server.py): `realtime/websocket_server.py`

### Other components

- **Collaborator**

## Connections

- Collaborator → Task interface: uses (evidence: `README.md`)
- Task interface → FastAPI application: calls API (evidence: `README.md`)
- Task interface → WebSocket endpoint: connects live (evidence: `README.md`)
- FastAPI application → HTTP routes: mounts routes (evidence: `backend/main.py`)
- HTTP routes → API models: validates data (evidence: `backend/routes.py`)
- HTTP routes → Authentication: authenticates (evidence: `backend/routes.py`)
- HTTP routes → Task service: delegates tasks (evidence: `backend/routes.py`)
- FastAPI application → Task service: configures (evidence: `backend/main.py`)
- Task service → Per-task scheduler: schedules updates (evidence: `README.md`)
- Task service → Reusable buffer pool: leases buffers (evidence: `README.md`)
- Task service → Task repository: reads and writes (evidence: `README.md`)
- Per-task scheduler → Conflict checks: checks conflicts
- Per-task scheduler → Version checks: checks versions
- Task repository → PostgreSQL pool: borrows connections (evidence: `database/repository.py`)
- PostgreSQL pool → PostgreSQL: queries (evidence: `README.md`)
- PostgreSQL → Database schema: stores tables (evidence: `README.md`)
- Authentication → PostgreSQL pool: uses database pool (evidence: `backend/auth.py`)
- Task service → Task event builders: builds broadcasts (evidence: `backend/services.py`)
- Task service → Connection manager: broadcasts updates (evidence: `backend/services.py`)
- FastAPI application → WebSocket endpoint: registers endpoint (evidence: `backend/main.py`)
- WebSocket endpoint → Connection manager: manages connections (evidence: `realtime/websocket_server.py`)
- Connection manager → Task interface: sends events (evidence: `README.md`)
