# i3rb-v/nadeem-barbershop architecture

> Architecture diagram of the GitHub repository i3rb-v/nadeem-barbershop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/i3rb-v/nadeem-barbershop
- Repository: https://github.com/i3rb-v/nadeem-barbershop

## Overview

Nadeem BarberShop is a bilingual booking and shop-management web app for four branches. Customers browse services, barbers and branches, select a branch, service, barber, date and available time, then submit a reservation and view its receipt. The server provides configuration, availability, appointment and chat APIs; JSON files provide persistent business and user data. Separate login, admin and barber screens support staff workflows. The excerpts show slot calculation and appointment validation, but omit some route handlers and client logic, so uncertain connections are not drawn.

Main entry points: [`nadeem-barbershop-v2.1/nadeem-v21/public/app.js`](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/app.js) (Web application), [`nadeem-barbershop-v2.1/nadeem-v21/server.js`](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js) (HTTP API), [`nadeem-barbershop-v2.1/nadeem-v21/data/store.json`](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/data/store.json) (Business data), [`nadeem-barbershop-v2.1/nadeem-v21/public/index.html`](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/index.html) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_home["Home page<br/>[index.html]"]
  node_discovery_pages["Shop information<br/>[public]"]
  node_booking_page["Booking page<br/>[booking.html]"]
  node_receipt_page["Receipt page<br/>[receipt.html]"]
  node_client_app["Web application<br/>[app.js]"]
end

subgraph group_booking["Booking services"]
  node_api_server["HTTP API<br/>[server.js]"]
  node_availability["Slot availability<br/>[server.js]"]
  node_reservations["Appointments<br/>[server.js]"]
  node_chat_service["Chat assistant<br/>[server.js]"]
end

subgraph group_staff["Staff operations"]
  node_login_page["Staff login<br/>[login.html]"]
  node_admin_page["Admin console<br/>[admin.html]"]
  node_barber_page["Barber console<br/>[barber.html]"]
end

subgraph group_data["Data and integrations"]
  node_business_store[("Business data<br/>[store.json]")]
  node_user_store[("User data<br/>[users.json]")]
  node_email_service["Email delivery<br/>[server.js]"]
  node_whatsapp_service["WhatsApp notices<br/>[server.js]"]
end

node_customer_actor(("Customer"))
node_gemini{{"Gemini API"}}
node_smtp{{"SMTP service"}}
node_twilio{{"Twilio service"}}

node_customer_actor -->|"opens"| node_home
node_customer_actor -->|"books through"| node_booking_page
node_home -->|"renders with"| node_client_app
node_discovery_pages -->|"renders with"| node_client_app
node_booking_page -->|"renders with"| node_client_app
node_receipt_page -->|"renders with"| node_client_app
node_login_page -->|"renders with"| node_client_app
node_admin_page -->|"renders with"| node_client_app
node_barber_page -->|"renders with"| node_client_app
node_client_app -->|"requests APIs"| node_api_server
node_api_server -->|"reads and writes"| node_business_store
node_api_server -->|"reads and writes"| node_user_store
node_api_server -->|"calculates slots"| node_availability
node_api_server -->|"handles bookings"| node_reservations
node_availability -->|"reads schedules"| node_business_store
node_availability -->|"checks conflicts"| node_reservations
node_reservations -->|"persists appointments"| node_business_store
node_client_app -->|"sends questions"| node_chat_service
node_chat_service -->|"reads business data"| node_business_store
node_chat_service -.->|"queries when configured"| node_gemini
node_api_server -->|"sends receipts"| node_email_service
node_email_service -.->|"delivers through"| node_smtp
node_api_server -->|"sends notices"| node_whatsapp_service
node_whatsapp_service -.->|"delivers through"| node_twilio

