# satha-1/ai-construction-market-place architecture

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

- Interactive diagram: https://gitdiagram.com/satha-1/ai-construction-market-place
- Repository: https://github.com/satha-1/ai-construction-market-place

## Overview

Conapp is a construction-estimation and vendor marketplace product. Customers create projects, upload documents, generate and verify a bill of quantities (BOQ), then source materials through vendor matching and RFQs; vendors publish catalogs and submit quotations. The React app presents public marketplace, customer, vendor, and admin workspaces over a FastAPI modular monolith. The graph includes the documented feature branches and storage/integration layers; links to unsampled subsystems use README evidence or are omitted where wiring is not shown.

Main entry points: [`frontend/src/App.tsx`](https://github.com/satha-1/ai-construction-market-place/blob/main/frontend/src/App.tsx) (Role-based workspaces), [`backend/app/db/session.py`](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/db/session.py) (PostgreSQL and pgvector), [`backend/app/modules/documents/pipeline.py`](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/documents/pipeline.py) (Document processing), [`backend/app/modules/boq`](https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/boq) (BOQ calculation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_web["Role-based workspaces<br/>[App.tsx]"]
  node_api["API client<br/>[index.ts]"]
end

subgraph group_identity["Identity and operations"]
  node_auth["Auth and roles<br/>[router.py]"]
  node_projects["Project management<br/>[router.py]"]
  node_admin["Admin console API<br/>[router.py]"]
  node_audit["Audit events<br/>[service.py]"]
  node_notifications["Notifications"]
end

subgraph group_estimate["Estimation workflow"]
  node_documents["Document processing<br/>[pipeline.py]"]
  node_rag["Embeddings and retrieval"]
  node_agent["Estimation agent<br/>[orchestrator.py]"]
  node_boq["BOQ calculation"]
  node_verification["Estimate verification<br/>[router.py]"]
end

subgraph group_sourcing["Vendor sourcing"]
  node_vendors["Vendor catalog<br/>[router.py]"]
  node_matching["Vendor matching<br/>[engine.py]"]
  node_marketplace["Public marketplace<br/>[router.py]"]
  node_rfq["RFQs and quotations<br/>[router.py]"]
end

subgraph group_platform["Runtime platform"]
  node_database[("PostgreSQL and pgvector<br/>[session.py]")]
  node_worker["Background processing<br/>[celery_app.py]"]
  node_storage["Document storage<br/>[storage.py]"]
end

node_visitor(("User"))
node_llm{{"OpenAI services"}}

node_visitor -->|"uses"| node_web
node_web -->|"calls"| node_api
node_api -.->|"HTTP requests"| node_auth
node_web -.->|"project workflows"| node_projects
node_web -.->|"uploads documents"| node_documents
node_web -.->|"views estimates"| node_boq
node_web -.->|"reviews flags"| node_verification
node_web -.->|"manages sourcing"| node_rfq
node_web -.->|"browses"| node_marketplace
node_web -.->|"administers"| node_admin
node_projects -->|"logs events"| node_audit
node_admin -->|"logs changes"| node_audit
node_documents -->|"creates embeddings"| node_rag
node_documents -->|"stores uploads"| node_storage
node_documents -.->|"queues processing"| node_worker
node_agent -.->|"retrieves context"| node_rag
node_agent -.->|"plans with"| node_llm
node_boq -->|"matches vendors"| node_matching
node_boq -->|"invokes tools"| node_agent
node_verification -->|"recalculates"| node_boq
node_vendors -->|"queues document work"| node_worker
node_vendors -->|"stores documents"| node_storage
node_matching -->|"uses retrieval"| node_rag
node_rfq -->|"notifies owners"| node_notifications
node_rfq -->|"records activity"| node_audit
node_auth -.->|"reads users"| node_database
node_projects -.->|"reads and writes"| node_database
node_documents -.->|"records documents"| node_database
node_boq -.->|"stores estimates"| node_database
node_rfq -.->|"stores quotations"| node_database
node_vendors -.->|"stores catalog"| node_database
node_marketplace -.->|"reads listings"| node_database

click node_web "https://github.com/satha-1/ai-construction-market-place/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/satha-1/ai-construction-market-place/blob/main/frontend/src/api/index.ts"
click node_auth "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/auth/router.py"
click node_projects "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/projects/router.py"
click node_admin "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/admin/router.py"
click node_audit "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/audit/service.py"
click node_notifications "https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/notifications"
click node_documents "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/documents/pipeline.py"
click node_rag "https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/rag"
click node_agent "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/agent/orchestrator.py"
click node_boq "https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/boq"
click node_verification "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/verification/router.py"
click node_vendors "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/vendors/router.py"
click node_matching "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/matching/engine.py"
click node_marketplace "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/marketplace/router.py"
click node_rfq "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/rfq/router.py"
click node_database "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/db/session.py"
click node_worker "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/celery_app.py"
click node_storage "https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/documents/storage.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_web,node_api,node_visitor toneBlue
class node_auth,node_projects,node_admin,node_audit,node_notifications toneAmber
class node_documents,node_rag,node_agent,node_boq,node_verification toneMint
class node_vendors,node_matching,node_marketplace,node_rfq toneRose
class node_database,node_worker,node_storage,node_llm toneIndigo
```

## Components

### Web application

- [Role-based workspaces](https://github.com/satha-1/ai-construction-market-place/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/satha-1/ai-construction-market-place/blob/main/frontend/src/api/index.ts): `frontend/src/api/index.ts`

### Identity and operations

- [Auth and roles](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/auth/router.py): `backend/app/modules/auth/router.py`
- [Project management](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/projects/router.py): `backend/app/modules/projects/router.py`
- [Admin console API](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/admin/router.py): `backend/app/modules/admin/router.py`
- [Audit events](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/audit/service.py): `backend/app/modules/audit/service.py`
- [Notifications](https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/notifications): `backend/app/modules/notifications`

### Estimation workflow

- [Document processing](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/documents/pipeline.py): `backend/app/modules/documents/pipeline.py`
- [Embeddings and retrieval](https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/rag): `backend/app/modules/rag`
- [Estimation agent](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/agent/orchestrator.py): `backend/app/modules/agent/orchestrator.py`
- [BOQ calculation](https://github.com/satha-1/ai-construction-market-place/tree/main/backend/app/modules/boq): `backend/app/modules/boq`
- [Estimate verification](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/verification/router.py): `backend/app/modules/verification/router.py`

### Vendor sourcing

- [Vendor catalog](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/vendors/router.py): `backend/app/modules/vendors/router.py`
- [Vendor matching](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/matching/engine.py): `backend/app/modules/matching/engine.py`
- [Public marketplace](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/marketplace/router.py): `backend/app/modules/marketplace/router.py`
- [RFQs and quotations](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/rfq/router.py): `backend/app/modules/rfq/router.py`

### Runtime platform

- [PostgreSQL and pgvector](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [Background processing](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/celery_app.py): `backend/app/celery_app.py`
- [Document storage](https://github.com/satha-1/ai-construction-market-place/blob/main/backend/app/modules/documents/storage.py): `backend/app/modules/documents/storage.py`

### Other components

- **User**
- **OpenAI services**

## Connections

- User → Role-based workspaces: uses (evidence: `README.md`)
- Role-based workspaces → API client: calls (evidence: `frontend/src/App.tsx`)
- API client → Auth and roles: HTTP requests
- Role-based workspaces → Project management: project workflows (evidence: `README.md`)
- Role-based workspaces → Document processing: uploads documents (evidence: `README.md`)
- Role-based workspaces → BOQ calculation: views estimates (evidence: `README.md`)
- Role-based workspaces → Estimate verification: reviews flags (evidence: `README.md`)
- Role-based workspaces → RFQs and quotations: manages sourcing (evidence: `README.md`)
- Role-based workspaces → Public marketplace: browses (evidence: `README.md`)
- Role-based workspaces → Admin console API: administers (evidence: `README.md`)
- Project management → Audit events: logs events (evidence: `backend/app/modules/projects/router.py`)
- Admin console API → Audit events: logs changes (evidence: `backend/app/modules/admin/router.py`)
- Document processing → Embeddings and retrieval: creates embeddings (evidence: `backend/app/modules/documents/pipeline.py`)
- Document processing → Document storage: stores uploads (evidence: `backend/app/modules/documents/pipeline.py`)
- Document processing → Background processing: queues processing (evidence: `README.md`)
- Estimation agent → Embeddings and retrieval: retrieves context
- Estimation agent → OpenAI services: plans with (evidence: `README.md`)
- BOQ calculation → Vendor matching: matches vendors (evidence: `backend/app/modules/boq/router.py`)
- BOQ calculation → Estimation agent: invokes tools (evidence: `backend/app/modules/boq/router.py`)
- Estimate verification → BOQ calculation: recalculates (evidence: `backend/app/modules/verification/router.py`)
- Vendor catalog → Background processing: queues document work (evidence: `backend/app/modules/vendors/router.py`)
- Vendor catalog → Document storage: stores documents (evidence: `backend/app/modules/vendors/router.py`)
- Vendor matching → Embeddings and retrieval: uses retrieval (evidence: `backend/app/modules/matching/engine.py`)
- RFQs and quotations → Notifications: notifies owners (evidence: `backend/app/modules/rfq/router.py`)
- RFQs and quotations → Audit events: records activity (evidence: `backend/app/modules/rfq/router.py`)
- Auth and roles → PostgreSQL and pgvector: reads users (evidence: `backend/app/modules/auth/router.py`)
- Project management → PostgreSQL and pgvector: reads and writes (evidence: `backend/app/modules/projects/router.py`)
- Document processing → PostgreSQL and pgvector: records documents
- BOQ calculation → PostgreSQL and pgvector: stores estimates (evidence: `backend/app/modules/boq/router.py`)
- RFQs and quotations → PostgreSQL and pgvector: stores quotations (evidence: `backend/app/modules/rfq/router.py`)
- Vendor catalog → PostgreSQL and pgvector: stores catalog (evidence: `backend/app/modules/vendors/router.py`)
- Public marketplace → PostgreSQL and pgvector: reads listings (evidence: `backend/app/modules/marketplace/router.py`)
