# manue1gomez/brbstudio architecture

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

- Interactive diagram: https://gitdiagram.com/manue1gomez/brbstudio
- Repository: https://github.com/manue1gomez/brbstudio

## Overview

BRB Studios is a studio booking and administration web app. Customers browse services and availability, register or log in, and use the site to pursue bookings; staff manage bookings, calendar blocks, services, payments, and dashboard views. The server mounts API routes that dispatch to controllers and domain services, which apply booking/payment rules and use models backed by MySQL. The source index supports several service-to-model links; unsampled modules and absent README mean some frontend-to-API and domain links cannot be verified, so they are omitted.

Main entry points: [`app.js`](https://github.com/manue1gomez/brbstudio/blob/main/app.js) (Express app), [`backend/services/paymentService.js`](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/paymentService.js) (Payment operations), [`backend/services/bookingManagementService.js`](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/bookingManagementService.js) (Booking management), [`backend/models/bookingManagementModel.js`](https://github.com/manue1gomez/brbstudio/blob/main/backend/models/bookingManagementModel.js) (Booking model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer site"]
  node_customer_ui["Customer pages<br/>[home.js]"]
  node_availability_ui["Availability calendar<br/>[home-calendar.js]"]
  node_customer_api["Customer API client<br/>[api.js]"]
  node_session_ui["Customer session<br/>[session.js]"]
end

subgraph group_admin["Admin workspace"]
  node_admin_booking_ui["Booking console<br/>[booking.js]"]
end

subgraph group_api["HTTP API"]
  node_server["Express app<br/>[app.js]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.js]"]
  node_service_routes["Service routes<br/>[serviceRoutes.js]"]
  node_admin_service_routes["Admin service routes"]
  node_calendar_routes["Calendar routes<br/>[calendarRoutes.js]"]
  node_admin_calendar_routes["Admin calendar routes"]
  node_dashboard_routes["Dashboard routes<br/>[dashboardRoutes.js]"]
  node_admin_payment_routes["Admin payment routes"]
  node_admin_booking_routes["Admin booking routes"]
end

subgraph group_domain["Booking operations"]
  node_auth_controller["Authentication handler<br/>[authController.js]"]
  node_calendar_controller["Calendar handler"]
  node_payment_controller["Payment handler"]
  node_service_controller["Service handler"]
  node_dashboard_controller["Dashboard handler"]
  node_auth_service["Account operations<br/>[authService.js]"]
  node_booking_service["Booking management"]
  node_calendar_service["Calendar operations<br/>[calendarService.js]"]
  node_payment_service["Payment operations<br/>[paymentService.js]"]
  node_service_service["Service management"]
  node_dashboard_service["Dashboard metrics"]
  node_rules["Booking and payment rules<br/>[bookingRules.js]"]
end

subgraph group_data["Persistence and integrations"]
  node_customer_model["Customer model<br/>[customerModel.js]"]
  node_booking_model["Booking model"]
  node_blocked_model["Blocked date model"]
  node_payment_model["Payment model<br/>[paymentModel.js]"]
  node_receipt_email["Receipt email service"]
  node_service_model["Service model<br/>[serviceModel.js]"]
end

node_visitor(("Customer"))
node_staff(("Studio staff"))

node_visitor -.->|"uses"| node_customer_ui
node_staff -.->|"uses"| node_admin_booking_ui
node_customer_ui -.->|"renders"| node_availability_ui
node_availability_ui -->|"calls"| node_customer_api
node_session_ui -->|"calls"| node_customer_api
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_service_routes
node_server -->|"mounts"| node_admin_service_routes
node_server -->|"mounts"| node_calendar_routes
node_server -->|"mounts"| node_admin_calendar_routes
node_server -->|"mounts"| node_dashboard_routes
node_server -->|"mounts"| node_admin_payment_routes
node_server -->|"mounts"| node_admin_booking_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_admin_calendar_routes -->|"dispatches"| node_calendar_controller
node_admin_payment_routes -->|"dispatches"| node_payment_controller
node_admin_service_routes -->|"dispatches"| node_service_controller
node_dashboard_routes -->|"dispatches"| node_dashboard_controller
node_auth_controller -->|"calls"| node_auth_service
node_calendar_controller -->|"calls"| node_calendar_service
node_payment_controller -->|"calls"| node_payment_service
node_service_controller -->|"calls"| node_service_service
node_dashboard_controller -->|"calls"| node_dashboard_service
node_auth_service -->|"reads/writes"| node_customer_model
node_booking_service -->|"queries"| node_booking_model
node_booking_service -->|"checks dates"| node_blocked_model
node_booking_service -->|"reads payments"| node_payment_model
node_payment_service -->|"records payments"| node_payment_model
node_payment_service -->|"updates bookings"| node_booking_model
node_payment_service -->|"sends receipts"| node_receipt_email
node_service_service -.->|"manages services"| node_service_model
node_calendar_service -.->|"manages blocks"| node_blocked_model
node_dashboard_service -.->|"summarizes"| node_booking_model
node_booking_service -->|"uses rules"| node_rules
node_payment_service -->|"uses rules"| node_rules

click node_customer_ui "https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/home.js"
click node_availability_ui "https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/home-calendar.js"
click node_customer_api "https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/api.js"
click node_session_ui "https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/session.js"
click node_admin_booking_ui "https://github.com/manue1gomez/brbstudio/blob/main/frontend/admin/js/booking.js"
click node_server "https://github.com/manue1gomez/brbstudio/blob/main/app.js"
click node_auth_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/authRoutes.js"
click node_service_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/serviceRoutes.js"
click node_admin_service_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminServiceRoutes.js"
click node_calendar_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/calendarRoutes.js"
click node_admin_calendar_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminCalendarRoutes.js"
click node_dashboard_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/dashboardRoutes.js"
click node_admin_payment_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminPaymentRoutes.js"
click node_admin_booking_routes "https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminBookingRoutes.js"
click node_auth_controller "https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/authController.js"
click node_calendar_controller "https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/calendarController.js"
click node_payment_controller "https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/paymentController.js"
click node_service_controller "https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/serviceController.js"
click node_dashboard_controller "https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/dashboardController.js"
click node_auth_service "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/authService.js"
click node_booking_service "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/bookingManagementService.js"
click node_calendar_service "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/calendarService.js"
click node_payment_service "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/paymentService.js"
click node_service_service "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/serviceManagementService.js"
click node_dashboard_service "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/dashboardService.js"
click node_rules "https://github.com/manue1gomez/brbstudio/blob/main/backend/config/bookingRules.js"
click node_customer_model "https://github.com/manue1gomez/brbstudio/blob/main/backend/models/customerModel.js"
click node_booking_model "https://github.com/manue1gomez/brbstudio/blob/main/backend/models/bookingManagementModel.js"
click node_blocked_model "https://github.com/manue1gomez/brbstudio/blob/main/backend/models/blockedDateModel.js"
click node_payment_model "https://github.com/manue1gomez/brbstudio/blob/main/backend/models/paymentModel.js"
click node_receipt_email "https://github.com/manue1gomez/brbstudio/blob/main/backend/services/receiptEmailService.js"
click node_service_model "https://github.com/manue1gomez/brbstudio/blob/main/backend/models/serviceModel.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_customer_ui,node_availability_ui,node_customer_api,node_session_ui toneBlue
class node_admin_booking_ui toneAmber
class node_server,node_auth_routes,node_service_routes,node_admin_service_routes,node_calendar_routes,node_admin_calendar_routes,node_dashboard_routes,node_admin_payment_routes,node_admin_booking_routes toneMint
class node_auth_controller,node_calendar_controller,node_payment_controller,node_service_controller,node_dashboard_controller,node_auth_service,node_booking_service,node_calendar_service,node_payment_service,node_service_service,node_dashboard_service,node_rules toneRose
class node_customer_model,node_booking_model,node_blocked_model,node_payment_model,node_receipt_email,node_service_model,node_visitor,node_staff toneIndigo
```

## Components

### Customer site

- [Customer pages](https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/home.js): `frontend/customer/js/home.js`
- [Availability calendar](https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/home-calendar.js): `frontend/customer/js/home-calendar.js`
- [Customer API client](https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/api.js): `frontend/customer/js/api.js`
- [Customer session](https://github.com/manue1gomez/brbstudio/blob/main/frontend/customer/js/session.js): `frontend/customer/js/session.js`

### Admin workspace

- [Booking console](https://github.com/manue1gomez/brbstudio/blob/main/frontend/admin/js/booking.js): `frontend/admin/js/booking.js`

### HTTP API

- [Express app](https://github.com/manue1gomez/brbstudio/blob/main/app.js): `app.js`
- [Authentication routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Service routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/serviceRoutes.js): `backend/routes/serviceRoutes.js`
- [Admin service routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminServiceRoutes.js): `backend/routes/adminServiceRoutes.js`
- [Calendar routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/calendarRoutes.js): `backend/routes/calendarRoutes.js`
- [Admin calendar routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminCalendarRoutes.js): `backend/routes/adminCalendarRoutes.js`
- [Dashboard routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/dashboardRoutes.js): `backend/routes/dashboardRoutes.js`
- [Admin payment routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminPaymentRoutes.js): `backend/routes/adminPaymentRoutes.js`
- [Admin booking routes](https://github.com/manue1gomez/brbstudio/blob/main/backend/routes/adminBookingRoutes.js): `backend/routes/adminBookingRoutes.js`

### Booking operations

- [Authentication handler](https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Calendar handler](https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/calendarController.js): `backend/controllers/calendarController.js`
- [Payment handler](https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/paymentController.js): `backend/controllers/paymentController.js`
- [Service handler](https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/serviceController.js): `backend/controllers/serviceController.js`
- [Dashboard handler](https://github.com/manue1gomez/brbstudio/blob/main/backend/controllers/dashboardController.js): `backend/controllers/dashboardController.js`
- [Account operations](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/authService.js): `backend/services/authService.js`
- [Booking management](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/bookingManagementService.js): `backend/services/bookingManagementService.js`
- [Calendar operations](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/calendarService.js): `backend/services/calendarService.js`
- [Payment operations](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/paymentService.js): `backend/services/paymentService.js`
- [Service management](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/serviceManagementService.js): `backend/services/serviceManagementService.js`
- [Dashboard metrics](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/dashboardService.js): `backend/services/dashboardService.js`
- [Booking and payment rules](https://github.com/manue1gomez/brbstudio/blob/main/backend/config/bookingRules.js): `backend/config/bookingRules.js`

### Persistence and integrations

- [Customer model](https://github.com/manue1gomez/brbstudio/blob/main/backend/models/customerModel.js): `backend/models/customerModel.js`
- [Booking model](https://github.com/manue1gomez/brbstudio/blob/main/backend/models/bookingManagementModel.js): `backend/models/bookingManagementModel.js`
- [Blocked date model](https://github.com/manue1gomez/brbstudio/blob/main/backend/models/blockedDateModel.js): `backend/models/blockedDateModel.js`
- [Payment model](https://github.com/manue1gomez/brbstudio/blob/main/backend/models/paymentModel.js): `backend/models/paymentModel.js`
- [Receipt email service](https://github.com/manue1gomez/brbstudio/blob/main/backend/services/receiptEmailService.js): `backend/services/receiptEmailService.js`
- [Service model](https://github.com/manue1gomez/brbstudio/blob/main/backend/models/serviceModel.js): `backend/models/serviceModel.js`

### Other components

- **Customer**
- **Studio staff**

## Connections

- Customer → Customer pages: uses
- Studio staff → Booking console: uses
- Customer pages → Availability calendar: renders
- Availability calendar → Customer API client: calls (evidence: `frontend/customer/js/home-calendar.js`)
- Customer session → Customer API client: calls (evidence: `frontend/customer/js/session.js`)
- Express app → Authentication routes: mounts (evidence: `app.js`)
- Express app → Service routes: mounts (evidence: `app.js`)
- Express app → Admin service routes: mounts (evidence: `app.js`)
- Express app → Calendar routes: mounts (evidence: `app.js`)
- Express app → Admin calendar routes: mounts (evidence: `app.js`)
- Express app → Dashboard routes: mounts (evidence: `app.js`)
- Express app → Admin payment routes: mounts (evidence: `app.js`)
- Express app → Admin booking routes: mounts (evidence: `app.js`)
- Authentication routes → Authentication handler: dispatches (evidence: `backend/routes/authRoutes.js`)
- Admin calendar routes → Calendar handler: dispatches (evidence: `backend/routes/adminCalendarRoutes.js`)
- Admin payment routes → Payment handler: dispatches (evidence: `backend/routes/adminPaymentRoutes.js`)
- Admin service routes → Service handler: dispatches (evidence: `backend/routes/adminServiceRoutes.js`)
- Dashboard routes → Dashboard handler: dispatches (evidence: `backend/routes/dashboardRoutes.js`)
- Authentication handler → Account operations: calls (evidence: `backend/controllers/authController.js`)
- Calendar handler → Calendar operations: calls (evidence: `backend/controllers/calendarController.js`)
- Payment handler → Payment operations: calls (evidence: `backend/controllers/paymentController.js`)
- Service handler → Service management: calls (evidence: `backend/controllers/serviceController.js`)
- Dashboard handler → Dashboard metrics: calls (evidence: `backend/controllers/dashboardController.js`)
- Account operations → Customer model: reads/writes (evidence: `backend/services/authService.js`)
- Booking management → Booking model: queries (evidence: `backend/services/bookingManagementService.js`)
- Booking management → Blocked date model: checks dates (evidence: `backend/services/bookingManagementService.js`)
- Booking management → Payment model: reads payments (evidence: `backend/services/bookingManagementService.js`)
- Payment operations → Payment model: records payments (evidence: `backend/services/paymentService.js`)
- Payment operations → Booking model: updates bookings (evidence: `backend/services/paymentService.js`)
- Payment operations → Receipt email service: sends receipts (evidence: `backend/services/paymentService.js`)
- Service management → Service model: manages services
- Calendar operations → Blocked date model: manages blocks
- Dashboard metrics → Booking model: summarizes
- Booking management → Booking and payment rules: uses rules (evidence: `backend/services/bookingManagementService.js`)
- Payment operations → Booking and payment rules: uses rules (evidence: `backend/services/paymentService.js`)
