# rohankapadiya/booking-platform architecture

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

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

## Overview

This is a provider/customer booking platform: providers publish services and time slots, and customers find available slots and book or cancel them. The Next.js frontend supplies the user-facing pages and server actions; its calls into the Express API are only represented where shown by the excerpts. The API separates authentication, service/slot management and bookings, using JWT role checks and Prisma-backed persistence. The README is sparse, and some frontend/API wiring was not excerpted, so uncertain connections are omitted.

Main entry points: [`backend/src/routes/auth.js`](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/auth.js) (Authentication), [`backend/src/db.js`](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/db.js) (Prisma client), [`backend/src/app.js`](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/app.js) (Express API), [`backend/src/routes/services.js`](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/services.js) (Services and slots)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_browse["Browse services<br/>[page.js]"]
  node_service_detail["Service details<br/>[page.js]"]
  node_login["Sign in<br/>[page.js]"]
  node_register["Register<br/>[page.js]"]
  node_provider_dashboard["Provider dashboard<br/>[page.js]"]
  node_create_service["Create service form"]
  node_provider_actions["Provider actions"]
  node_auth_actions["Auth actions<br/>[auth-actions.js]"]
  node_session["Session lookup<br/>[session.js]"]
  node_bookings_page["My bookings<br/>[page.js]"]
  node_booking_actions["Booking actions<br/>[booking-actions.js]"]
end

subgraph group_api["Booking API"]
  node_api_app["Express API<br/>[app.js]"]
  node_auth_routes["Authentication<br/>[auth.js]"]
  node_auth_middleware["JWT and roles<br/>[auth.js]"]
  node_service_routes["Services and slots<br/>[services.js]"]
  node_booking_routes["Bookings<br/>[bookings.js]"]
end

subgraph group_persistence["Persistence"]
  node_prisma_client["Prisma client<br/>[db.js]"]
  node_database[("Relational database<br/>[schema.prisma]")]
end

node_customer(("Customer"))
node_provider(("Provider"))

node_provider -.->|"manages services"| node_provider_dashboard
node_customer -.->|"finds services"| node_browse
node_customer -.->|"manages bookings"| node_bookings_page
node_create_service -->|"submits to"| node_provider_actions
node_login -.->|"authenticates via"| node_auth_actions
node_register -.->|"registers via"| node_auth_actions
node_session -->|"requests current user"| node_auth_routes
node_auth_actions -->|"posts credentials"| node_auth_routes
node_api_app -->|"mounts routes"| node_auth_routes
node_api_app -->|"mounts routes"| node_service_routes
node_api_app -->|"mounts routes"| node_booking_routes
node_auth_routes -->|"protects profile"| node_auth_middleware
node_service_routes -->|"checks access"| node_auth_middleware
node_booking_routes -->|"checks access"| node_auth_middleware
node_auth_routes -->|"reads and writes users"| node_prisma_client
node_service_routes -->|"reads and writes services"| node_prisma_client
node_booking_routes -->|"reads and writes bookings"| node_prisma_client
node_prisma_client -.->|"accesses"| node_database

click node_browse "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/page.js"
click node_service_detail "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/services/%5Bid%5D/page.js"
click node_login "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/login/page.js"
click node_register "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/register/page.js"
click node_provider_dashboard "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/dashboard/page.js"
click node_create_service "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/components/CreateServiceForm.js"
click node_provider_actions "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/provider-actions.js"
click node_auth_actions "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/auth-actions.js"
click node_session "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/session.js"
click node_bookings_page "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/bookings/page.js"
click node_booking_actions "https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/booking-actions.js"
click node_api_app "https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/auth.js"
click node_auth_middleware "https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/middleware/auth.js"
click node_service_routes "https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/services.js"
click node_booking_routes "https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/bookings.js"
click node_prisma_client "https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/db.js"
click node_database "https://github.com/rohankapadiya/booking-platform/blob/main/backend/prisma/schema.prisma"

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_browse,node_service_detail,node_login,node_register,node_provider_dashboard,node_create_service,node_provider_actions,node_auth_actions,node_session,node_bookings_page,node_booking_actions toneBlue
class node_api_app,node_auth_routes,node_auth_middleware,node_service_routes,node_booking_routes toneAmber
class node_prisma_client,node_database toneMint
class node_customer,node_provider toneIndigo
```

## Components

### Web experience

- [Browse services](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/page.js): `frontend/src/app/page.js`
- [Service details](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/services/%5Bid%5D/page.js): `frontend/src/app/services/[id]/page.js`
- [Sign in](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/login/page.js): `frontend/src/app/login/page.js`
- [Register](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/register/page.js): `frontend/src/app/register/page.js`
- [Provider dashboard](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/dashboard/page.js): `frontend/src/app/dashboard/page.js`
- [Create service form](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/components/CreateServiceForm.js): `frontend/src/components/CreateServiceForm.js`
- [Provider actions](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/provider-actions.js): `frontend/src/lib/provider-actions.js`
- [Auth actions](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/auth-actions.js): `frontend/src/lib/auth-actions.js`
- [Session lookup](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/session.js): `frontend/src/lib/session.js`
- [My bookings](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/app/bookings/page.js): `frontend/src/app/bookings/page.js`
- [Booking actions](https://github.com/rohankapadiya/booking-platform/blob/main/frontend/src/lib/booking-actions.js): `frontend/src/lib/booking-actions.js`

### Booking API

- [Express API](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/app.js): `backend/src/app.js`
- [Authentication](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [JWT and roles](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Services and slots](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/services.js): `backend/src/routes/services.js`
- [Bookings](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/routes/bookings.js): `backend/src/routes/bookings.js`

### Persistence

- [Prisma client](https://github.com/rohankapadiya/booking-platform/blob/main/backend/src/db.js): `backend/src/db.js`
- [Relational database](https://github.com/rohankapadiya/booking-platform/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`

### Other components

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

## Connections

- Provider → Provider dashboard: manages services (evidence: `README.md`)
- Customer → Browse services: finds services (evidence: `README.md`)
- Customer → My bookings: manages bookings (evidence: `README.md`)
- Create service form → Provider actions: submits to (evidence: `frontend/src/components/CreateServiceForm.js`)
- Sign in → Auth actions: authenticates via
- Register → Auth actions: registers via
- Session lookup → Authentication: requests current user (evidence: `frontend/src/lib/session.js`)
- Auth actions → Authentication: posts credentials (evidence: `frontend/src/lib/auth-actions.js`)
- Express API → Authentication: mounts routes (evidence: `backend/src/app.js`)
- Express API → Services and slots: mounts routes (evidence: `backend/src/app.js`)
- Express API → Bookings: mounts routes (evidence: `backend/src/app.js`)
- Authentication → JWT and roles: protects profile (evidence: `backend/src/routes/auth.js`)
- Services and slots → JWT and roles: checks access (evidence: `backend/src/routes/services.js`)
- Bookings → JWT and roles: checks access (evidence: `backend/src/routes/bookings.js`)
- Authentication → Prisma client: reads and writes users (evidence: `backend/src/routes/auth.js`)
- Services and slots → Prisma client: reads and writes services (evidence: `backend/src/routes/services.js`)
- Bookings → Prisma client: reads and writes bookings (evidence: `backend/src/routes/bookings.js`)
- Prisma client → Relational database: accesses
