# buildnexus-project/buildnexus architecture

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

- Interactive diagram: https://gitdiagram.com/buildnexus-project/buildnexus
- Repository: https://github.com/buildnexus-project/buildnexus

## Overview

BuildNexus is a construction-project management system. Clients register and submit a project; staff are assigned, designs are uploaded and reviewed, construction is tracked through milestones, and invoices are paid before handover. The React app calls the YARP gateway, which routes requests to five independently persisted .NET services. Kafka carries asynchronous events between services. The graph preserves those domain stages and highlights controllers and repositories as the service-internal request layer. Relationships for unsampled subsystems follow README statements; internal details are limited to shown excerpts.

Main entry points: [`api-gateway/Program.cs`](https://github.com/buildnexus-project/buildnexus/blob/main/api-gateway/Program.cs) (YARP API gateway), [`services/design-service/Controllers/DesignsController.cs`](https://github.com/buildnexus-project/buildnexus/blob/main/services/design-service/Controllers/DesignsController.cs) (Design service), [`services/project-service/Controllers/ProjectsController.cs`](https://github.com/buildnexus-project/buildnexus/blob/main/services/project-service/Controllers/ProjectsController.cs) (Project service), [`services/construction-service/Controllers/ConstructionPhaseController.cs`](https://github.com/buildnexus-project/buildnexus/blob/main/services/construction-service/Controllers/ConstructionPhaseController.cs) (Construction service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["React application<br/>[App.tsx]"]
end

subgraph group_identity["Identity and projects"]
  node_users["User service<br/>[UsersController.cs]"]
  node_userdb[("User database")]
  node_projects["Project service"]
  node_projectdb[("Project database")]
end

subgraph group_design["Design review"]
  node_designs["Design service"]
  node_designdb[("Design database")]
end

subgraph group_delivery["Construction and payments"]
  node_construction["Construction service"]
  node_milestones["Milestone tracking"]
  node_constructiondb[("Construction database")]
  node_payments["Payment service"]
  node_paymentdb[("Payment database")]
  node_reporting["Reports and dashboards"]
end

subgraph group_platform["Service platform"]
  node_gateway["YARP API gateway<br/>[Program.cs]"]
  node_kafka["Kafka event bus"]
end

node_client(("BuildNexus user"))

node_client -->|"uses"| node_frontend
node_frontend -->|"calls API"| node_gateway
node_gateway -->|"routes requests"| node_users
node_gateway -->|"routes requests"| node_projects
node_gateway -->|"routes requests"| node_designs
node_gateway -->|"routes requests"| node_construction
node_gateway -->|"routes requests"| node_payments
node_users -->|"persists data"| node_userdb
node_projects -->|"persists data"| node_projectdb
node_designs -->|"persists data"| node_designdb
node_construction -->|"persists data"| node_constructiondb
node_milestones -->|"stores milestones"| node_constructiondb
node_payments -->|"persists data"| node_paymentdb
node_projects -->|"publishes events"| node_kafka
node_designs -->|"publishes events"| node_kafka
node_construction -->|"exchanges events"| node_kafka
node_payments -->|"exchanges events"| node_kafka
node_projects -.->|"looks up staff"| node_users
node_designs -->|"checks project access"| node_projects
node_designs -->|"reads and writes"| node_designdb
node_construction -->|"runs transitions"| node_constructiondb
node_payments -->|"records payment"| node_paymentdb
node_reporting -.->|"feeds dashboards"| node_frontend

click node_users "https://github.com/buildnexus-project/buildnexus/blob/main/services/user-service/Controllers/UsersController.cs"
click node_projects "https://github.com/buildnexus-project/buildnexus/blob/main/services/project-service/Controllers/ProjectsController.cs"
click node_designs "https://github.com/buildnexus-project/buildnexus/blob/main/services/design-service/Controllers/DesignsController.cs"
click node_construction "https://github.com/buildnexus-project/buildnexus/blob/main/services/construction-service/Controllers/ConstructionPhaseController.cs"
click node_milestones "https://github.com/buildnexus-project/buildnexus/blob/main/services/construction-service/Controllers/MilestonesController.cs"
click node_payments "https://github.com/buildnexus-project/buildnexus/blob/main/services/payment-service/Controllers/ClientPaymentsController.cs"
click node_reporting "https://github.com/buildnexus-project/buildnexus/tree/main/services"
click node_frontend "https://github.com/buildnexus-project/buildnexus/blob/main/frontend/src/App.tsx"
click node_gateway "https://github.com/buildnexus-project/buildnexus/blob/main/api-gateway/Program.cs"

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_frontend,node_client toneBlue
class node_users,node_userdb,node_projects,node_projectdb toneAmber
class node_designs,node_designdb toneMint
class node_construction,node_milestones,node_constructiondb,node_payments,node_paymentdb,node_reporting toneRose
class node_gateway,node_kafka toneIndigo
```

## Components

### User experience

- [React application](https://github.com/buildnexus-project/buildnexus/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Identity and projects

- [User service](https://github.com/buildnexus-project/buildnexus/blob/main/services/user-service/Controllers/UsersController.cs): `services/user-service/Controllers/UsersController.cs`
- **User database**
- [Project service](https://github.com/buildnexus-project/buildnexus/blob/main/services/project-service/Controllers/ProjectsController.cs): `services/project-service/Controllers/ProjectsController.cs`
- **Project database**

### Design review

- [Design service](https://github.com/buildnexus-project/buildnexus/blob/main/services/design-service/Controllers/DesignsController.cs): `services/design-service/Controllers/DesignsController.cs`
- **Design database**

### Construction and payments

- [Construction service](https://github.com/buildnexus-project/buildnexus/blob/main/services/construction-service/Controllers/ConstructionPhaseController.cs): `services/construction-service/Controllers/ConstructionPhaseController.cs`
- [Milestone tracking](https://github.com/buildnexus-project/buildnexus/blob/main/services/construction-service/Controllers/MilestonesController.cs): `services/construction-service/Controllers/MilestonesController.cs`
- **Construction database**
- [Payment service](https://github.com/buildnexus-project/buildnexus/blob/main/services/payment-service/Controllers/ClientPaymentsController.cs): `services/payment-service/Controllers/ClientPaymentsController.cs`
- **Payment database**
- [Reports and dashboards](https://github.com/buildnexus-project/buildnexus/tree/main/services): `services`

### Service platform

- [YARP API gateway](https://github.com/buildnexus-project/buildnexus/blob/main/api-gateway/Program.cs): `api-gateway/Program.cs`
- **Kafka event bus**

### Other components

- **BuildNexus user**

## Connections

- BuildNexus user → React application: uses (evidence: `README.md`)
- React application → YARP API gateway: calls API (evidence: `README.md`)
- YARP API gateway → User service: routes requests (evidence: `README.md`)
- YARP API gateway → Project service: routes requests (evidence: `README.md`)
- YARP API gateway → Design service: routes requests (evidence: `README.md`)
- YARP API gateway → Construction service: routes requests (evidence: `README.md`)
- YARP API gateway → Payment service: routes requests (evidence: `README.md`)
- User service → User database: persists data (evidence: `README.md`)
- Project service → Project database: persists data (evidence: `README.md`)
- Design service → Design database: persists data (evidence: `README.md`)
- Construction service → Construction database: persists data (evidence: `README.md`)
- Milestone tracking → Construction database: stores milestones
- Payment service → Payment database: persists data (evidence: `README.md`)
- Project service → Kafka event bus: publishes events (evidence: `README.md`)
- Design service → Kafka event bus: publishes events (evidence: `README.md`)
- Construction service → Kafka event bus: exchanges events (evidence: `README.md`)
- Payment service → Kafka event bus: exchanges events (evidence: `README.md`)
- Project service → User service: looks up staff
- Design service → Project service: checks project access (evidence: `services/design-service/Controllers/DesignsController.cs`)
- Design service → Design database: reads and writes (evidence: `services/design-service/Controllers/DesignsController.cs`)
- Construction service → Construction database: runs transitions (evidence: `services/construction-service/Controllers/ConstructionPhaseController.cs`)
- Payment service → Payment database: records payment (evidence: `services/payment-service/Controllers/ClientPaymentsController.cs`)
- Reports and dashboards → React application: feeds dashboards
