# servego/servego-platform architecture

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

- Interactive diagram: https://gitdiagram.com/servego/servego-platform
- Repository: https://github.com/servego/servego-platform

## Overview

ServeGo is a home-services marketplace: customers discover services and request bookings; providers receive leads, perform work, and track progress. The backend also supports accounts, reviews, notifications, chat, wallet, and administrative operations. The graph follows documented frontend composition and sampled backend calls; the README is empty, and several important subsystems are represented from the file tree and SOURCE INDEX without inferred connections.

Main entry points: [`frontend/src/App.jsx`](https://github.com/servego/servego-platform/blob/main/frontend/src/App.jsx) (Web application), [`backend/prisma/client.js`](https://github.com/servego/servego-platform/blob/main/backend/prisma/client.js) (Application database), [`backend/routes/api.js`](https://github.com/servego/servego-platform/blob/main/backend/routes/api.js) (API routes), [`backend/controllers/bookingController.js`](https://github.com/servego/servego-platform/blob/main/backend/controllers/bookingController.js) (Booking requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Customer and provider experience"]
  node_app["Web application<br/>[App.jsx]"]
  node_services_page["Service discovery<br/>[Services.jsx]"]
  node_customer_dashboard["Customer dashboard"]
  node_provider_dashboard["Provider dashboard"]
  node_admin_panel["Admin console<br/>[AdminPanel.jsx]"]
  node_app_state["Shared app state<br/>[AppContext.jsx]"]
  node_api_client["API client<br/>[apiClient.js]"]
end

subgraph group_api["Backend API and identity"]
  node_server["HTTP and socket server<br/>[server.js]"]
  node_routes["API routes<br/>[api.js]"]
  node_identity["Accounts and sessions<br/>[userController.js]"]
end

subgraph group_fulfillment["Marketplace fulfillment"]
  node_catalog["Service catalog"]
  node_booking["Booking requests"]
  node_lead_service["Lead and booking workflow<br/>[leadService.js]"]
  node_tracking["Live tracking<br/>[trackingService.js]"]
end

subgraph group_operations["Platform operations"]
  node_notifications["Notifications"]
  node_reviews["Reviews and reputation"]
  node_queue["Background job queue<br/>[queueService.js]"]
  node_database[("Application database<br/>[client.js]")]
end

node_customer(("Customer"))
node_provider(("Provider"))
node_admin(("Administrator"))

node_customer -->|"uses"| node_app
node_provider -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"composes"| node_app_state
node_app -->|"routes to"| node_services_page
node_app -->|"routes to"| node_customer_dashboard
node_app -->|"routes to"| node_provider_dashboard
node_app -->|"routes to"| node_admin_panel
node_services_page -->|"reads state"| node_app_state
node_services_page -->|"requests data"| node_api_client
node_server -->|"mounts"| node_routes
node_routes -->|"routes requests"| node_identity
node_routes -->|"routes requests"| node_catalog
node_routes -->|"routes requests"| node_booking
node_routes -->|"routes requests"| node_reviews
node_booking -->|"creates and advances"| node_lead_service
node_booking -->|"updates location"| node_tracking
node_server -->|"handles socket updates"| node_tracking
node_booking -->|"notifies lead acceptance"| node_notifications
node_reviews -->|"notifies publication"| node_notifications
node_notifications -->|"enqueues work"| node_queue
node_queue -->|"stores and claims jobs"| node_database
node_server -->|"checks database"| node_database
node_identity -->|"reads and writes"| node_database
node_catalog -->|"reads and writes"| node_database
node_booking -->|"reads and writes"| node_database
node_reviews -->|"reads and writes"| node_database

click node_app "https://github.com/servego/servego-platform/blob/main/frontend/src/App.jsx"
click node_services_page "https://github.com/servego/servego-platform/blob/main/frontend/src/pages/Services.jsx"
click node_customer_dashboard "https://github.com/servego/servego-platform/blob/main/frontend/src/pages/CustomerDashboard.jsx"
click node_provider_dashboard "https://github.com/servego/servego-platform/blob/main/frontend/src/pages/ProviderDashboard.jsx"
click node_admin_panel "https://github.com/servego/servego-platform/blob/main/frontend/src/pages/AdminPanel.jsx"
click node_app_state "https://github.com/servego/servego-platform/blob/main/frontend/src/context/AppContext.jsx"
click node_api_client "https://github.com/servego/servego-platform/blob/main/frontend/src/utils/apiClient.js"
click node_server "https://github.com/servego/servego-platform/blob/main/backend/server.js"
click node_routes "https://github.com/servego/servego-platform/blob/main/backend/routes/api.js"
click node_identity "https://github.com/servego/servego-platform/blob/main/backend/controllers/userController.js"
click node_catalog "https://github.com/servego/servego-platform/blob/main/backend/controllers/serviceController.js"
click node_booking "https://github.com/servego/servego-platform/blob/main/backend/controllers/bookingController.js"
click node_lead_service "https://github.com/servego/servego-platform/blob/main/backend/services/leadService.js"
click node_tracking "https://github.com/servego/servego-platform/blob/main/backend/services/trackingService.js"
click node_notifications "https://github.com/servego/servego-platform/blob/main/backend/services/notificationService.js"
click node_reviews "https://github.com/servego/servego-platform/blob/main/backend/controllers/reviewController.js"
click node_queue "https://github.com/servego/servego-platform/blob/main/backend/services/queue/queueService.js"
click node_database "https://github.com/servego/servego-platform/blob/main/backend/prisma/client.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_app,node_services_page,node_customer_dashboard,node_provider_dashboard,node_admin_panel,node_app_state,node_api_client toneBlue
class node_server,node_routes,node_identity toneAmber
class node_catalog,node_booking,node_lead_service,node_tracking toneMint
class node_notifications,node_reviews,node_queue,node_database toneRose
class node_customer,node_provider,node_admin toneIndigo
```

## Components

### Customer and provider experience

- [Web application](https://github.com/servego/servego-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Service discovery](https://github.com/servego/servego-platform/blob/main/frontend/src/pages/Services.jsx): `frontend/src/pages/Services.jsx`
- [Customer dashboard](https://github.com/servego/servego-platform/blob/main/frontend/src/pages/CustomerDashboard.jsx): `frontend/src/pages/CustomerDashboard.jsx`
- [Provider dashboard](https://github.com/servego/servego-platform/blob/main/frontend/src/pages/ProviderDashboard.jsx): `frontend/src/pages/ProviderDashboard.jsx`
- [Admin console](https://github.com/servego/servego-platform/blob/main/frontend/src/pages/AdminPanel.jsx): `frontend/src/pages/AdminPanel.jsx`
- [Shared app state](https://github.com/servego/servego-platform/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [API client](https://github.com/servego/servego-platform/blob/main/frontend/src/utils/apiClient.js): `frontend/src/utils/apiClient.js`

### Backend API and identity

- [HTTP and socket server](https://github.com/servego/servego-platform/blob/main/backend/server.js): `backend/server.js`
- [API routes](https://github.com/servego/servego-platform/blob/main/backend/routes/api.js): `backend/routes/api.js`
- [Accounts and sessions](https://github.com/servego/servego-platform/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`

### Marketplace fulfillment

- [Service catalog](https://github.com/servego/servego-platform/blob/main/backend/controllers/serviceController.js): `backend/controllers/serviceController.js`
- [Booking requests](https://github.com/servego/servego-platform/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [Lead and booking workflow](https://github.com/servego/servego-platform/blob/main/backend/services/leadService.js): `backend/services/leadService.js`
- [Live tracking](https://github.com/servego/servego-platform/blob/main/backend/services/trackingService.js): `backend/services/trackingService.js`

### Platform operations

- [Notifications](https://github.com/servego/servego-platform/blob/main/backend/services/notificationService.js): `backend/services/notificationService.js`
- [Reviews and reputation](https://github.com/servego/servego-platform/blob/main/backend/controllers/reviewController.js): `backend/controllers/reviewController.js`
- [Background job queue](https://github.com/servego/servego-platform/blob/main/backend/services/queue/queueService.js): `backend/services/queue/queueService.js`
- [Application database](https://github.com/servego/servego-platform/blob/main/backend/prisma/client.js): `backend/prisma/client.js`

### Other components

- **Customer**
- **Provider**
- **Administrator**

## Connections

- Customer → Web application: uses
- Provider → Web application: uses
- Administrator → Web application: uses
- Web application → Shared app state: composes (evidence: `frontend/src/App.jsx`)
- Web application → Service discovery: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Customer dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Provider dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web application → Admin console: routes to (evidence: `frontend/src/App.jsx`)
- Service discovery → Shared app state: reads state (evidence: `frontend/src/pages/Services.jsx`)
- Service discovery → API client: requests data (evidence: `frontend/src/pages/Services.jsx`)
- HTTP and socket server → API routes: mounts (evidence: `backend/server.js`)
- API routes → Accounts and sessions: routes requests (evidence: `backend/routes/api.js`)
- API routes → Service catalog: routes requests (evidence: `backend/routes/api.js`)
- API routes → Booking requests: routes requests (evidence: `backend/routes/api.js`)
- API routes → Reviews and reputation: routes requests (evidence: `backend/routes/api.js`)
- Booking requests → Lead and booking workflow: creates and advances (evidence: `backend/controllers/bookingController.js`)
- Booking requests → Live tracking: updates location (evidence: `backend/controllers/bookingController.js`)
- HTTP and socket server → Live tracking: handles socket updates (evidence: `backend/server.js`)
- Booking requests → Notifications: notifies lead acceptance (evidence: `backend/controllers/bookingController.js`)
- Reviews and reputation → Notifications: notifies publication (evidence: `backend/controllers/reviewController.js`)
- Notifications → Background job queue: enqueues work (evidence: `backend/services/notificationService.js`)
- Background job queue → Application database: stores and claims jobs (evidence: `backend/services/queue/queueService.js`)
- HTTP and socket server → Application database: checks database (evidence: `backend/server.js`)
- Accounts and sessions → Application database: reads and writes (evidence: `backend/controllers/userController.js`)
- Service catalog → Application database: reads and writes (evidence: `backend/controllers/serviceController.js`)
- Booking requests → Application database: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Reviews and reputation → Application database: reads and writes (evidence: `backend/controllers/reviewController.js`)
