# meetindoriya/nexa-salon architecture

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

- Interactive diagram: https://gitdiagram.com/meetindoriya/nexa-salon
- Repository: https://github.com/meetindoriya/nexa-salon

## Overview

Nexa Salon is a salon-management application: customers browse services and products, register or sign in, and use role-specific dashboards for appointments and other salon operations. The React client calls an Express API; its appointment handlers check availability and manage bookings, while API routes dispatch requests to domain controllers and MongoDB models. The source index also identifies admin, barber, receptionist, inventory, orders, staff, wages, and analytics capabilities. Some of those implementation files were not excerpted, so their internal links are omitted or shown only where indexed references support them.

Main entry points: [`src/component/MainProvider.jsx`](https://github.com/meetindoriya/nexa-salon/blob/main/src/component/MainProvider.jsx) (App provider), [`src/pages/AdminDashboard.jsx`](https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/AdminDashboard.jsx) (Admin dashboard), [`backend/src/controllers/appointment.controller.js`](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/appointment.controller.js) (Appointment operations), [`backend/services/api.js`](https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/api.js) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_webapp["App shell<br/>[App.jsx]"]
  node_provider["App provider<br/>[MainProvider.jsx]"]
  node_landing["Public salon page<br/>[Main.jsx]"]
  node_admin["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_barber["Barber dashboard"]
  node_reception["Receptionist dashboard"]
  node_userdash["Customer dashboard<br/>[UserDashboard.jsx]"]
end

subgraph group_api["API and access"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_auth_service["Auth and dashboard calls<br/>[authService.js]"]
  node_appointment_service["Appointment calls"]
  node_catalog_services["Catalog calls<br/>[serviceService.js]"]
  node_product_service["Product calls<br/>[productService.js]"]
  node_server["Express API server<br/>[server.js]"]
  node_appointment_routes["Appointment routes"]
  node_auth_middleware["Authentication and roles<br/>[auth.js]"]
  node_validation["Request validation<br/>[validate.js]"]
end

subgraph group_salon["Salon operations"]
  node_appointments["Appointment operations"]
  node_admin_ops["Admin and reporting"]
  node_order_ops["Orders"]
  node_staff_ops["Staff and time off"]
end

subgraph group_data["Domain data"]
  node_service_data[("Service records<br/>[Service.js]")]
  node_appointment_data[("Appointment records<br/>[Appointment.js]")]
  node_user_data[("User records<br/>[User.js]")]
  node_timeoff_data[("Time-off records<br/>[TimeOff.js]")]
  node_order_data[("Order records<br/>[Order.js]")]
  node_product_data[("Product records<br/>[Product.js]")]
end

node_customer(("Salon user"))

node_customer -->|"uses"| node_webapp
node_webapp -->|"renders"| node_provider
node_provider -->|"routes to"| node_landing
node_provider -->|"routes to"| node_admin
node_provider -->|"routes to"| node_barber
node_provider -->|"routes to"| node_reception
node_provider -->|"routes to"| node_userdash
node_landing -->|"loads services"| node_catalog_services
node_landing -->|"loads products"| node_product_service
node_admin -->|"loads dashboard"| node_auth_service
node_admin -->|"manages appointments"| node_appointment_service
node_admin -->|"manages services"| node_catalog_services
node_admin -->|"manages products"| node_product_service
node_barber -->|"loads appointments"| node_appointment_service
node_barber -->|"loads dashboard"| node_auth_service
node_userdash -->|"books appointments"| node_appointment_service
node_userdash -->|"loads account"| node_auth_service
node_appointment_service -->|"sends requests"| node_api_client
node_auth_service -->|"sends requests"| node_api_client
node_catalog_services -->|"sends requests"| node_api_client
node_product_service -->|"sends requests"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts routes"| node_appointment_routes
node_appointment_routes -->|"guards requests"| node_auth_middleware
node_appointment_routes -->|"validates input"| node_validation
node_appointment_routes -->|"dispatches"| node_appointments
node_appointments -->|"reads and writes"| node_appointment_data
node_appointments -->|"checks service"| node_service_data
node_appointments -->|"checks barber"| node_user_data
node_appointments -->|"checks leave"| node_timeoff_data
node_admin_ops -->|"queries"| node_appointment_data
node_admin_ops -->|"queries"| node_order_data
node_admin_ops -->|"queries"| node_user_data
node_order_ops -->|"reads and writes"| node_order_data
node_order_ops -->|"uses products"| node_product_data
node_staff_ops -->|"queries staff"| node_user_data
node_staff_ops -->|"manages leave"| node_timeoff_data
node_staff_ops -->|"checks bookings"| node_appointment_data

click node_webapp "https://github.com/meetindoriya/nexa-salon/blob/main/src/App.jsx"
click node_provider "https://github.com/meetindoriya/nexa-salon/blob/main/src/component/MainProvider.jsx"
click node_landing "https://github.com/meetindoriya/nexa-salon/blob/main/src/component/Main.jsx"
click node_admin "https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/AdminDashboard.jsx"
click node_barber "https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/BarberDashboard.jsx"
click node_reception "https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/ReceptionistDashboard.jsx"
click node_userdash "https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/UserDashboard.jsx"
click node_api_client "https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/api.js"
click node_auth_service "https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/authService.js"
click node_appointment_service "https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/appointmentService.js"
click node_catalog_services "https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/serviceService.js"
click node_product_service "https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/productService.js"
click node_server "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/server.js"
click node_appointment_routes "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/routes/appointment.routes.js"
click node_auth_middleware "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/middleware/auth.js"
click node_validation "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/middleware/validate.js"
click node_appointments "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/appointment.controller.js"
click node_admin_ops "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/dashboard.controller.js"
click node_order_ops "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/order.controller.js"
click node_staff_ops "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/staff.controller.js"
click node_service_data "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Service.js"
click node_appointment_data "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Appointment.js"
click node_user_data "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/User.js"
click node_timeoff_data "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/TimeOff.js"
click node_order_data "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Order.js"
click node_product_data "https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Product.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_webapp,node_provider,node_landing,node_admin,node_barber,node_reception,node_userdash,node_customer toneBlue
class node_api_client,node_auth_service,node_appointment_service,node_catalog_services,node_product_service,node_server,node_appointment_routes,node_auth_middleware,node_validation toneAmber
class node_appointments,node_admin_ops,node_order_ops,node_staff_ops toneMint
class node_service_data,node_appointment_data,node_user_data,node_timeoff_data,node_order_data,node_product_data toneRose
```

## Components

### React client

- [App shell](https://github.com/meetindoriya/nexa-salon/blob/main/src/App.jsx): `src/App.jsx`
- [App provider](https://github.com/meetindoriya/nexa-salon/blob/main/src/component/MainProvider.jsx): `src/component/MainProvider.jsx`
- [Public salon page](https://github.com/meetindoriya/nexa-salon/blob/main/src/component/Main.jsx): `src/component/Main.jsx`
- [Admin dashboard](https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/AdminDashboard.jsx): `src/pages/AdminDashboard.jsx`
- [Barber dashboard](https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/BarberDashboard.jsx): `src/pages/BarberDashboard.jsx`
- [Receptionist dashboard](https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/ReceptionistDashboard.jsx): `src/pages/ReceptionistDashboard.jsx`
- [Customer dashboard](https://github.com/meetindoriya/nexa-salon/blob/main/src/pages/UserDashboard.jsx): `src/pages/UserDashboard.jsx`

### API and access

- [HTTP client](https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/api.js): `backend/services/api.js`
- [Auth and dashboard calls](https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/authService.js): `backend/services/authService.js`
- [Appointment calls](https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/appointmentService.js): `backend/services/appointmentService.js`
- [Catalog calls](https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/serviceService.js): `backend/services/serviceService.js`
- [Product calls](https://github.com/meetindoriya/nexa-salon/blob/main/backend/services/productService.js): `backend/services/productService.js`
- [Express API server](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/server.js): `backend/src/server.js`
- [Appointment routes](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/routes/appointment.routes.js): `backend/src/routes/appointment.routes.js`
- [Authentication and roles](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Request validation](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/middleware/validate.js): `backend/src/middleware/validate.js`

### Salon operations

- [Appointment operations](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/appointment.controller.js): `backend/src/controllers/appointment.controller.js`
- [Admin and reporting](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/dashboard.controller.js): `backend/src/controllers/dashboard.controller.js`
- [Orders](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/order.controller.js): `backend/src/controllers/order.controller.js`
- [Staff and time off](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/controllers/staff.controller.js): `backend/src/controllers/staff.controller.js`

### Domain data

- [Service records](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Service.js): `backend/src/models/Service.js`
- [Appointment records](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Appointment.js): `backend/src/models/Appointment.js`
- [User records](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Time-off records](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/TimeOff.js): `backend/src/models/TimeOff.js`
- [Order records](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Order.js): `backend/src/models/Order.js`
- [Product records](https://github.com/meetindoriya/nexa-salon/blob/main/backend/src/models/Product.js): `backend/src/models/Product.js`

### Other components

- **Salon user**

## Connections

- Salon user → App shell: uses
- App shell → App provider: renders (evidence: `src/App.jsx`)
- App provider → Public salon page: routes to (evidence: `src/component/MainProvider.jsx`)
- App provider → Admin dashboard: routes to (evidence: `src/component/MainProvider.jsx`)
- App provider → Barber dashboard: routes to (evidence: `src/component/MainProvider.jsx`)
- App provider → Receptionist dashboard: routes to (evidence: `src/component/MainProvider.jsx`)
- App provider → Customer dashboard: routes to (evidence: `src/component/MainProvider.jsx`)
- Public salon page → Catalog calls: loads services (evidence: `src/component/Main.jsx`)
- Public salon page → Product calls: loads products (evidence: `src/component/Main.jsx`)
- Admin dashboard → Auth and dashboard calls: loads dashboard (evidence: `src/pages/AdminDashboard.jsx`)
- Admin dashboard → Appointment calls: manages appointments (evidence: `src/pages/AdminDashboard.jsx`)
- Admin dashboard → Catalog calls: manages services (evidence: `src/pages/AdminDashboard.jsx`)
- Admin dashboard → Product calls: manages products (evidence: `src/pages/AdminDashboard.jsx`)
- Barber dashboard → Appointment calls: loads appointments (evidence: `src/pages/BarberDashboard.jsx`)
- Barber dashboard → Auth and dashboard calls: loads dashboard (evidence: `src/pages/BarberDashboard.jsx`)
- Customer dashboard → Appointment calls: books appointments (evidence: `src/pages/UserDashboard.jsx`)
- Customer dashboard → Auth and dashboard calls: loads account (evidence: `src/pages/UserDashboard.jsx`)
- Appointment calls → HTTP client: sends requests (evidence: `backend/services/appointmentService.js`)
- Auth and dashboard calls → HTTP client: sends requests (evidence: `backend/services/authService.js`)
- Catalog calls → HTTP client: sends requests (evidence: `backend/services/serviceService.js`)
- Product calls → HTTP client: sends requests (evidence: `backend/services/productService.js`)
- HTTP client → Express API server: calls API
- Express API server → Appointment routes: mounts routes (evidence: `backend/src/server.js`)
- Appointment routes → Authentication and roles: guards requests (evidence: `backend/src/routes/appointment.routes.js`)
- Appointment routes → Request validation: validates input (evidence: `backend/src/routes/appointment.routes.js`)
- Appointment routes → Appointment operations: dispatches (evidence: `backend/src/routes/appointment.routes.js`)
- Appointment operations → Appointment records: reads and writes (evidence: `backend/src/controllers/appointment.controller.js`)
- Appointment operations → Service records: checks service (evidence: `backend/src/controllers/appointment.controller.js`)
- Appointment operations → User records: checks barber (evidence: `backend/src/controllers/appointment.controller.js`)
- Appointment operations → Time-off records: checks leave (evidence: `backend/src/controllers/appointment.controller.js`)
- Admin and reporting → Appointment records: queries (evidence: `backend/src/controllers/dashboard.controller.js`)
- Admin and reporting → Order records: queries (evidence: `backend/src/controllers/dashboard.controller.js`)
- Admin and reporting → User records: queries (evidence: `backend/src/controllers/dashboard.controller.js`)
- Orders → Order records: reads and writes (evidence: `backend/src/controllers/order.controller.js`)
- Orders → Product records: uses products (evidence: `backend/src/controllers/order.controller.js`)
- Staff and time off → User records: queries staff (evidence: `backend/src/controllers/staff.controller.js`)
- Staff and time off → Time-off records: manages leave (evidence: `backend/src/controllers/staff.controller.js`)
- Staff and time off → Appointment records: checks bookings (evidence: `backend/src/controllers/staff.controller.js`)
