# mabrur30/civilhub architecture

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

## Overview

CivilHub is a two-sided civil-engineering marketplace with client, engineer/organisation, and administrator interfaces. The principal workflow is clients publishing projects, providers finding them and bidding, and participants managing project progress and reviews; the platform also supports equipment bookings, profiles, messaging, networking, and payment administration. The graph combines sampled UI and controller evidence with the source index and README. Several feature areas are represented by their exact directories because their implementation was not sampled; their internal call paths are therefore omitted.

Main entry points: [`client/src/pages/EngineerMarketplacePage.tsx`](https://github.com/mabrur30/civilhub/blob/main/client/src/pages/EngineerMarketplacePage.tsx) (Browse and bid), [`client/src/App.tsx`](https://github.com/mabrur30/civilhub/blob/main/client/src/App.tsx) (Client application), [`server/src/index.ts`](https://github.com/mabrur30/civilhub/blob/main/server/src/index.ts) (Express API), [`admin/src/App.tsx`](https://github.com/mabrur30/civilhub/blob/main/admin/src/App.tsx) (Admin console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Project marketplace"]
  node_clientapp["Client application<br/>[App.tsx]"]
  node_marketplace["Browse and bid"]
  node_projects["Project workflows"]
  node_bids["Bidding<br/>[bid.controller.ts]"]
  node_equipment["Equipment marketplace"]
  node_booking[("Equipment bookings")]
end

subgraph group_people["Profiles and community"]
  node_profiles["Provider profiles"]
  node_profileapi["Profile and search API"]
  node_network["Network and feed"]
  node_messaging["Messaging"]
  node_reviews["Reviews"]
end

subgraph group_operations["Project operations"]
  node_progress["Project progress"]
  node_disputes["Disputes"]
  node_verification["Verification"]
  node_payments["Payments and payouts"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_api["Express API<br/>[index.ts]"]
  node_data[("MongoDB records<br/>[db.ts]")]
end

subgraph group_admin["Administration"]
  node_adminapp["Admin console<br/>[App.tsx]"]
  node_adminapi["Admin API"]
end

node_clients(("Clients"))
node_providers(("Providers"))
node_admins(("Administrators"))

node_clients -->|"use"| node_clientapp
node_providers -->|"use"| node_clientapp
node_admins -->|"use"| node_adminapp
node_clientapp -->|"routes to"| node_marketplace
node_marketplace -.->|"fetches projects and bids"| node_api
node_clientapp -->|"uses"| node_auth
node_marketplace -.->|"requests open projects"| node_projects
node_marketplace -.->|"requests my bids"| node_bids
node_providers -.->|"maintain profiles"| node_profiles
node_profiles -.->|"loads profile data"| node_profileapi
node_profileapi -->|"routes review requests"| node_reviews
node_network -.->|"fetches network and feed data"| node_api
node_clients -.->|"browse equipment"| node_equipment
node_equipment -.->|"stores bookings"| node_booking
node_clients -.->|"post and manage projects"| node_projects
node_providers -.->|"submit bids"| node_bids
node_projects -.->|"track completion"| node_progress
node_progress -->|"checks project completion"| node_reviews
node_clients -.->|"review providers"| node_reviews
node_clients -.->|"raise disputes"| node_disputes
node_providers -.->|"message participants"| node_messaging
node_clients -.->|"request verification"| node_verification
node_payments -.->|"served by"| node_api
node_adminapp -.->|"manages platform"| node_adminapi
node_adminapp -.->|"admin sign-in"| node_auth
node_api -->|"uses database"| node_data

click node_clientapp "https://github.com/mabrur30/civilhub/blob/main/client/src/App.tsx"
click node_marketplace "https://github.com/mabrur30/civilhub/blob/main/client/src/pages/EngineerMarketplacePage.tsx"
click node_projects "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/projectProgress.controller.ts"
click node_bids "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/bid.controller.ts"
click node_equipment "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/equipment.controller.ts"
click node_booking "https://github.com/mabrur30/civilhub/blob/main/server/src/models/EquipmentBooking.model.ts"
click node_profiles "https://github.com/mabrur30/civilhub/blob/main/client/src/components/profile/engineer/EngineerProfileView.tsx"
click node_profileapi "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/engineer.controller.ts"
click node_network "https://github.com/mabrur30/civilhub/blob/main/client/src/pages/EngineerNetworkPage.tsx"
click node_messaging "https://github.com/mabrur30/civilhub/tree/main/client/src/components/messages"
click node_reviews "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/review.controller.ts"
click node_progress "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/projectProgress.controller.ts"
click node_disputes "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/projectDispute.controller.ts"
click node_verification "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/verification.controller.ts"
click node_payments "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/payment.controller.ts"
click node_auth "https://github.com/mabrur30/civilhub/blob/main/client/src/context/AuthContext.tsx"
click node_api "https://github.com/mabrur30/civilhub/blob/main/server/src/index.ts"
click node_data "https://github.com/mabrur30/civilhub/blob/main/server/src/config/db.ts"
click node_adminapp "https://github.com/mabrur30/civilhub/blob/main/admin/src/App.tsx"
click node_adminapi "https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/admin.controller.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_clientapp,node_marketplace,node_projects,node_bids,node_equipment,node_booking,node_clients toneBlue
class node_profiles,node_profileapi,node_network,node_messaging,node_reviews toneAmber
class node_progress,node_disputes,node_verification,node_payments toneMint
class node_auth,node_api,node_data toneRose
class node_adminapp,node_adminapi,node_providers,node_admins toneIndigo
```

## Components

### Project marketplace

- [Client application](https://github.com/mabrur30/civilhub/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Browse and bid](https://github.com/mabrur30/civilhub/blob/main/client/src/pages/EngineerMarketplacePage.tsx): `client/src/pages/EngineerMarketplacePage.tsx`
- [Project workflows](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/projectProgress.controller.ts): `server/src/controllers/projectProgress.controller.ts`
- [Bidding](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/bid.controller.ts): `server/src/controllers/bid.controller.ts`
- [Equipment marketplace](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/equipment.controller.ts): `server/src/controllers/equipment.controller.ts`
- [Equipment bookings](https://github.com/mabrur30/civilhub/blob/main/server/src/models/EquipmentBooking.model.ts): `server/src/models/EquipmentBooking.model.ts`

### Profiles and community

- [Provider profiles](https://github.com/mabrur30/civilhub/blob/main/client/src/components/profile/engineer/EngineerProfileView.tsx): `client/src/components/profile/engineer/EngineerProfileView.tsx`
- [Profile and search API](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/engineer.controller.ts): `server/src/controllers/engineer.controller.ts`
- [Network and feed](https://github.com/mabrur30/civilhub/blob/main/client/src/pages/EngineerNetworkPage.tsx): `client/src/pages/EngineerNetworkPage.tsx`
- [Messaging](https://github.com/mabrur30/civilhub/tree/main/client/src/components/messages): `client/src/components/messages`
- [Reviews](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/review.controller.ts): `server/src/controllers/review.controller.ts`

### Project operations

- [Project progress](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/projectProgress.controller.ts): `server/src/controllers/projectProgress.controller.ts`
- [Disputes](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/projectDispute.controller.ts): `server/src/controllers/projectDispute.controller.ts`
- [Verification](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/verification.controller.ts): `server/src/controllers/verification.controller.ts`
- [Payments and payouts](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/payment.controller.ts): `server/src/controllers/payment.controller.ts`

### Platform services

- [Authentication](https://github.com/mabrur30/civilhub/blob/main/client/src/context/AuthContext.tsx): `client/src/context/AuthContext.tsx`
- [Express API](https://github.com/mabrur30/civilhub/blob/main/server/src/index.ts): `server/src/index.ts`
- [MongoDB records](https://github.com/mabrur30/civilhub/blob/main/server/src/config/db.ts): `server/src/config/db.ts`

### Administration

- [Admin console](https://github.com/mabrur30/civilhub/blob/main/admin/src/App.tsx): `admin/src/App.tsx`
- [Admin API](https://github.com/mabrur30/civilhub/blob/main/server/src/controllers/admin.controller.ts): `server/src/controllers/admin.controller.ts`

### Other components

- **Clients**
- **Providers**
- **Administrators**

## Connections

- Clients → Client application: use
- Providers → Client application: use
- Administrators → Admin console: use (evidence: `admin/src/App.tsx`)
- Client application → Browse and bid: routes to (evidence: `client/src/App.tsx`)
- Browse and bid → Express API: fetches projects and bids
- Client application → Authentication: uses (evidence: `client/src/App.tsx`)
- Browse and bid → Project workflows: requests open projects
- Browse and bid → Bidding: requests my bids
- Providers → Provider profiles: maintain profiles
- Provider profiles → Profile and search API: loads profile data
- Profile and search API → Reviews: routes review requests (evidence: `server/src/routes/engineer.routes.ts`)
- Network and feed → Express API: fetches network and feed data
- Clients → Equipment marketplace: browse equipment
- Equipment marketplace → Equipment bookings: stores bookings
- Clients → Project workflows: post and manage projects
- Providers → Bidding: submit bids
- Project workflows → Project progress: track completion (evidence: `server/src/controllers/projectProgress.controller.ts`)
- Project progress → Reviews: checks project completion (evidence: `server/src/controllers/customerReview.controller.ts`)
- Clients → Reviews: review providers
- Clients → Disputes: raise disputes
- Providers → Messaging: message participants
- Clients → Verification: request verification
- Payments and payouts → Express API: served by
- Admin console → Admin API: manages platform
- Admin console → Authentication: admin sign-in
- Express API → MongoDB records: uses database (evidence: `server/src/index.ts`)
