# claower3d/construction-main architecture

> Architecture diagram of the GitHub repository claower3d/construction-main, 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/claower3d/construction-main
- Repository: https://github.com/claower3d/construction-main

## Overview

QazGost AI is a Kazakhstan construction platform whose documented technical workflow runs from a React client through a Go REST backend to Python AI services. Users submit construction photos for defect/object analysis, LiDAR scans for measurements and standards checks, or engineering inputs for norm-based estimates and reports. The tree also shows broader engineer, executor, and manager workflows. The README documents the service topology; sampled pipeline and API excerpts confirm selected analysis and calculation stages, but many UI and backend connections remain unverified.

Main entry points: [`ai-service/app/services/pipeline.py`](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/pipeline.py) (Photo analysis pipeline), [`ai-service/app/api/v1/engineering.py`](https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py) (FastAPI service), [`go-backend/cmd/server/main.go`](https://github.com/claower3d/construction-main/blob/main/go-backend/cmd/server/main.go) (Go API server), [`frontend/src/App.jsx`](https://github.com/claower3d/construction-main/blob/main/frontend/src/App.jsx) (React client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client applications"]
  node_react["React client<br/>[App.jsx]"]
  node_engineer_ui["Engineer workspace"]
  node_mobile_engineer["Engineer mobile<br/>[engineerApi.js]"]
end

subgraph group_gateway["API and platform"]
  node_go_api["Go API server<br/>[main.go]"]
  node_go_store[("SQLite data store<br/>[database.go]")]
  node_python_api["FastAPI service<br/>[engineering.py]"]
  node_go_store_web[("Web platform database<br/>[connection.js]")]
end

subgraph group_vision["Photo analysis"]
  node_photo_pipeline["Photo analysis pipeline<br/>[pipeline.py]"]
  node_object_detector["RF-DETR detector<br/>[rfdetr.py]"]
  node_defect_detector["Defect analysis<br/>[defect_detector.py]"]
  node_qwen["Vision-language analysis<br/>[qwen_vlm.py]"]
  node_sam["Mask segmentation<br/>[sam_segmentor.py]"]
  node_calibrator["Scale calibration<br/>[calibrator.py]"]
  node_volume["Volume measurement<br/>[volume.py]"]
end

subgraph group_engineering["Engineering tools"]
  node_estimator["Automatic estimator<br/>[estimator.py]"]
  node_lidar_api["LiDAR endpoints<br/>[engineering.py]"]
  node_lidar["Point-cloud processor<br/>[lidar.py]"]
  node_calc_api["Calculation endpoints<br/>[engineering.py]"]
  node_calc["Engineering calculator"]
  node_reports["PDF and Excel reports"]
end

node_user(("Construction user"))

node_user -->|"uses"| node_react
node_react -->|"sends API requests"| node_go_api
node_go_api -->|"proxies AI requests"| node_python_api
node_engineer_ui -.->|"supports engineer role"| node_user
node_mobile_engineer -.->|"syncs engineer data"| node_go_store_web
node_go_api -->|"uses SQLite"| node_go_store
node_python_api -.->|"runs photo analysis"| node_photo_pipeline
node_photo_pipeline -->|"detects objects"| node_object_detector
node_photo_pipeline -->|"analyzes defects"| node_defect_detector
node_photo_pipeline -->|"analyzes image"| node_qwen
node_photo_pipeline -->|"refines masks"| node_sam
node_photo_pipeline -->|"calibrates scale"| node_calibrator
node_photo_pipeline -->|"measures volumes"| node_volume
node_photo_pipeline -->|"generates estimate"| node_estimator
node_python_api -->|"processes scans"| node_lidar
node_python_api -->|"calculates costs"| node_calc
node_python_api -->|"generates reports"| node_reports
node_user -->|"submits LiDAR scan"| node_lidar_api
node_user -->|"submits estimate inputs"| node_calc_api

click node_react "https://github.com/claower3d/construction-main/blob/main/frontend/src/App.jsx"
click node_engineer_ui "https://github.com/claower3d/construction-main/blob/main/frontend/src/components/EngineerDashboardPage.jsx"
click node_mobile_engineer "https://github.com/claower3d/construction-main/blob/main/mobile-engineer/src/api/engineerApi.js"
click node_go_api "https://github.com/claower3d/construction-main/blob/main/go-backend/cmd/server/main.go"
click node_go_store "https://github.com/claower3d/construction-main/blob/main/go-backend/pkg/database/database.go"
click node_python_api "https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py"
click node_photo_pipeline "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/pipeline.py"
click node_object_detector "https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/rfdetr.py"
click node_defect_detector "https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/defect_detector.py"
click node_qwen "https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/qwen_vlm.py"
click node_sam "https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/sam_segmentor.py"
click node_calibrator "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/calibrator.py"
click node_volume "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/volume.py"
click node_estimator "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/estimator.py"
click node_lidar_api "https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py"
click node_lidar "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/lidar.py"
click node_calc_api "https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py"
click node_calc "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/engineering_calc.py"
click node_reports "https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/report_generator.py"
click node_go_store_web "https://github.com/claower3d/construction-main/blob/main/WebVersion/backend/src/database/connection.js"

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_react,node_engineer_ui,node_mobile_engineer,node_user toneBlue
class node_go_api,node_go_store,node_python_api,node_go_store_web toneAmber
class node_photo_pipeline,node_object_detector,node_defect_detector,node_qwen,node_sam,node_calibrator,node_volume toneMint
class node_estimator,node_lidar_api,node_lidar,node_calc_api,node_calc,node_reports toneRose
```

## Components

### Client applications

- [React client](https://github.com/claower3d/construction-main/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Engineer workspace](https://github.com/claower3d/construction-main/blob/main/frontend/src/components/EngineerDashboardPage.jsx): `frontend/src/components/EngineerDashboardPage.jsx`
- [Engineer mobile](https://github.com/claower3d/construction-main/blob/main/mobile-engineer/src/api/engineerApi.js): `mobile-engineer/src/api/engineerApi.js`

### API and platform

- [Go API server](https://github.com/claower3d/construction-main/blob/main/go-backend/cmd/server/main.go): `go-backend/cmd/server/main.go`
- [SQLite data store](https://github.com/claower3d/construction-main/blob/main/go-backend/pkg/database/database.go): `go-backend/pkg/database/database.go`
- [FastAPI service](https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py): `ai-service/app/api/v1/engineering.py`
- [Web platform database](https://github.com/claower3d/construction-main/blob/main/WebVersion/backend/src/database/connection.js): `WebVersion/backend/src/database/connection.js`

### Photo analysis

- [Photo analysis pipeline](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/pipeline.py): `ai-service/app/services/pipeline.py`
- [RF-DETR detector](https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/rfdetr.py): `ai-service/app/models/rfdetr.py`
- [Defect analysis](https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/defect_detector.py): `ai-service/app/models/defect_detector.py`
- [Vision-language analysis](https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/qwen_vlm.py): `ai-service/app/models/qwen_vlm.py`
- [Mask segmentation](https://github.com/claower3d/construction-main/blob/main/ai-service/app/models/sam_segmentor.py): `ai-service/app/models/sam_segmentor.py`
- [Scale calibration](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/calibrator.py): `ai-service/app/services/calibrator.py`
- [Volume measurement](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/volume.py): `ai-service/app/services/volume.py`

### Engineering tools

- [Automatic estimator](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/estimator.py): `ai-service/app/services/estimator.py`
- [LiDAR endpoints](https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py): `ai-service/app/api/v1/engineering.py`
- [Point-cloud processor](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/lidar.py): `ai-service/app/services/lidar.py`
- [Calculation endpoints](https://github.com/claower3d/construction-main/blob/main/ai-service/app/api/v1/engineering.py): `ai-service/app/api/v1/engineering.py`
- [Engineering calculator](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/engineering_calc.py): `ai-service/app/services/engineering_calc.py`
- [PDF and Excel reports](https://github.com/claower3d/construction-main/blob/main/ai-service/app/services/report_generator.py): `ai-service/app/services/report_generator.py`

### Other components

- **Construction user**

## Connections

- Construction user → React client: uses (evidence: `README.md`)
- React client → Go API server: sends API requests (evidence: `README.md`)
- Go API server → FastAPI service: proxies AI requests (evidence: `README.md`)
- Engineer workspace → Construction user: supports engineer role (evidence: `frontend/src/components/EngineerDashboardPage.jsx`)
- Engineer mobile → Web platform database: syncs engineer data
- Go API server → SQLite data store: uses SQLite (evidence: `README.md`)
- FastAPI service → Photo analysis pipeline: runs photo analysis
- Photo analysis pipeline → RF-DETR detector: detects objects (evidence: `ai-service/app/services/pipeline.py`)
- Photo analysis pipeline → Defect analysis: analyzes defects (evidence: `ai-service/app/services/pipeline.py`)
- Photo analysis pipeline → Vision-language analysis: analyzes image (evidence: `ai-service/app/services/pipeline.py`)
- Photo analysis pipeline → Mask segmentation: refines masks (evidence: `ai-service/app/services/pipeline.py`)
- Photo analysis pipeline → Scale calibration: calibrates scale (evidence: `ai-service/app/services/pipeline.py`)
- Photo analysis pipeline → Volume measurement: measures volumes (evidence: `ai-service/app/services/pipeline.py`)
- Photo analysis pipeline → Automatic estimator: generates estimate (evidence: `ai-service/app/services/pipeline.py`)
- FastAPI service → Point-cloud processor: processes scans (evidence: `ai-service/app/api/v1/engineering.py`)
- FastAPI service → Engineering calculator: calculates costs (evidence: `ai-service/app/api/v1/engineering.py`)
- FastAPI service → PDF and Excel reports: generates reports (evidence: `ai-service/app/api/v1/engineering.py`)
- Construction user → LiDAR endpoints: submits LiDAR scan (evidence: `README.md`)
- Construction user → Calculation endpoints: submits estimate inputs (evidence: `README.md`)
