# mohomad-ahnaf/odan-construction-estimates architecture

> Architecture diagram of the GitHub repository mohomad-ahnaf/odan-construction-estimates, 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/mohomad-ahnaf/odan-construction-estimates
- Repository: https://github.com/mohomad-ahnaf/odan-construction-estimates

## Overview

Odan is a construction estimating workspace. Users sign in, manage clients and projects, create and approve estimates, and produce PDF or Excel exports; project workflows also cover client-facing estimate compilations, documents, and plan takeoffs. The graph preserves the documented dashboard, audit, designer, site-photo, unit-conversion, and Google Drive capabilities. Source excerpts show selected frontend, authentication, and service relationships; unsampled controller and route wiring is represented only where supported by the README or index.

Main entry points: [`frontend/src/App.tsx`](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/App.tsx) (Application routes), [`backend/src/app.ts`](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/app.ts) (Express API), [`frontend/src/lib/api.ts`](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/lib/api.ts) (API client), [`backend/src/services/export.service.ts`](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/export.service.ts) (Estimate exports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_app["Application routes<br/>[App.tsx]"]
  node_authui["Session UI<br/>[auth.tsx]"]
  node_clientui["Client and project workspace<br/>[ClientDetail.tsx]"]
  node_estimateui["Estimate workspace<br/>[EstimateEditor.tsx]"]
  node_clientestimateui["Client estimate form"]
  node_dashboard["Dashboard and audit<br/>[Dashboard.tsx]"]
  node_sitephotos["Site photos<br/>[SitePhotos.tsx]"]
  node_unitconverter["Unit converter<br/>[UnitConverter.tsx]"]
  node_designer["Designer workspace"]
  node_planui["Plan measurement workspace"]
  node_documentsui["Project documents"]
end

subgraph group_api["API and access"]
  node_api["API client<br/>[api.ts]"]
  node_server["Express API<br/>[app.ts]"]
  node_auth["Authentication service<br/>[auth.service.ts]"]
end

subgraph group_estimating["Estimating"]
  node_estimate["Estimate service"]
  node_estimateexport["Estimate exports<br/>[export.service.ts]"]
  node_totals["Estimate totals<br/>[totals.ts]"]
  node_pdfbrowser["PDF browser rendering<br/>[pdf-browser.ts]"]
end

subgraph group_projecttools["Project tools"]
  node_planservice["Plan measurement service"]
  node_google["Google Drive integration"]
end

subgraph group_persistence["Persistence"]
  node_authrepo["Authentication repository<br/>[auth.repository.ts]"]
  node_database[("PostgreSQL database<br/>[db.ts]")]
end

node_user(("Staff user"))

node_user -->|"uses"| node_app
node_app -->|"checks session"| node_authui
node_app -->|"routes to"| node_clientui
node_app -->|"routes to"| node_estimateui
node_app -->|"routes to"| node_clientestimateui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_sitephotos
node_app -->|"routes to"| node_unitconverter
node_app -->|"routes to"| node_designer
node_app -->|"routes to"| node_planui
node_app -->|"routes to"| node_documentsui
node_authui -->|"requests session"| node_api
node_clientui -->|"requests client data"| node_api
node_clientestimateui -->|"requests estimates"| node_api
node_api -->|"calls API"| node_server
node_server -->|"loads session"| node_auth
node_auth -->|"reads and writes"| node_authrepo
node_authrepo -->|"queries"| node_database
node_estimate -->|"calculates totals"| node_totals
node_estimateexport -->|"loads estimates"| node_estimate
node_estimateexport -->|"uses totals"| node_totals
node_estimateexport -->|"renders PDF"| node_pdfbrowser
node_planui -.->|"uses API"| node_server
node_documentsui -.->|"uses API"| node_server
node_sitephotos -.->|"uses API"| node_server
node_designer -.->|"uses API"| node_server
node_server -.->|"serves measurements"| node_planservice
node_server -.->|"serves Drive integration"| node_google

click node_app "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/auth.tsx"
click node_clientui "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/ClientDetail.tsx"
click node_estimateui "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/EstimateEditor.tsx"
click node_clientestimateui "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/ClientEstimateForm.tsx"
click node_dashboard "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/Dashboard.tsx"
click node_sitephotos "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/SitePhotos.tsx"
click node_unitconverter "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/UnitConverter.tsx"
click node_designer "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/DesignerWorkspace.tsx"
click node_planui "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/PlanMeasurementWorkspace.tsx"
click node_documentsui "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/ProjectDocuments.tsx"
click node_api "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/lib/api.ts"
click node_server "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/app.ts"
click node_auth "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/auth.service.ts"
click node_authrepo "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/repositories/auth.repository.ts"
click node_estimate "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/estimate.service.ts"
click node_estimateexport "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/export.service.ts"
click node_totals "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/totals.ts"
click node_pdfbrowser "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/pdf-browser.ts"
click node_planservice "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/plan-measurement.service.ts"
click node_google "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/google-drive.service.ts"
click node_database "https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/db.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_app,node_authui,node_clientui,node_estimateui,node_clientestimateui,node_dashboard,node_sitephotos,node_unitconverter,node_designer,node_planui,node_documentsui,node_user toneBlue
class node_api,node_server,node_auth toneAmber
class node_estimate,node_estimateexport,node_totals,node_pdfbrowser toneMint
class node_planservice,node_google toneRose
class node_authrepo,node_database toneIndigo
```

## Components

### Workspace UI

- [Application routes](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session UI](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/auth.tsx): `frontend/src/auth.tsx`
- [Client and project workspace](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/ClientDetail.tsx): `frontend/src/pages/ClientDetail.tsx`
- [Estimate workspace](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/EstimateEditor.tsx): `frontend/src/pages/EstimateEditor.tsx`
- [Client estimate form](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/ClientEstimateForm.tsx): `frontend/src/components/ClientEstimateForm.tsx`
- [Dashboard and audit](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Site photos](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/SitePhotos.tsx): `frontend/src/pages/SitePhotos.tsx`
- [Unit converter](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/pages/UnitConverter.tsx): `frontend/src/pages/UnitConverter.tsx`
- [Designer workspace](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/DesignerWorkspace.tsx): `frontend/src/components/DesignerWorkspace.tsx`
- [Plan measurement workspace](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/PlanMeasurementWorkspace.tsx): `frontend/src/components/PlanMeasurementWorkspace.tsx`
- [Project documents](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/components/ProjectDocuments.tsx): `frontend/src/components/ProjectDocuments.tsx`

### API and access

- [API client](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Express API](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Authentication service](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/auth.service.ts): `backend/src/services/auth.service.ts`

### Estimating

- [Estimate service](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/estimate.service.ts): `backend/src/services/estimate.service.ts`
- [Estimate exports](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/export.service.ts): `backend/src/services/export.service.ts`
- [Estimate totals](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/totals.ts): `backend/src/services/totals.ts`
- [PDF browser rendering](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/pdf-browser.ts): `backend/src/services/pdf-browser.ts`

### Project tools

- [Plan measurement service](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/plan-measurement.service.ts): `backend/src/services/plan-measurement.service.ts`
- [Google Drive integration](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/services/google-drive.service.ts): `backend/src/services/google-drive.service.ts`

### Persistence

- [Authentication repository](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/repositories/auth.repository.ts): `backend/src/repositories/auth.repository.ts`
- [PostgreSQL database](https://github.com/mohomad-ahnaf/odan-construction-estimates/blob/main/backend/src/db.ts): `backend/src/db.ts`

### Other components

- **Staff user**

## Connections

- Staff user → Application routes: uses (evidence: `frontend/src/App.tsx`)
- Application routes → Session UI: checks session (evidence: `frontend/src/App.tsx`)
- Application routes → Client and project workspace: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Estimate workspace: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Client estimate form: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Dashboard and audit: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Site photos: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Unit converter: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Designer workspace: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Plan measurement workspace: routes to (evidence: `frontend/src/App.tsx`)
- Application routes → Project documents: routes to (evidence: `frontend/src/App.tsx`)
- Session UI → API client: requests session (evidence: `frontend/src/auth.tsx`)
- Client and project workspace → API client: requests client data (evidence: `frontend/src/pages/ClientDetail.tsx`)
- Client estimate form → API client: requests estimates (evidence: `frontend/src/components/ClientEstimateForm.tsx`)
- API client → Express API: calls API (evidence: `README.md`)
- Express API → Authentication service: loads session (evidence: `backend/src/app.ts`)
- Authentication service → Authentication repository: reads and writes (evidence: `backend/src/services/auth.service.ts`)
- Authentication repository → PostgreSQL database: queries (evidence: `backend/src/repositories/auth.repository.ts`)
- Estimate service → Estimate totals: calculates totals (evidence: `backend/src/services/estimate.service.ts`)
- Estimate exports → Estimate service: loads estimates (evidence: `backend/src/services/export.service.ts`)
- Estimate exports → Estimate totals: uses totals (evidence: `backend/src/services/export.service.ts`)
- Estimate exports → PDF browser rendering: renders PDF (evidence: `backend/src/services/export.service.ts`)
- Plan measurement workspace → Express API: uses API
- Project documents → Express API: uses API
- Site photos → Express API: uses API
- Designer workspace → Express API: uses API
- Express API → Plan measurement service: serves measurements
- Express API → Google Drive integration: serves Drive integration
