# vadluri-pratheek/bookmycut architecture

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

- Interactive diagram: https://gitdiagram.com/vadluri-pratheek/bookmycut
- Repository: https://github.com/vadluri-pratheek/bookmycut

## Overview

BookMyCut is a two-sided barber appointment platform. Customers authenticate, discover nearby shops, choose services and available slots, then create and manage bookings; barbers configure shop and staff schedules and manage appointments. The graph includes the documented MongoDB transaction and live slot-locking behavior, although those implementation details are not fully visible in the excerpts. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled route and dashboard wiring is not inferred.

Main entry points: [`backend/src/controllers/booking.controller.js`](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/booking.controller.js) (Booking and slots), [`frontend/src/App.jsx`](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/App.jsx) (App routing), [`backend/src/controllers/schedule.controller.js`](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/schedule.controller.js) (Schedule management), [`frontend/src/api/client.js`](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer experience"]
  node_frontend_app["App routing<br/>[App.jsx]"]
  node_customer_auth["Customer auth"]
  node_customer_dashboard["Shop discovery and booking"]
  node_location["Location utilities<br/>[location.js]"]
  node_api_client["API client<br/>[client.js]"]
end

subgraph group_barber["Barber operations"]
  node_barber_auth["Barber auth<br/>[BarberAuthPage.jsx]"]
  node_barber_dashboard["Barber dashboard"]
end

subgraph group_api["API and domain"]
  node_api_app["Express API<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.route.js]"]
  node_auth_controller["Authentication<br/>[auth.controller.js]"]
  node_shop_controller["Shop discovery<br/>[shop.controller.js]"]
  node_booking_routes["Booking routes<br/>[booking.route.js]"]
  node_booking_controller["Booking and slots"]
  node_schedule_controller["Schedule management"]
  node_barber_controller["Barber management"]
  node_availability["Slot availability engine"]
  node_travel_time["Travel buffer<br/>[travelTime.js]"]
  node_lifecycle["Booking lifecycle"]
  node_notifications["Booking notifications"]
end

subgraph group_data["Booking and data"]
  node_booking_model[("Bookings<br/>[booking.model.js]")]
  node_user_model[("User and barber profiles<br/>[user.model.js]")]
  node_shop_model[("Shops<br/>[shop.model.js]")]
  node_schedule_model[("Daily schedules")]
end

node_customer(("Customer"))
node_barber_actor(("Barber staff"))
node_mongodb[("MongoDB")]
node_geocoder["OpenStreetMap Nominatim"]

node_customer -->|"uses"| node_frontend_app
node_barber_actor -->|"uses"| node_frontend_app
node_frontend_app -->|"routes to"| node_customer_auth
node_frontend_app -->|"routes to"| node_barber_auth
node_frontend_app -->|"routes to"| node_customer_dashboard
node_frontend_app -->|"routes to"| node_barber_dashboard
node_customer_auth -->|"calls"| node_api_client
node_barber_auth -->|"calls"| node_api_client
node_customer_dashboard -->|"calls"| node_api_client
node_customer_dashboard -->|"uses"| node_location
node_location -->|"reverse geocodes"| node_geocoder
node_api_client -.->|"HTTP requests"| node_api_app
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_booking_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"creates shop"| node_shop_model
node_booking_routes -->|"dispatches"| node_booking_controller
node_booking_controller -->|"computes slots"| node_availability
node_availability -->|"accounts for travel"| node_travel_time
node_booking_controller -->|"reads and writes"| node_booking_model
node_booking_controller -->|"reads"| node_shop_model
node_booking_controller -->|"reads"| node_user_model
node_booking_controller -->|"reads schedules"| node_schedule_model
node_booking_controller -->|"cancels expired"| node_lifecycle
node_lifecycle -->|"updates"| node_booking_model
node_lifecycle -->|"notifies"| node_notifications
node_schedule_controller -->|"reads and writes"| node_user_model
node_schedule_controller -->|"reads bookings"| node_booking_model
node_schedule_controller -->|"reads and writes"| node_schedule_model
node_schedule_controller -->|"reads"| node_shop_model
node_barber_controller -->|"reads and writes"| node_user_model
node_barber_controller -->|"reads bookings"| node_booking_model
node_barber_controller -->|"reads schedules"| node_schedule_model
node_booking_model -.->|"persists in"| node_mongodb
node_shop_model -.->|"persists in"| node_mongodb
node_user_model -.->|"persists in"| node_mongodb
node_schedule_model -.->|"persists in"| node_mongodb
node_customer_dashboard -.->|"requests booking API"| node_booking_controller
node_barber_dashboard -.->|"uses API"| node_api_client
node_barber_dashboard -.->|"manages schedules"| node_schedule_controller

click node_frontend_app "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/App.jsx"
click node_customer_auth "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/CustomerAuthPage.jsx"
click node_barber_auth "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/BarberAuthPage.jsx"
click node_customer_dashboard "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/CustomerDashboard.jsx"
click node_barber_dashboard "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/BarberDashboard.jsx"
click node_location "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/utils/location.js"
click node_api_client "https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/api/client.js"
click node_api_app "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/routes/auth.route.js"
click node_auth_controller "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/auth.controller.js"
click node_shop_controller "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/shop.controller.js"
click node_booking_routes "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/routes/booking.route.js"
click node_booking_controller "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/booking.controller.js"
click node_schedule_controller "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/schedule.controller.js"
click node_barber_controller "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/barber.controller.js"
click node_availability "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/availabilityEngine.js"
click node_travel_time "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/travelTime.js"
click node_lifecycle "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/bookingLifecycle.js"
click node_notifications "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/bookingNotifications.js"
click node_booking_model "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/booking.model.js"
click node_user_model "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/user.model.js"
click node_shop_model "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/shop.model.js"
click node_schedule_model "https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/daySchedule.model.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_frontend_app,node_customer_auth,node_customer_dashboard,node_location,node_api_client toneBlue
class node_barber_auth,node_barber_dashboard,node_mongodb toneAmber
class node_api_app,node_auth_routes,node_auth_controller,node_shop_controller,node_booking_routes,node_booking_controller,node_schedule_controller,node_barber_controller,node_availability,node_travel_time,node_lifecycle,node_notifications toneMint
class node_booking_model,node_user_model,node_shop_model,node_schedule_model toneRose
class node_customer,node_barber_actor,node_geocoder toneIndigo
```

## Components

### Customer experience

- [App routing](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Customer auth](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/CustomerAuthPage.jsx): `frontend/src/pages/CustomerAuthPage.jsx`
- [Shop discovery and booking](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/CustomerDashboard.jsx): `frontend/src/pages/CustomerDashboard.jsx`
- [Location utilities](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/utils/location.js): `frontend/src/utils/location.js`
- [API client](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Barber operations

- [Barber auth](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/BarberAuthPage.jsx): `frontend/src/pages/BarberAuthPage.jsx`
- [Barber dashboard](https://github.com/vadluri-pratheek/bookmycut/blob/main/frontend/src/pages/BarberDashboard.jsx): `frontend/src/pages/BarberDashboard.jsx`

### API and domain

- [Express API](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/routes/auth.route.js): `backend/src/routes/auth.route.js`
- [Authentication](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Shop discovery](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/shop.controller.js): `backend/src/controllers/shop.controller.js`
- [Booking routes](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/routes/booking.route.js): `backend/src/routes/booking.route.js`
- [Booking and slots](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/booking.controller.js): `backend/src/controllers/booking.controller.js`
- [Schedule management](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/schedule.controller.js): `backend/src/controllers/schedule.controller.js`
- [Barber management](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/controllers/barber.controller.js): `backend/src/controllers/barber.controller.js`
- [Slot availability engine](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/availabilityEngine.js): `backend/src/utils/availabilityEngine.js`
- [Travel buffer](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/travelTime.js): `backend/src/utils/travelTime.js`
- [Booking lifecycle](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/bookingLifecycle.js): `backend/src/utils/bookingLifecycle.js`
- [Booking notifications](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/utils/bookingNotifications.js): `backend/src/utils/bookingNotifications.js`

### Booking and data

- [Bookings](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/booking.model.js): `backend/src/models/booking.model.js`
- [User and barber profiles](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/user.model.js): `backend/src/models/user.model.js`
- [Shops](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/shop.model.js): `backend/src/models/shop.model.js`
- [Daily schedules](https://github.com/vadluri-pratheek/bookmycut/blob/main/backend/src/models/daySchedule.model.js): `backend/src/models/daySchedule.model.js`

### Other components

- **Customer**
- **Barber staff**
- **MongoDB**
- **OpenStreetMap Nominatim**

## Connections

- Customer → App routing: uses (evidence: `frontend/src/App.jsx`)
- Barber staff → App routing: uses (evidence: `frontend/src/App.jsx`)
- App routing → Customer auth: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Barber auth: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Shop discovery and booking: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Barber dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Customer auth → API client: calls (evidence: `frontend/src/pages/CustomerAuthPage.jsx`)
- Barber auth → API client: calls (evidence: `frontend/src/pages/BarberAuthPage.jsx`)
- Shop discovery and booking → API client: calls (evidence: `frontend/src/pages/CustomerDashboard.jsx`)
- Shop discovery and booking → Location utilities: uses (evidence: `frontend/src/pages/CustomerDashboard.jsx`)
- Location utilities → OpenStreetMap Nominatim: reverse geocodes (evidence: `frontend/src/utils/location.js`)
- API client → Express API: HTTP requests (evidence: `frontend/src/api/client.js`)
- Express API → Auth routes: mounts (evidence: `backend/src/app.js`)
- Express API → Booking routes: mounts (evidence: `backend/src/app.js`)
- Auth routes → Authentication: dispatches (evidence: `backend/src/routes/auth.route.js`)
- Authentication → User and barber profiles: reads and writes (evidence: `backend/src/controllers/auth.controller.js`)
- Authentication → Shops: creates shop (evidence: `backend/src/controllers/auth.controller.js`)
- Booking routes → Booking and slots: dispatches (evidence: `backend/src/routes/booking.route.js`)
- Booking and slots → Slot availability engine: computes slots (evidence: `backend/src/controllers/booking.controller.js`)
- Slot availability engine → Travel buffer: accounts for travel (evidence: `backend/src/utils/availabilityEngine.js`)
- Booking and slots → Bookings: reads and writes (evidence: `backend/src/controllers/booking.controller.js`)
- Booking and slots → Shops: reads (evidence: `backend/src/controllers/booking.controller.js`)
- Booking and slots → User and barber profiles: reads (evidence: `backend/src/controllers/booking.controller.js`)
- Booking and slots → Daily schedules: reads schedules (evidence: `backend/src/controllers/booking.controller.js`)
- Booking and slots → Booking lifecycle: cancels expired (evidence: `backend/src/controllers/booking.controller.js`)
- Booking lifecycle → Bookings: updates (evidence: `backend/src/utils/bookingLifecycle.js`)
- Booking lifecycle → Booking notifications: notifies (evidence: `backend/src/utils/bookingLifecycle.js`)
- Schedule management → User and barber profiles: reads and writes (evidence: `backend/src/controllers/schedule.controller.js`)
- Schedule management → Bookings: reads bookings (evidence: `backend/src/controllers/schedule.controller.js`)
- Schedule management → Daily schedules: reads and writes (evidence: `backend/src/controllers/schedule.controller.js`)
- Schedule management → Shops: reads (evidence: `backend/src/controllers/schedule.controller.js`)
- Barber management → User and barber profiles: reads and writes (evidence: `backend/src/controllers/barber.controller.js`)
- Barber management → Bookings: reads bookings (evidence: `backend/src/controllers/barber.controller.js`)
- Barber management → Daily schedules: reads schedules (evidence: `backend/src/controllers/barber.controller.js`)
- Bookings → MongoDB: persists in (evidence: `README.md`)
- Shops → MongoDB: persists in (evidence: `README.md`)
- User and barber profiles → MongoDB: persists in (evidence: `README.md`)
- Daily schedules → MongoDB: persists in (evidence: `README.md`)
- Shop discovery and booking → Booking and slots: requests booking API
- Barber dashboard → API client: uses API
- Barber dashboard → Schedule management: manages schedules
