# sebast1023/barber_shop architecture

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

- Interactive diagram: https://gitdiagram.com/sebast1023/barber_shop
- Repository: https://github.com/sebast1023/barber_shop

## Overview

Barber Shop is a role-based barber-shop management system: customers book appointments and shop for products, while staff manage schedules, walk-in service, inventory, sales, and reporting. The principal booking flow selects a service, barber, date, and available time before submitting a reservation to the REST API and PostgreSQL-backed domain models. The README documents additional role capabilities; several frontend modules and backend handlers were not sampled, so those connections are shown only where documented or directly evidenced.

Main entry points: [`backend/barberia/views.py`](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py) (API handlers), [`frontend/js/agenda.js`](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/agenda.js) (Appointment booking), [`backend/barberia/models.py`](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/models.py) (Domain models), [`backend/barberia/serializers.py`](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/serializers.py) (JSON serializers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer experience"]
  node_client_auth["Account access<br/>[auth.js]"]
  node_booking["Appointment booking<br/>[agenda.js]"]
  node_client_records["Client records<br/>[perfil.js]"]
  node_shop["Product shopping<br/>[tienda.js]"]
end

subgraph group_staff["Staff operations"]
  node_barber_panel["Barber schedule<br/>[barbero.js]"]
  node_reception_panel["Reception desk<br/>[recepcion.js]"]
  node_admin_panel["Administration<br/>[admin.js]"]
  node_analytics_panel["Analytics panel<br/>[reportes.js]"]
end

subgraph group_api["REST API"]
  node_api_routes["API routing<br/>[urls.py]"]
  node_api_views["API handlers<br/>[views.py]"]
  node_serializers["JSON serializers<br/>[serializers.py]"]
end

subgraph group_domain["Business domains"]
  node_accounts["Accounts and roles<br/>[views.py]"]
  node_appointments["Appointments<br/>[views.py]"]
  node_catalog["Services and barbers<br/>[views.py]"]
  node_inventory["Products and stock<br/>[views.py]"]
  node_sales["Sales and pickup<br/>[views.py]"]
  node_staff_admin["Staff administration<br/>[views.py]"]
  node_reports["Financial reports<br/>[views.py]"]
end

subgraph group_storage["Persistence"]
  node_models["Domain models<br/>[models.py]"]
  node_postgres[("PostgreSQL")]
end

node_customer(("Customer"))

node_customer -.->|"selects booking"| node_booking
node_booking -->|"submits reservation"| node_api_views
node_booking -->|"loads availability"| node_api_views
node_client_auth -->|"sends account requests"| node_api_views
node_reception_panel -->|"submits desk actions"| node_api_views
node_admin_panel -->|"manages resources"| node_api_views
node_barber_panel -.->|"requests schedule"| node_api_views
node_client_records -.->|"requests profile"| node_api_views
node_shop -.->|"requests products"| node_api_views
node_analytics_panel -.->|"requests reports"| node_api_views
node_api_routes -->|"routes endpoints"| node_api_views
node_api_views -->|"uses serializers"| node_serializers
node_api_views -->|"queries domain data"| node_models
node_api_views -->|"handles account actions"| node_accounts
node_api_views -->|"handles reservations"| node_appointments
node_api_views -->|"handles catalog"| node_catalog
node_api_views -->|"handles stock"| node_inventory
node_api_views -->|"handles sales"| node_sales
node_api_views -->|"handles employees"| node_staff_admin
node_api_views -->|"handles reporting"| node_reports
node_serializers -->|"serializes models"| node_models
node_models -->|"maps database tables"| node_postgres

click node_client_auth "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/auth.js"
click node_booking "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/agenda.js"
click node_client_records "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/perfil.js"
click node_shop "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/tienda.js"
click node_barber_panel "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/barbero.js"
click node_reception_panel "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/recepcion.js"
click node_admin_panel "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/admin.js"
click node_analytics_panel "https://github.com/sebast1023/barber_shop/blob/main/frontend/js/reportes.js"
click node_api_routes "https://github.com/sebast1023/barber_shop/blob/main/backend/core/urls.py"
click node_api_views "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_serializers "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/serializers.py"
click node_accounts "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_appointments "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_catalog "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_inventory "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_sales "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_staff_admin "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_reports "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py"
click node_models "https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/models.py"

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_client_auth,node_booking,node_client_records,node_shop toneBlue
class node_barber_panel,node_reception_panel,node_admin_panel,node_analytics_panel toneAmber
class node_api_routes,node_api_views,node_serializers toneMint
class node_accounts,node_appointments,node_catalog,node_inventory,node_sales,node_staff_admin,node_reports toneRose
class node_models,node_postgres,node_customer toneIndigo
```

## Components

### Customer experience

- [Account access](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Appointment booking](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/agenda.js): `frontend/js/agenda.js`
- [Client records](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/perfil.js): `frontend/js/perfil.js`
- [Product shopping](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/tienda.js): `frontend/js/tienda.js`

### Staff operations

- [Barber schedule](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/barbero.js): `frontend/js/barbero.js`
- [Reception desk](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/recepcion.js): `frontend/js/recepcion.js`
- [Administration](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/admin.js): `frontend/js/admin.js`
- [Analytics panel](https://github.com/sebast1023/barber_shop/blob/main/frontend/js/reportes.js): `frontend/js/reportes.js`

### REST API

- [API routing](https://github.com/sebast1023/barber_shop/blob/main/backend/core/urls.py): `backend/core/urls.py`
- [API handlers](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [JSON serializers](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/serializers.py): `backend/barberia/serializers.py`

### Business domains

- [Accounts and roles](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [Appointments](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [Services and barbers](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [Products and stock](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [Sales and pickup](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [Staff administration](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`
- [Financial reports](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/views.py): `backend/barberia/views.py`

### Persistence

- [Domain models](https://github.com/sebast1023/barber_shop/blob/main/backend/barberia/models.py): `backend/barberia/models.py`
- **PostgreSQL**

### Other components

- **Customer**

## Connections

- Customer → Appointment booking: selects booking (evidence: `README.md`)
- Appointment booking → API handlers: submits reservation (evidence: `frontend/js/agenda.js`)
- Appointment booking → API handlers: loads availability (evidence: `frontend/js/agenda.js`)
- Account access → API handlers: sends account requests (evidence: `frontend/js/auth.js`)
- Reception desk → API handlers: submits desk actions (evidence: `frontend/js/recepcion.js`)
- Administration → API handlers: manages resources (evidence: `frontend/js/admin.js`)
- Barber schedule → API handlers: requests schedule
- Client records → API handlers: requests profile
- Product shopping → API handlers: requests products
- Analytics panel → API handlers: requests reports
- API routing → API handlers: routes endpoints (evidence: `backend/core/urls.py`)
- API handlers → JSON serializers: uses serializers (evidence: `backend/barberia/views.py`)
- API handlers → Domain models: queries domain data (evidence: `backend/barberia/views.py`)
- API handlers → Accounts and roles: handles account actions (evidence: `backend/core/urls.py`)
- API handlers → Appointments: handles reservations (evidence: `backend/core/urls.py`)
- API handlers → Services and barbers: handles catalog (evidence: `backend/core/urls.py`)
- API handlers → Products and stock: handles stock (evidence: `backend/core/urls.py`)
- API handlers → Sales and pickup: handles sales (evidence: `backend/core/urls.py`)
- API handlers → Staff administration: handles employees (evidence: `backend/core/urls.py`)
- API handlers → Financial reports: handles reporting (evidence: `backend/core/urls.py`)
- JSON serializers → Domain models: serializes models (evidence: `backend/barberia/serializers.py`)
- Domain models → PostgreSQL: maps database tables (evidence: `backend/barberia/models.py`)
