# toluenetech-spec/servix architecture

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

## Overview

Servix is a professional-services marketplace. The public site presents marketing, service discovery and provider profiles, with sign-in, booking, professional and admin screens; its README emphasizes that listings and account interactions are pre-launch/demo rather than fully live. The repository also contains a Fastify API for authentication, onboarding, bookings, payments and administration. The graph separates those product areas and shows only relationships visible in excerpts or documented by the README; several backend route and integration details are unsampled.

Main entry points: [`src/App.jsx`](https://github.com/toluenetech-spec/servix/blob/main/src/App.jsx) (Website routes), [`api/src/app.ts`](https://github.com/toluenetech-spec/servix/blob/main/api/src/app.ts) (Fastify app), [`src/pages/ServicesPage.jsx`](https://github.com/toluenetech-spec/servix/blob/main/src/pages/ServicesPage.jsx) (Service discovery), [`api/src/lib/jobs.ts`](https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/jobs.ts) (Background jobs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Public website"]
  node_router["Website routes<br/>[App.jsx]"]
  node_marketing["Marketing pages<br/>[HomePage.jsx]"]
  node_service_browse["Service discovery<br/>[ServicesPage.jsx]"]
  node_service_detail["Service details"]
  node_professional["Provider profiles"]
  node_auth_ui["Account screens<br/>[LoginPage.jsx]"]
  node_booking_ui["Booking screens<br/>[BookingsPage.jsx]"]
  node_pro_ui["Provider workspace<br/>[WorkspacePage.jsx]"]
  node_admin_ui["Admin console<br/>[AdminPage.jsx]"]
  node_site_layout["Shared layout<br/>[Layout.jsx]"]
end

subgraph group_client["Frontend data and identity"]
  node_demo_catalogue["Demo catalogue<br/>[services.js]"]
  node_fetch_hook["Fetch state hook<br/>[useFetch.js]"]
  node_frontend_api["Frontend API boundary<br/>[api.js]"]
  node_auth_context["Auth context<br/>[AuthContext.jsx]"]
  node_auth_client["Auth client<br/>[authApi.js]"]
end

subgraph group_api["Marketplace API"]
  node_api_app["Fastify app<br/>[app.ts]"]
  node_catalogue_routes["Catalogue routes<br/>[services.ts]"]
  node_identity_routes["Identity routes<br/>[auth.ts]"]
  node_application_routes["Provider applications<br/>[applications.ts]"]
  node_booking_routes["Booking routes<br/>[bookings.ts]"]
  node_admin_routes["Admin routes<br/>[admin.ts]"]
end

subgraph group_operations["Platform operations"]
  node_db[("Postgres access<br/>[db.ts]")]
  node_jobs["Background jobs<br/>[jobs.ts]"]
  node_mailer["Email delivery<br/>[mailer.ts]"]
  node_payments["Payment webhooks<br/>[webhooks.ts]"]
  node_storage["File storage<br/>[storage.ts]"]
end

node_visitor(("Customer / provider"))

node_visitor -->|"opens"| node_router
node_router -->|"wraps routes"| node_site_layout
node_router -->|"routes to"| node_service_browse
node_router -->|"routes to"| node_service_detail
node_router -->|"routes to"| node_professional
node_router -->|"routes to"| node_auth_ui
node_router -->|"routes to"| node_booking_ui
node_router -->|"routes to"| node_pro_ui
node_router -->|"routes to"| node_admin_ui
node_service_browse -->|"loads through"| node_fetch_hook
node_fetch_hook -->|"invokes fetcher"| node_frontend_api
node_service_browse -->|"renders cards"| node_demo_catalogue
node_router -->|"provides auth"| node_auth_context
node_auth_context -->|"calls"| node_auth_client
node_api_app -->|"registers"| node_catalogue_routes
node_api_app -->|"registers"| node_identity_routes
node_api_app -->|"registers"| node_application_routes
node_application_routes -->|"reads / writes"| node_db
node_api_app -->|"registers"| node_booking_routes
node_api_app -->|"registers"| node_admin_routes
node_jobs -->|"claims jobs"| node_db
node_jobs -->|"delivers mail"| node_mailer
node_visitor -.->|"API requests"| node_api_app

click node_router "https://github.com/toluenetech-spec/servix/blob/main/src/App.jsx"
click node_marketing "https://github.com/toluenetech-spec/servix/blob/main/src/pages/HomePage.jsx"
click node_service_browse "https://github.com/toluenetech-spec/servix/blob/main/src/pages/ServicesPage.jsx"
click node_service_detail "https://github.com/toluenetech-spec/servix/blob/main/src/pages/ServiceDetailPage.jsx"
click node_professional "https://github.com/toluenetech-spec/servix/blob/main/src/pages/ProfessionalsPage.jsx"
click node_auth_ui "https://github.com/toluenetech-spec/servix/blob/main/src/pages/auth/LoginPage.jsx"
click node_booking_ui "https://github.com/toluenetech-spec/servix/blob/main/src/pages/bookings/BookingsPage.jsx"
click node_pro_ui "https://github.com/toluenetech-spec/servix/blob/main/src/pages/pro/WorkspacePage.jsx"
click node_admin_ui "https://github.com/toluenetech-spec/servix/blob/main/src/pages/admin/AdminPage.jsx"
click node_site_layout "https://github.com/toluenetech-spec/servix/blob/main/src/components/layout/Layout.jsx"
click node_demo_catalogue "https://github.com/toluenetech-spec/servix/blob/main/src/data/services.js"
click node_fetch_hook "https://github.com/toluenetech-spec/servix/blob/main/src/lib/useFetch.js"
click node_frontend_api "https://github.com/toluenetech-spec/servix/blob/main/src/lib/api.js"
click node_auth_context "https://github.com/toluenetech-spec/servix/blob/main/src/lib/AuthContext.jsx"
click node_auth_client "https://github.com/toluenetech-spec/servix/blob/main/src/lib/authApi.js"
click node_api_app "https://github.com/toluenetech-spec/servix/blob/main/api/src/app.ts"
click node_catalogue_routes "https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/services.ts"
click node_identity_routes "https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/auth.ts"
click node_application_routes "https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/applications.ts"
click node_booking_routes "https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/bookings.ts"
click node_admin_routes "https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/admin.ts"
click node_db "https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/db.ts"
click node_jobs "https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/jobs.ts"
click node_mailer "https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/mailer.ts"
click node_payments "https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/webhooks.ts"
click node_storage "https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/storage.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_router,node_marketing,node_service_browse,node_service_detail,node_professional,node_auth_ui,node_booking_ui,node_pro_ui,node_admin_ui,node_site_layout toneBlue
class node_demo_catalogue,node_fetch_hook,node_frontend_api,node_auth_context,node_auth_client toneAmber
class node_api_app,node_catalogue_routes,node_identity_routes,node_application_routes,node_booking_routes,node_admin_routes toneMint
class node_db,node_jobs,node_mailer,node_payments,node_storage toneRose
class node_visitor toneIndigo
```

## Components

### Public website

- [Website routes](https://github.com/toluenetech-spec/servix/blob/main/src/App.jsx): `src/App.jsx`
- [Marketing pages](https://github.com/toluenetech-spec/servix/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Service discovery](https://github.com/toluenetech-spec/servix/blob/main/src/pages/ServicesPage.jsx): `src/pages/ServicesPage.jsx`
- [Service details](https://github.com/toluenetech-spec/servix/blob/main/src/pages/ServiceDetailPage.jsx): `src/pages/ServiceDetailPage.jsx`
- [Provider profiles](https://github.com/toluenetech-spec/servix/blob/main/src/pages/ProfessionalsPage.jsx): `src/pages/ProfessionalsPage.jsx`
- [Account screens](https://github.com/toluenetech-spec/servix/blob/main/src/pages/auth/LoginPage.jsx): `src/pages/auth/LoginPage.jsx`
- [Booking screens](https://github.com/toluenetech-spec/servix/blob/main/src/pages/bookings/BookingsPage.jsx): `src/pages/bookings/BookingsPage.jsx`
- [Provider workspace](https://github.com/toluenetech-spec/servix/blob/main/src/pages/pro/WorkspacePage.jsx): `src/pages/pro/WorkspacePage.jsx`
- [Admin console](https://github.com/toluenetech-spec/servix/blob/main/src/pages/admin/AdminPage.jsx): `src/pages/admin/AdminPage.jsx`
- [Shared layout](https://github.com/toluenetech-spec/servix/blob/main/src/components/layout/Layout.jsx): `src/components/layout/Layout.jsx`

### Frontend data and identity

- [Demo catalogue](https://github.com/toluenetech-spec/servix/blob/main/src/data/services.js): `src/data/services.js`
- [Fetch state hook](https://github.com/toluenetech-spec/servix/blob/main/src/lib/useFetch.js): `src/lib/useFetch.js`
- [Frontend API boundary](https://github.com/toluenetech-spec/servix/blob/main/src/lib/api.js): `src/lib/api.js`
- [Auth context](https://github.com/toluenetech-spec/servix/blob/main/src/lib/AuthContext.jsx): `src/lib/AuthContext.jsx`
- [Auth client](https://github.com/toluenetech-spec/servix/blob/main/src/lib/authApi.js): `src/lib/authApi.js`

### Marketplace API

- [Fastify app](https://github.com/toluenetech-spec/servix/blob/main/api/src/app.ts): `api/src/app.ts`
- [Catalogue routes](https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/services.ts): `api/src/routes/services.ts`
- [Identity routes](https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/auth.ts): `api/src/routes/auth.ts`
- [Provider applications](https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/applications.ts): `api/src/routes/applications.ts`
- [Booking routes](https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/bookings.ts): `api/src/routes/bookings.ts`
- [Admin routes](https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/admin.ts): `api/src/routes/admin.ts`

### Platform operations

- [Postgres access](https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/db.ts): `api/src/lib/db.ts`
- [Background jobs](https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/jobs.ts): `api/src/lib/jobs.ts`
- [Email delivery](https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/mailer.ts): `api/src/lib/mailer.ts`
- [Payment webhooks](https://github.com/toluenetech-spec/servix/blob/main/api/src/routes/webhooks.ts): `api/src/routes/webhooks.ts`
- [File storage](https://github.com/toluenetech-spec/servix/blob/main/api/src/lib/storage.ts): `api/src/lib/storage.ts`

### Other components

- **Customer / provider**

## Connections

- Customer / provider → Website routes: opens (evidence: `src/App.jsx`)
- Website routes → Shared layout: wraps routes (evidence: `src/App.jsx`)
- Website routes → Service discovery: routes to (evidence: `src/App.jsx`)
- Website routes → Service details: routes to (evidence: `src/App.jsx`)
- Website routes → Provider profiles: routes to (evidence: `src/App.jsx`)
- Website routes → Account screens: routes to (evidence: `src/App.jsx`)
- Website routes → Booking screens: routes to (evidence: `src/App.jsx`)
- Website routes → Provider workspace: routes to (evidence: `src/App.jsx`)
- Website routes → Admin console: routes to (evidence: `src/App.jsx`)
- Service discovery → Fetch state hook: loads through (evidence: `src/pages/ServicesPage.jsx`)
- Fetch state hook → Frontend API boundary: invokes fetcher (evidence: `src/lib/useFetch.js`)
- Service discovery → Demo catalogue: renders cards
- Website routes → Auth context: provides auth (evidence: `src/App.jsx`)
- Auth context → Auth client: calls (evidence: `src/lib/AuthContext.jsx`)
- Fastify app → Catalogue routes: registers (evidence: `api/src/app.ts`)
- Fastify app → Identity routes: registers (evidence: `api/src/app.ts`)
- Fastify app → Provider applications: registers (evidence: `api/src/app.ts`)
- Provider applications → Postgres access: reads / writes (evidence: `api/src/routes/applications.ts`)
- Fastify app → Booking routes: registers (evidence: `api/src/app.ts`)
- Fastify app → Admin routes: registers (evidence: `api/src/app.ts`)
- Background jobs → Postgres access: claims jobs (evidence: `api/src/lib/jobs.ts`)
- Background jobs → Email delivery: delivers mail (evidence: `api/src/lib/jobs.ts`)
- Customer / provider → Fastify app: API requests
