# gauravagrawal11/schedulesync architecture

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

- Interactive diagram: https://gitdiagram.com/gauravagrawal11/schedulesync
- Repository: https://github.com/gauravagrawal11/schedulesync

## Overview

ScheduleSync connects field progress reports to project schedules, matching observations to baseline activities and supporting planner review and schedule analytics. Supervisors submit text, files or voice; reports are extracted and matched, then accepted progress updates feed sequence checks, forecasting and planner views. The README documents offline capture and safety triage, while source-index references clarify several backend handoffs. Some frontend and backend routes were not sampled, so those connections are shown only where documented; the README’s broader AI and offline descriptions are product-level evidence, not confirmation of every implementation detail.

Main entry points: [`backend/app/ingestion/router.py`](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/ingestion/router.py) (Report ingestion), [`backend/app/review/router.py`](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/review/router.py) (Planner review), [`frontend/src/api/client.ts`](https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/api/client.ts) (API client), [`backend/app/analytics/router.py`](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/router.py) (Schedule analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_field["Field capture"]
  node_field_app["Supervisor app<br/>[LogProgress.tsx]"]
  node_offline_queue[("Offline queue<br/>[queue.ts]")]
  node_sync["Offline sync<br/>[syncManager.ts]"]
  node_voice["Voice handling<br/>[router.py]"]
end

subgraph group_intelligence["Ingestion and matching"]
  node_ingestion["Report ingestion<br/>[router.py]"]
  node_parsing["Document parsing<br/>[service.py]"]
  node_extraction["Entity extraction<br/>[service.py]"]
  node_hse["HSE tagging<br/>[hse.py]"]
  node_matching["Hybrid matching<br/>[service.py]"]
  node_linking["Progress linking<br/>[service.py]"]
end

subgraph group_schedule["Schedule operations"]
  node_schedule["Schedule baseline<br/>[service.py]"]
  node_assignment["Supervisor assignment<br/>[engine.py]"]
  node_analytics["Schedule analytics<br/>[router.py]"]
  node_sequence["Sequence checks<br/>[sequence.py]"]
  node_forecast["Duration forecasting<br/>[forecasting.py]"]
end

subgraph group_governance["Review and safety"]
  node_review["Planner review<br/>[router.py]"]
  node_complaints["Safety concerns<br/>[router.py]"]
  node_notifications["Live notifications<br/>[service.py]"]
  node_planner_ui["Planner cockpit<br/>[ReviewQueue.tsx]"]
end

subgraph group_platform["Application platform"]
  node_api["API client<br/>[client.ts]"]
  node_workflow["Workflow sockets"]
  node_database[("Relational database<br/>[database.py]")]
  node_auth["Authentication<br/>[dependencies.py]"]
  node_backend_app["FastAPI application<br/>[main.py]"]
end

node_supervisor(("Field supervisor"))

node_supervisor -->|"submits reports"| node_field_app
node_field_app -->|"queues offline"| node_offline_queue
node_offline_queue -->|"flushes queue"| node_sync
node_sync -->|"sends reports"| node_api
node_field_app -->|"posts reports"| node_api
node_api -->|"calls API"| node_ingestion
node_ingestion -->|"parses uploads"| node_parsing
node_ingestion -->|"extracts entities"| node_extraction
node_ingestion -->|"requests matches"| node_matching
node_ingestion -->|"scans safety"| node_hse
node_api -.->|"uploads audio"| node_voice
node_parsing -.->|"handles audio"| node_voice
node_matching -.->|"links accepted matches"| node_linking
node_linking -->|"checks sequence"| node_sequence
node_ingestion -.->|"ingests schedules"| node_schedule
node_sequence -->|"broadcasts updates"| node_workflow
node_review -->|"applies decisions"| node_linking
node_review -->|"triggers notifications"| node_notifications
node_review -->|"checks approved work"| node_sequence
node_hse -->|"logs safety tickets"| node_complaints
node_analytics -->|"reports violations"| node_sequence
node_analytics -->|"computes risk"| node_forecast
node_analytics -.->|"reads baseline"| node_schedule
node_assignment -.->|"allocates activities"| node_schedule
node_planner_ui -->|"loads review data"| node_api
node_backend_app -->|"registers routes"| node_ingestion
node_backend_app -->|"registers routes"| node_review
node_backend_app -->|"registers routes"| node_analytics
node_ingestion -->|"persists reports"| node_database
node_review -->|"reads review records"| node_database
node_auth -->|"loads accounts"| node_database

click node_field_app "https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/supervisor/LogProgress.tsx"
click node_offline_queue "https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/supervisor/offline/queue.ts"
click node_sync "https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/supervisor/offline/syncManager.ts"
click node_api "https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/api/client.ts"
click node_ingestion "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/ingestion/router.py"
click node_voice "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/voice/router.py"
click node_parsing "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/parsing/service.py"
click node_extraction "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/extraction/service.py"
click node_hse "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/extraction/hse.py"
click node_matching "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/matching/service.py"
click node_linking "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/linking/service.py"
click node_schedule "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/schedule/service.py"
click node_assignment "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/assignment/engine.py"
click node_analytics "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/router.py"
click node_sequence "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/sequence.py"
click node_forecast "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/forecasting.py"
click node_review "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/review/router.py"
click node_complaints "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/complaints/router.py"
click node_notifications "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/notifications/service.py"
click node_workflow "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/workflow/connection_manager.py"
click node_database "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/core/database.py"
click node_auth "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/auth/dependencies.py"
click node_backend_app "https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/main.py"
click node_planner_ui "https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/planner/ReviewQueue.tsx"

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_field_app,node_offline_queue,node_sync,node_voice toneBlue
class node_ingestion,node_parsing,node_extraction,node_hse,node_matching,node_linking toneAmber
class node_schedule,node_assignment,node_analytics,node_sequence,node_forecast toneMint
class node_review,node_complaints,node_notifications,node_planner_ui toneRose
class node_api,node_workflow,node_database,node_auth,node_backend_app,node_supervisor toneIndigo
```

## Components

### Field capture

- [Supervisor app](https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/supervisor/LogProgress.tsx): `frontend/src/supervisor/LogProgress.tsx`
- [Offline queue](https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/supervisor/offline/queue.ts): `frontend/src/supervisor/offline/queue.ts`
- [Offline sync](https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/supervisor/offline/syncManager.ts): `frontend/src/supervisor/offline/syncManager.ts`
- [Voice handling](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/voice/router.py): `backend/app/voice/router.py`

### Ingestion and matching

- [Report ingestion](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/ingestion/router.py): `backend/app/ingestion/router.py`
- [Document parsing](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/parsing/service.py): `backend/app/parsing/service.py`
- [Entity extraction](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/extraction/service.py): `backend/app/extraction/service.py`
- [HSE tagging](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/extraction/hse.py): `backend/app/extraction/hse.py`
- [Hybrid matching](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/matching/service.py): `backend/app/matching/service.py`
- [Progress linking](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/linking/service.py): `backend/app/linking/service.py`

### Schedule operations

- [Schedule baseline](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/schedule/service.py): `backend/app/schedule/service.py`
- [Supervisor assignment](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/assignment/engine.py): `backend/app/assignment/engine.py`
- [Schedule analytics](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/router.py): `backend/app/analytics/router.py`
- [Sequence checks](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/sequence.py): `backend/app/analytics/sequence.py`
- [Duration forecasting](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/analytics/forecasting.py): `backend/app/analytics/forecasting.py`

### Review and safety

- [Planner review](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/review/router.py): `backend/app/review/router.py`
- [Safety concerns](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/complaints/router.py): `backend/app/complaints/router.py`
- [Live notifications](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/notifications/service.py): `backend/app/notifications/service.py`
- [Planner cockpit](https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/planner/ReviewQueue.tsx): `frontend/src/planner/ReviewQueue.tsx`

### Application platform

- [API client](https://github.com/gauravagrawal11/schedulesync/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Workflow sockets](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/workflow/connection_manager.py): `backend/app/workflow/connection_manager.py`
- [Relational database](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Authentication](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/auth/dependencies.py): `backend/app/auth/dependencies.py`
- [FastAPI application](https://github.com/gauravagrawal11/schedulesync/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **Field supervisor**

## Connections

- Field supervisor → Supervisor app: submits reports (evidence: `README.md`)
- Supervisor app → Offline queue: queues offline (evidence: `README.md`)
- Offline queue → Offline sync: flushes queue (evidence: `frontend/src/supervisor/offline/syncManager.ts`)
- Offline sync → API client: sends reports (evidence: `frontend/src/supervisor/offline/syncManager.ts`)
- Supervisor app → API client: posts reports (evidence: `README.md`)
- API client → Report ingestion: calls API (evidence: `README.md`)
- Report ingestion → Document parsing: parses uploads (evidence: `backend/app/ingestion/router.py`)
- Report ingestion → Entity extraction: extracts entities (evidence: `backend/app/ingestion/router.py`)
- Report ingestion → Hybrid matching: requests matches (evidence: `backend/app/ingestion/router.py`)
- Report ingestion → HSE tagging: scans safety (evidence: `backend/app/ingestion/router.py`)
- API client → Voice handling: uploads audio (evidence: `README.md`)
- Document parsing → Voice handling: handles audio (evidence: `backend/app/parsing/service.py`)
- Hybrid matching → Progress linking: links accepted matches (evidence: `backend/app/matching/service.py`)
- Progress linking → Sequence checks: checks sequence (evidence: `backend/app/linking/service.py`)
- Report ingestion → Schedule baseline: ingests schedules (evidence: `README.md`)
- Sequence checks → Workflow sockets: broadcasts updates (evidence: `backend/app/analytics/sequence.py`)
- Planner review → Progress linking: applies decisions (evidence: `backend/app/review/router.py`)
- Planner review → Live notifications: triggers notifications (evidence: `backend/app/review/router.py`)
- Planner review → Sequence checks: checks approved work (evidence: `backend/app/review/router.py`)
- HSE tagging → Safety concerns: logs safety tickets (evidence: `README.md`)
- Schedule analytics → Sequence checks: reports violations (evidence: `backend/app/analytics/router.py`)
- Schedule analytics → Duration forecasting: computes risk (evidence: `backend/app/analytics/router.py`)
- Schedule analytics → Schedule baseline: reads baseline (evidence: `README.md`)
- Supervisor assignment → Schedule baseline: allocates activities (evidence: `backend/app/assignment/engine.py`)
- Planner cockpit → API client: loads review data (evidence: `frontend/src/planner/ReviewQueue.tsx`)
- FastAPI application → Report ingestion: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Planner review: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Schedule analytics: registers routes (evidence: `backend/app/main.py`)
- Report ingestion → Relational database: persists reports (evidence: `backend/app/ingestion/router.py`)
- Planner review → Relational database: reads review records (evidence: `backend/app/review/router.py`)
- Authentication → Relational database: loads accounts (evidence: `backend/app/auth/dependencies.py`)
