# dakshverma-dev/sih-2026 architecture

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

- Interactive diagram: https://gitdiagram.com/dakshverma-dev/sih-2026
- Repository: https://github.com/dakshverma-dev/sih-2026

## Overview

Field Ledger is a construction field-operations ledger. Its main workflow takes field reports through extraction, schedule matching, conflict detection, and persistence, then presents uncertain matches for human review. Supabase provides authentication and shared operational data. Separate product areas cover schedule analysis, recovery, analytics, audit, documents, and 3D site visualization. Several route implementations were not sampled; their presence and capabilities are documented by the route tree and README, but their internal calls are not inferred here.

Main entry points: [`src/lib/pipeline.ts`](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/pipeline.ts) (Report processing), [`src/lib/data.ts`](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/data.ts) (Operational data queries), [`src/integrations/supabase/client.ts`](https://github.com/dakshverma-dev/sih-2026/blob/main/src/integrations/supabase/client.ts) (Supabase services), [`src/routes/_authenticated/dashboard.tsx`](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/dashboard.tsx) (Operations dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Sign in<br/>[login.tsx]"]
  node_auth["Authentication and roles<br/>[auth.tsx]"]
  node_permissions["Role permissions<br/>[permissions.ts]"]
  node_shell["App navigation<br/>[AppShell.tsx]"]
end

subgraph group_field["Field intelligence"]
  node_updates["Field updates<br/>[field-updates.tsx]"]
  node_pipeline["Report processing<br/>[pipeline.ts]"]
  node_extraction["Evidence extraction<br/>[extraction.ts]"]
  node_matching["Activity matching<br/>[matching.ts]"]
  node_review["Review queue<br/>[review.tsx]"]
  node_evidence["Evidence details"]
end

subgraph group_operations["Project operations"]
  node_dashboard["Operations dashboard<br/>[dashboard.tsx]"]
  node_schedule["Schedule management<br/>[schedule.tsx]"]
  node_cpm["Critical path analysis<br/>[cpm.ts]"]
  node_recovery["Recovery simulator<br/>[recovery.tsx]"]
  node_analytics["Analytics and impact<br/>[analytics.tsx]"]
  node_conflicts["Conflict detection<br/>[conflicts.tsx]"]
  node_audit["Operational audit<br/>[audit.tsx]"]
  node_documents["Project documents<br/>[documents.tsx]"]
  node_scene["3D site visualization<br/>[site-3d.tsx]"]
end

subgraph group_platform["Data platform"]
  node_supabase[("Supabase services<br/>[client.ts]")]
  node_data["Operational data queries<br/>[data.ts]"]
  node_types["Domain data types<br/>[types.ts]"]
end

node_user(("Project user"))

node_user -->|"signs in"| node_login
node_login -->|"authenticates with"| node_supabase
node_user -.->|"submits reports"| node_updates
node_updates -->|"processes reports"| node_pipeline
node_pipeline -->|"reads and writes"| node_supabase
node_pipeline -->|"extracts evidence"| node_extraction
node_pipeline -->|"ranks candidates"| node_matching
node_updates -->|"loads operations data"| node_data
node_data -->|"queries records"| node_supabase
node_review -->|"loads matches and conflicts"| node_data
node_user -.->|"reviews matches"| node_review
node_review -->|"opens evidence"| node_evidence
node_evidence -->|"loads match data"| node_data
node_auth -->|"loads session and profile"| node_supabase
node_auth -->|"checks roles"| node_permissions
node_shell -->|"reads user access"| node_auth
node_shell -->|"polls notifications"| node_supabase
node_dashboard -->|"loads project data"| node_data
node_dashboard -->|"analyzes schedule"| node_cpm
node_dashboard -->|"uses processing results"| node_pipeline
node_recovery -->|"loads schedule data"| node_data
node_recovery -->|"calculates recovery"| node_cpm
node_recovery -->|"uses processing results"| node_pipeline
node_data -->|"uses project identifier"| node_pipeline
node_pipeline -->|"uses domain types"| node_types
node_data -->|"types query results"| node_types
node_user -.->|"manages schedule"| node_schedule
node_user -.->|"views analytics"| node_analytics
node_user -.->|"reviews conflicts"| node_conflicts
node_user -.->|"checks audit trail"| node_audit
node_user -.->|"views documents"| node_documents
node_user -.->|"views site scene"| node_scene

click node_login "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/login.tsx"
click node_auth "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/auth.tsx"
click node_permissions "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/permissions.ts"
click node_shell "https://github.com/dakshverma-dev/sih-2026/blob/main/src/components/AppShell.tsx"
click node_updates "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/field-updates.tsx"
click node_pipeline "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/pipeline.ts"
click node_extraction "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/extraction.ts"
click node_matching "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/matching.ts"
click node_review "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/review.tsx"
click node_evidence "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/evidence.%24matchId.tsx"
click node_dashboard "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/dashboard.tsx"
click node_schedule "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/schedule.tsx"
click node_cpm "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/cpm.ts"
click node_recovery "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/recovery.tsx"
click node_analytics "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/analytics.tsx"
click node_conflicts "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/conflicts.tsx"
click node_audit "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/audit.tsx"
click node_documents "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/documents.tsx"
click node_scene "https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/site-3d.tsx"
click node_supabase "https://github.com/dakshverma-dev/sih-2026/blob/main/src/integrations/supabase/client.ts"
click node_data "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/data.ts"
click node_types "https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/types.ts"

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_login,node_auth,node_permissions,node_shell,node_user toneBlue
class node_updates,node_pipeline,node_extraction,node_matching,node_review,node_evidence toneAmber
class node_dashboard,node_schedule,node_cpm,node_recovery,node_analytics,node_conflicts,node_audit,node_documents,node_scene toneMint
class node_supabase,node_data,node_types toneRose
```

## Components

### Access and navigation

- [Sign in](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/login.tsx): `src/routes/login.tsx`
- [Authentication and roles](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/auth.tsx): `src/lib/auth.tsx`
- [Role permissions](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/permissions.ts): `src/lib/domain/permissions.ts`
- [App navigation](https://github.com/dakshverma-dev/sih-2026/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`

### Field intelligence

- [Field updates](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/field-updates.tsx): `src/routes/_authenticated/field-updates.tsx`
- [Report processing](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/pipeline.ts): `src/lib/pipeline.ts`
- [Evidence extraction](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/extraction.ts): `src/lib/domain/extraction.ts`
- [Activity matching](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/matching.ts): `src/lib/domain/matching.ts`
- [Review queue](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/review.tsx): `src/routes/_authenticated/review.tsx`
- [Evidence details](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/evidence.%24matchId.tsx): `src/routes/_authenticated/evidence.$matchId.tsx`

### Project operations

- [Operations dashboard](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/dashboard.tsx): `src/routes/_authenticated/dashboard.tsx`
- [Schedule management](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/schedule.tsx): `src/routes/_authenticated/schedule.tsx`
- [Critical path analysis](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/cpm.ts): `src/lib/domain/cpm.ts`
- [Recovery simulator](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/recovery.tsx): `src/routes/_authenticated/recovery.tsx`
- [Analytics and impact](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/analytics.tsx): `src/routes/_authenticated/analytics.tsx`
- [Conflict detection](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/conflicts.tsx): `src/routes/_authenticated/conflicts.tsx`
- [Operational audit](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/audit.tsx): `src/routes/_authenticated/audit.tsx`
- [Project documents](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/documents.tsx): `src/routes/_authenticated/documents.tsx`
- [3D site visualization](https://github.com/dakshverma-dev/sih-2026/blob/main/src/routes/_authenticated/site-3d.tsx): `src/routes/_authenticated/site-3d.tsx`

### Data platform

- [Supabase services](https://github.com/dakshverma-dev/sih-2026/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [Operational data queries](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/data.ts): `src/lib/data.ts`
- [Domain data types](https://github.com/dakshverma-dev/sih-2026/blob/main/src/lib/domain/types.ts): `src/lib/domain/types.ts`

### Other components

- **Project user**

## Connections

- Project user → Sign in: signs in (evidence: `src/routes/login.tsx`)
- Sign in → Supabase services: authenticates with (evidence: `src/integrations/supabase/client.ts`)
- Project user → Field updates: submits reports
- Field updates → Report processing: processes reports (evidence: `src/routes/_authenticated/field-updates.tsx`)
- Report processing → Supabase services: reads and writes (evidence: `src/lib/pipeline.ts`)
- Report processing → Evidence extraction: extracts evidence (evidence: `src/lib/pipeline.ts`)
- Report processing → Activity matching: ranks candidates (evidence: `src/lib/pipeline.ts`)
- Field updates → Operational data queries: loads operations data (evidence: `src/routes/_authenticated/field-updates.tsx`)
- Operational data queries → Supabase services: queries records (evidence: `src/lib/data.ts`)
- Review queue → Operational data queries: loads matches and conflicts (evidence: `src/routes/_authenticated/review.tsx`)
- Project user → Review queue: reviews matches
- Review queue → Evidence details: opens evidence (evidence: `src/routes/_authenticated/review.tsx`)
- Evidence details → Operational data queries: loads match data (evidence: `src/routes/_authenticated/evidence.$matchId.tsx`)
- Authentication and roles → Supabase services: loads session and profile (evidence: `src/lib/auth.tsx`)
- Authentication and roles → Role permissions: checks roles (evidence: `src/lib/auth.tsx`)
- App navigation → Authentication and roles: reads user access (evidence: `src/components/AppShell.tsx`)
- App navigation → Supabase services: polls notifications (evidence: `src/components/AppShell.tsx`)
- Operations dashboard → Operational data queries: loads project data (evidence: `src/routes/_authenticated/dashboard.tsx`)
- Operations dashboard → Critical path analysis: analyzes schedule (evidence: `src/routes/_authenticated/dashboard.tsx`)
- Operations dashboard → Report processing: uses processing results (evidence: `src/routes/_authenticated/dashboard.tsx`)
- Recovery simulator → Operational data queries: loads schedule data (evidence: `src/routes/_authenticated/recovery.tsx`)
- Recovery simulator → Critical path analysis: calculates recovery (evidence: `src/routes/_authenticated/recovery.tsx`)
- Recovery simulator → Report processing: uses processing results (evidence: `src/routes/_authenticated/recovery.tsx`)
- Operational data queries → Report processing: uses project identifier (evidence: `src/lib/data.ts`)
- Report processing → Domain data types: uses domain types (evidence: `src/lib/pipeline.ts`)
- Operational data queries → Domain data types: types query results (evidence: `src/lib/data.ts`)
- Project user → Schedule management: manages schedule
- Project user → Analytics and impact: views analytics
- Project user → Conflict detection: reviews conflicts
- Project user → Operational audit: checks audit trail
- Project user → Project documents: views documents
- Project user → 3D site visualization: views site scene
