# hardlaz/openconstructionerp architecture

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

- Interactive diagram: https://gitdiagram.com/hardlaz/openconstructionerp
- Repository: https://github.com/hardlaz/openconstructionerp

## Overview

OpenConstructionERP is a modular construction-project workspace spanning estimating, BIM takeoff, scheduling/cost control, tendering, coordination, and reporting. A visible match-elements workflow lets an estimator run and adjust seven stages; its backend orchestrates matching against BIM and cost data. The graph also includes documented major product areas and a platform layer. Some capability nodes are supported by the README and tree but their implementation was not sampled, so their internal links are omitted; edges cite only shown source references or README statements.

Main entry points: [`backend/app/modules/match_elements/service.py`](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/service.py) (Match service), [`backend/app/modules/match_elements/pipeline.py`](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/pipeline.py) (Match stages), [`backend/app/modules/match_elements/models.py`](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/models.py) (Match records), [`backend/app/modules/boq/service.py`](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/boq/service.py) (Bill of quantities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_estimating["Estimating and BIM"]
  node_match_ui["Match workflow<br/>[MatchPipeline.tsx]"]
  node_match_api["Match API<br/>[api.ts]"]
  node_match_runner["Match stages<br/>[pipeline.py]"]
  node_match_service["Match service<br/>[service.py]"]
  node_match_models[("Match records<br/>[models.py]")]
  node_match_config["Match configuration<br/>[config.py]"]
  node_match_envelope["Match envelope<br/>[envelope.py]"]
  node_match_ranker["Vector ranker<br/>[ranker_qdrant.py]"]
  node_boq["Bill of quantities<br/>[service.py]"]
  node_bim["BIM hub<br/>[service.py]"]
  node_bim_models[("BIM records<br/>[models.py]")]
  node_cost_catalog["Cost catalog<br/>[service.py]"]
end

subgraph group_delivery["Project delivery"]
  node_schedule["Schedule and CPM<br/>[cpm.py]"]
  node_schedule_risk["Schedule risk"]
  node_resources["Resource planning<br/>[resource_engine.py]"]
  node_tendering["Tender management<br/>[service.py]"]
  node_requirements["Requirements and quality<br/>[service.py]"]
  node_property["Property development<br/>[tax_engine.py]"]
end

subgraph group_coordination["Coordination and insight"]
  node_coordination["Clash coordination<br/>[service.py]"]
  node_geo["Geo hub<br/>[tile_pipeline.py]"]
  node_dashboards["BI dashboards<br/>[service.py]"]
end

subgraph group_platform["Platform services"]
  node_app_config["Application config<br/>[config.py]"]
  node_database[("Database<br/>[database.py]")]
  node_storage[("Blob storage<br/>[storage.py]")]
  node_i18n["Localization<br/>[i18n.py]"]
  node_users[("User repository<br/>[repository.py]")]
  node_projects[("Project records<br/>[models.py]")]
end

subgraph group_automation["Pipeline automation"]
  node_pipeline_ui["Pipeline builder<br/>[PipelineNode.tsx]"]
  node_pipeline_store["Canvas state"]
  node_pipeline_api["Pipeline API<br/>[api.ts]"]
end

node_estimator(("Estimator"))

node_estimator -->|"runs and adjusts"| node_match_ui
node_match_ui -->|"requests stages"| node_match_api
node_match_api -.->|"calls stages"| node_match_runner
node_match_runner -->|"runs matching"| node_match_service
node_match_runner -->|"reads and writes"| node_match_models
node_match_service -->|"reads and writes"| node_match_models
node_match_service -->|"uses settings"| node_match_config
node_match_service -->|"uses envelope"| node_match_envelope
node_match_service -.->|"ranks candidates"| node_match_ranker
node_match_runner -->|"reads models"| node_bim_models
node_match_service -.->|"matches quantities"| node_boq
node_boq -.->|"uses cost data"| node_cost_catalog
node_bim -->|"persists BIM data"| node_bim_models
node_estimator -->|"creates estimates"| node_boq
node_estimator -->|"imports takeoff"| node_bim
node_schedule_risk -->|"uses CPM"| node_schedule
node_resources -->|"uses CPM"| node_schedule
node_estimator -->|"plans work"| node_schedule
node_estimator -->|"manages tenders"| node_tendering
node_estimator -->|"checks requirements"| node_requirements
node_estimator -->|"models development"| node_property
node_estimator -->|"reviews clashes"| node_coordination
node_estimator -->|"views project geography"| node_geo
node_estimator -->|"reviews reports"| node_dashboards
node_pipeline_ui -->|"reads canvas state"| node_pipeline_store
node_pipeline_store -->|"uses API"| node_pipeline_api
node_match_models -->|"uses database models"| node_database
node_bim_models -->|"uses database models"| node_database
node_storage -->|"loads configuration"| node_app_config
node_geo -->|"writes tile artifacts"| node_storage
node_match_service -->|"localizes messages"| node_i18n
node_match_service -.->|"uses project context"| node_projects
node_estimator -.->|"authenticates"| node_users

click node_match_ui "https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/match-elements/MatchPipeline.tsx"
click node_match_api "https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/match-elements/api.ts"
click node_match_runner "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/pipeline.py"
click node_match_service "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/service.py"
click node_match_models "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/models.py"
click node_match_config "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/match_service/config.py"
click node_match_envelope "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/match_service/envelope.py"
click node_match_ranker "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/match_service/ranker_qdrant.py"
click node_boq "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/boq/service.py"
click node_bim "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bim_hub/service.py"
click node_bim_models "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bim_hub/models.py"
click node_cost_catalog "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/catalog/service.py"
click node_schedule "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/schedule_advanced/cpm.py"
click node_schedule_risk "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/schedule_advanced/schedule_risk_engine.py"
click node_resources "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/resources/resource_engine.py"
click node_tendering "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bid_management/service.py"
click node_requirements "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bim_requirements/service.py"
click node_property "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/property_dev/tax_engine.py"
click node_coordination "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/clash/service.py"
click node_geo "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/geo_hub/tile_pipeline.py"
click node_dashboards "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bi_dashboards/service.py"
click node_pipeline_ui "https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/pipelines/canvas/PipelineNode.tsx"
click node_pipeline_store "https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/pipelines/usePipelineStore.ts"
click node_pipeline_api "https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/pipelines/api.ts"
click node_app_config "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/config.py"
click node_database "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/database.py"
click node_storage "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/storage.py"
click node_i18n "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/i18n.py"
click node_users "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/users/repository.py"
click node_projects "https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/projects/models.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_match_ui,node_match_api,node_match_runner,node_match_service,node_match_models,node_match_config,node_match_envelope,node_match_ranker,node_boq,node_bim,node_bim_models,node_cost_catalog toneBlue
class node_schedule,node_schedule_risk,node_resources,node_tendering,node_requirements,node_property toneAmber
class node_coordination,node_geo,node_dashboards toneMint
class node_app_config,node_database,node_storage,node_i18n,node_users,node_projects toneRose
class node_pipeline_ui,node_pipeline_store,node_pipeline_api,node_estimator toneIndigo
```

## Components

### Estimating and BIM

- [Match workflow](https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/match-elements/MatchPipeline.tsx): `frontend/src/features/match-elements/MatchPipeline.tsx`
- [Match API](https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/match-elements/api.ts): `frontend/src/features/match-elements/api.ts`
- [Match stages](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/pipeline.py): `backend/app/modules/match_elements/pipeline.py`
- [Match service](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/service.py): `backend/app/modules/match_elements/service.py`
- [Match records](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/match_elements/models.py): `backend/app/modules/match_elements/models.py`
- [Match configuration](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/match_service/config.py): `backend/app/core/match_service/config.py`
- [Match envelope](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/match_service/envelope.py): `backend/app/core/match_service/envelope.py`
- [Vector ranker](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/match_service/ranker_qdrant.py): `backend/app/core/match_service/ranker_qdrant.py`
- [Bill of quantities](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/boq/service.py): `backend/app/modules/boq/service.py`
- [BIM hub](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bim_hub/service.py): `backend/app/modules/bim_hub/service.py`
- [BIM records](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bim_hub/models.py): `backend/app/modules/bim_hub/models.py`
- [Cost catalog](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/catalog/service.py): `backend/app/modules/catalog/service.py`

### Project delivery

- [Schedule and CPM](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/schedule_advanced/cpm.py): `backend/app/modules/schedule_advanced/cpm.py`
- [Schedule risk](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/schedule_advanced/schedule_risk_engine.py): `backend/app/modules/schedule_advanced/schedule_risk_engine.py`
- [Resource planning](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/resources/resource_engine.py): `backend/app/modules/resources/resource_engine.py`
- [Tender management](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bid_management/service.py): `backend/app/modules/bid_management/service.py`
- [Requirements and quality](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bim_requirements/service.py): `backend/app/modules/bim_requirements/service.py`
- [Property development](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/property_dev/tax_engine.py): `backend/app/modules/property_dev/tax_engine.py`

### Coordination and insight

- [Clash coordination](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/clash/service.py): `backend/app/modules/clash/service.py`
- [Geo hub](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/geo_hub/tile_pipeline.py): `backend/app/modules/geo_hub/tile_pipeline.py`
- [BI dashboards](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/bi_dashboards/service.py): `backend/app/modules/bi_dashboards/service.py`

### Platform services

- [Application config](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/config.py): `backend/app/config.py`
- [Database](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/database.py): `backend/app/database.py`
- [Blob storage](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/storage.py): `backend/app/core/storage.py`
- [Localization](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/core/i18n.py): `backend/app/core/i18n.py`
- [User repository](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/users/repository.py): `backend/app/modules/users/repository.py`
- [Project records](https://github.com/hardlaz/openconstructionerp/blob/main/backend/app/modules/projects/models.py): `backend/app/modules/projects/models.py`

### Pipeline automation

- [Pipeline builder](https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/pipelines/canvas/PipelineNode.tsx): `frontend/src/features/pipelines/canvas/PipelineNode.tsx`
- [Canvas state](https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/pipelines/usePipelineStore.ts): `frontend/src/features/pipelines/usePipelineStore.ts`
- [Pipeline API](https://github.com/hardlaz/openconstructionerp/blob/main/frontend/src/features/pipelines/api.ts): `frontend/src/features/pipelines/api.ts`

### Other components

- **Estimator**

## Connections

- Estimator → Match workflow: runs and adjusts (evidence: `README.md`)
- Match workflow → Match API: requests stages (evidence: `frontend/src/features/match-elements/MatchPipeline.tsx`)
- Match API → Match stages: calls stages
- Match stages → Match service: runs matching (evidence: `backend/app/modules/match_elements/pipeline.py`)
- Match stages → Match records: reads and writes (evidence: `backend/app/modules/match_elements/pipeline.py`)
- Match service → Match records: reads and writes (evidence: `backend/app/modules/match_elements/service.py`)
- Match service → Match configuration: uses settings (evidence: `backend/app/modules/match_elements/service.py`)
- Match service → Match envelope: uses envelope (evidence: `backend/app/modules/match_elements/service.py`)
- Match service → Vector ranker: ranks candidates (evidence: `backend/app/modules/match_elements/service.py`)
- Match stages → BIM records: reads models (evidence: `backend/app/modules/match_elements/pipeline.py`)
- Match service → Bill of quantities: matches quantities (evidence: `backend/app/modules/match_elements/service.py`)
- Bill of quantities → Cost catalog: uses cost data
- BIM hub → BIM records: persists BIM data (evidence: `backend/app/modules/bim_hub/models.py`)
- Estimator → Bill of quantities: creates estimates (evidence: `README.md`)
- Estimator → BIM hub: imports takeoff (evidence: `README.md`)
- Schedule risk → Schedule and CPM: uses CPM (evidence: `backend/app/modules/schedule_advanced/schedule_risk_engine.py`)
- Resource planning → Schedule and CPM: uses CPM (evidence: `backend/app/modules/resources/resource_engine.py`)
- Estimator → Schedule and CPM: plans work (evidence: `README.md`)
- Estimator → Tender management: manages tenders (evidence: `README.md`)
- Estimator → Requirements and quality: checks requirements (evidence: `README.md`)
- Estimator → Property development: models development (evidence: `README.md`)
- Estimator → Clash coordination: reviews clashes (evidence: `README.md`)
- Estimator → Geo hub: views project geography (evidence: `README.md`)
- Estimator → BI dashboards: reviews reports (evidence: `README.md`)
- Pipeline builder → Canvas state: reads canvas state (evidence: `frontend/src/features/pipelines/canvas/PipelineNode.tsx`)
- Canvas state → Pipeline API: uses API (evidence: `frontend/src/features/pipelines/usePipelineStore.ts`)
- Match records → Database: uses database models (evidence: `backend/app/modules/match_elements/models.py`)
- BIM records → Database: uses database models (evidence: `backend/app/modules/bim_hub/models.py`)
- Blob storage → Application config: loads configuration (evidence: `backend/app/core/storage.py`)
- Geo hub → Blob storage: writes tile artifacts (evidence: `backend/app/modules/geo_hub/tile_pipeline.py`)
- Match service → Localization: localizes messages (evidence: `backend/app/modules/match_elements/service.py`)
- Match service → Project records: uses project context (evidence: `backend/app/modules/match_elements/service.py`)
- Estimator → User repository: authenticates