click node_home "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/index.html"
click node_discovery_pages "https://github.com/i3rb-v/nadeem-barbershop/tree/main/nadeem-barbershop-v2.1/nadeem-v21/public"
click node_booking_page "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/booking.html"
click node_receipt_page "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/receipt.html"
click node_client_app "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/app.js"
click node_api_server "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js"
click node_availability "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js"
click node_reservations "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js"
click node_login_page "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/login.html"
click node_admin_page "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/admin.html"
click node_barber_page "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/barber.html"
click node_business_store "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/data/store.json"
click node_user_store "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/data/users.json"
click node_chat_service "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js"
click node_email_service "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js"
click node_whatsapp_service "https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.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_home,node_discovery_pages,node_booking_page,node_receipt_page,node_client_app toneBlue
class node_api_server,node_availability,node_reservations,node_chat_service toneAmber
class node_login_page,node_admin_page,node_barber_page,node_gemini toneMint
class node_business_store,node_user_store,node_email_service,node_whatsapp_service toneRose
class node_customer_actor,node_smtp,node_twilio toneIndigo
```

## Components

### Customer experience

- [Home page](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/index.html): `nadeem-barbershop-v2.1/nadeem-v21/public/index.html`
- [Shop information](https://github.com/i3rb-v/nadeem-barbershop/tree/main/nadeem-barbershop-v2.1/nadeem-v21/public): `nadeem-barbershop-v2.1/nadeem-v21/public`
- [Booking page](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/booking.html): `nadeem-barbershop-v2.1/nadeem-v21/public/booking.html`
- [Receipt page](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/receipt.html): `nadeem-barbershop-v2.1/nadeem-v21/public/receipt.html`
- [Web application](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/app.js): `nadeem-barbershop-v2.1/nadeem-v21/public/app.js`

### Booking services

- [HTTP API](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js): `nadeem-barbershop-v2.1/nadeem-v21/server.js`
- [Slot availability](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js): `nadeem-barbershop-v2.1/nadeem-v21/server.js`
- [Appointments](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js): `nadeem-barbershop-v2.1/nadeem-v21/server.js`
- [Chat assistant](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js): `nadeem-barbershop-v2.1/nadeem-v21/server.js`

### Staff operations

- [Staff login](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/login.html): `nadeem-barbershop-v2.1/nadeem-v21/public/login.html`
- [Admin console](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/admin.html): `nadeem-barbershop-v2.1/nadeem-v21/public/admin.html`
- [Barber console](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/public/barber.html): `nadeem-barbershop-v2.1/nadeem-v21/public/barber.html`

### Data and integrations

- [Business data](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/data/store.json): `nadeem-barbershop-v2.1/nadeem-v21/data/store.json`
- [User data](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/data/users.json): `nadeem-barbershop-v2.1/nadeem-v21/data/users.json`
- [Email delivery](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js): `nadeem-barbershop-v2.1/nadeem-v21/server.js`
- [WhatsApp notices](https://github.com/i3rb-v/nadeem-barbershop/blob/main/nadeem-barbershop-v2.1/nadeem-v21/server.js): `nadeem-barbershop-v2.1/nadeem-v21/server.js`

### Other components

- **Customer**
- **Gemini API**
- **SMTP service**
- **Twilio service**

## Connections

- Customer → Home page: opens
- Customer → Booking page: books through
- Home page → Web application: renders with
- Shop information → Web application: renders with
- Booking page → Web application: renders with
- Receipt page → Web application: renders with
- Staff login → Web application: renders with
- Admin console → Web application: renders with
- Barber console → Web application: renders with
- Web application → HTTP API: requests APIs
- HTTP API → Business data: reads and writes
- HTTP API → User data: reads and writes
- HTTP API → Slot availability: calculates slots
- HTTP API → Appointments: handles bookings
- Slot availability → Business data: reads schedules
- Slot availability → Appointments: checks conflicts
- Appointments → Business data: persists appointments
- Web application → Chat assistant: sends questions
- Chat assistant → Business data: reads business data
- Chat assistant → Gemini API: queries when configured
- HTTP API → Email delivery: sends receipts
- Email delivery → SMTP service: delivers through
- HTTP API → WhatsApp notices: sends notices
- WhatsApp notices → Twilio service: delivers through
