# wilsonkayke/frontbarber90- architecture

> Architecture diagram of the GitHub repository wilsonkayke/frontbarber90-, 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/wilsonkayke/frontbarber90-
- Repository: https://github.com/wilsonkayke/frontbarber90-

## Overview

This is a full-stack barbershop queue and appointment system. Customers register or sign in, book a service and barber, and view appointment/queue status; staff manage service order and complete appointments, while administrators manage operations and view reports. The graph includes documented reporting, barber, and service capabilities. Edges reflect shown imports, calls, or README statements; where source was not sampled, relationships are omitted or documented at the broader level rather than inferred.

Main entry points: [`backend/app/routes/admin_routes.py`](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/admin_routes.py) (Queue and Service Control), [`backend/app/main.py`](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/main.py) (API Router), [`backend/app/db/mongo_connection.py`](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/db/mongo_connection.py) (MongoDB), [`backend/app/routes/auth_routes.py`](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/auth_routes.py) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer and Staff UI"]
  node_web_signup["Registration<br/>[CadastroForms.jsx]"]
  node_web_login["Login<br/>[LoginForms.jsx]"]
  node_web_agenda["Appointment UI<br/>[page.jsx]"]
  node_web_queue["Queue UI<br/>[FilaForms.jsx]"]
  node_web_admin["Admin Dashboard<br/>[page.jsx]"]
  node_web_reports["Report Views<br/>[Relatorio.jsx]"]
end

subgraph group_api["FastAPI Application"]
  node_api_app["API Router<br/>[main.py]"]
  node_clients["Client API<br/>[client_routes.py]"]
  node_schemas["Request Schemas"]
  node_mongo[("MongoDB")]
end

subgraph group_identity["Identity and Access"]
  node_auth_routes["Authentication API<br/>[auth_routes.py]"]
  node_auth_guard["Token Access Checks<br/>[auth.py]"]
  node_jwt["JWT Utilities<br/>[jwt_handler.py]"]
end

subgraph group_operations["Appointments and Queue"]
  node_appointments["Appointment API"]
  node_queue_api["Queue and Service Control<br/>[admin_routes.py]"]
  node_barbers["Barber API<br/>[barbeiro_routes.py]"]
  node_services["Service API<br/>[servico_routes.py]"]
end

subgraph group_insights["Administration and Reports"]
  node_report_service["Report Aggregation"]
end

node_customer(("Customer"))
node_staff(("Barber / Admin"))

node_customer -->|"registers"| node_web_signup
node_customer -->|"signs in"| node_web_login
node_customer -->|"books"| node_web_agenda
node_customer -->|"views queue"| node_web_queue
node_staff -->|"manages service"| node_web_admin
node_web_agenda -->|"requests status and booking"| node_appointments
node_web_admin -->|"calls and completes"| node_queue_api
node_web_admin -->|"renders reports"| node_web_reports
node_api_app -->|"registers route"| node_clients
node_api_app -->|"registers route"| node_auth_routes
node_api_app -->|"registers route"| node_appointments
node_api_app -->|"registers route"| node_queue_api
node_api_app -->|"registers route"| node_services
node_api_app -->|"registers route"| node_barbers
node_clients -->|"reads and writes"| node_mongo
node_auth_routes -->|"reads and writes"| node_mongo
node_auth_routes -->|"creates and verifies tokens"| node_jwt
node_auth_routes -.->|"uses access checks"| node_auth_guard
node_appointments -->|"reads and writes"| node_mongo
node_appointments -->|"checks user"| node_auth_guard
node_queue_api -->|"reads and updates"| node_mongo
node_queue_api -->|"checks user"| node_auth_guard
node_barbers -->|"reads and writes"| node_mongo
node_services -->|"reads and writes"| node_mongo
node_appointments -->|"validates input"| node_schemas
node_clients -->|"validates input"| node_schemas
node_queue_api -->|"uses report aggregation"| node_report_service
node_report_service -->|"aggregates appointments"| node_mongo
node_web_queue -.->|"manages queue"| node_queue_api
node_web_signup -.->|"submits registration"| node_clients
node_web_login -.->|"submits credentials"| node_auth_routes
node_web_reports -.->|"requests reports"| node_queue_api

click node_web_signup "https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/Cadastro/CadastroForms.jsx"
click node_web_login "https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/Login/LoginForms.jsx"
click node_web_agenda "https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/app/agenda/page.jsx"
click node_web_queue "https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/Fila/FilaForms.jsx"
click node_web_admin "https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/app/admin/page.jsx"
click node_web_reports "https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/admin/Relatorio.jsx"
click node_api_app "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/main.py"
click node_clients "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/client_routes.py"
click node_auth_routes "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/auth_routes.py"
click node_auth_guard "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/dependencies/auth.py"
click node_jwt "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/utils/jwt_handler.py"
click node_appointments "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/agendamento_routes.py"
click node_queue_api "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/admin_routes.py"
click node_barbers "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/barbeiro_routes.py"
click node_services "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/servico_routes.py"
click node_schemas "https://github.com/wilsonkayke/frontbarber90-/tree/main/backend/app/schemas"
click node_report_service "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/services/relatorio_service.py"
click node_mongo "https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/db/mongo_connection.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_web_signup,node_web_login,node_web_agenda,node_web_queue,node_web_admin,node_web_reports toneBlue
class node_api_app,node_clients,node_schemas,node_mongo toneAmber
class node_auth_routes,node_auth_guard,node_jwt toneMint
class node_appointments,node_queue_api,node_barbers,node_services toneRose
class node_report_service,node_customer,node_staff toneIndigo
```

## Components

### Customer and Staff UI

- [Registration](https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/Cadastro/CadastroForms.jsx): `frontend/src/components/Cadastro/CadastroForms.jsx`
- [Login](https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/Login/LoginForms.jsx): `frontend/src/components/Login/LoginForms.jsx`
- [Appointment UI](https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/app/agenda/page.jsx): `frontend/src/app/agenda/page.jsx`
- [Queue UI](https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/Fila/FilaForms.jsx): `frontend/src/components/Fila/FilaForms.jsx`
- [Admin Dashboard](https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/app/admin/page.jsx): `frontend/src/app/admin/page.jsx`
- [Report Views](https://github.com/wilsonkayke/frontbarber90-/blob/main/frontend/src/components/admin/Relatorio.jsx): `frontend/src/components/admin/Relatorio.jsx`

### FastAPI Application

- [API Router](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/main.py): `backend/app/main.py`
- [Client API](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/client_routes.py): `backend/app/routes/client_routes.py`
- [Request Schemas](https://github.com/wilsonkayke/frontbarber90-/tree/main/backend/app/schemas): `backend/app/schemas`
- [MongoDB](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/db/mongo_connection.py): `backend/app/db/mongo_connection.py`

### Identity and Access

- [Authentication API](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/auth_routes.py): `backend/app/routes/auth_routes.py`
- [Token Access Checks](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/dependencies/auth.py): `backend/app/dependencies/auth.py`
- [JWT Utilities](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/utils/jwt_handler.py): `backend/app/utils/jwt_handler.py`

### Appointments and Queue

- [Appointment API](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/agendamento_routes.py): `backend/app/routes/agendamento_routes.py`
- [Queue and Service Control](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/admin_routes.py): `backend/app/routes/admin_routes.py`
- [Barber API](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/barbeiro_routes.py): `backend/app/routes/barbeiro_routes.py`
- [Service API](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/routes/servico_routes.py): `backend/app/routes/servico_routes.py`

### Administration and Reports

- [Report Aggregation](https://github.com/wilsonkayke/frontbarber90-/blob/main/backend/app/services/relatorio_service.py): `backend/app/services/relatorio_service.py`

### Other components

- **Customer**
- **Barber / Admin**

## Connections

- Customer → Registration: registers (evidence: `README.md`)
- Customer → Login: signs in (evidence: `README.md`)
- Customer → Appointment UI: books (evidence: `README.md`)
- Customer → Queue UI: views queue (evidence: `README.md`)
- Barber / Admin → Admin Dashboard: manages service (evidence: `README.md`)
- Appointment UI → Appointment API: requests status and booking (evidence: `frontend/src/app/agenda/page.jsx`)
- Admin Dashboard → Queue and Service Control: calls and completes (evidence: `frontend/src/app/admin/page.jsx`)
- Admin Dashboard → Report Views: renders reports
- API Router → Client API: registers route (evidence: `backend/app/main.py`)
- API Router → Authentication API: registers route (evidence: `backend/app/main.py`)
- API Router → Appointment API: registers route (evidence: `backend/app/main.py`)
- API Router → Queue and Service Control: registers route (evidence: `backend/app/main.py`)
- API Router → Service API: registers route (evidence: `backend/app/main.py`)
- API Router → Barber API: registers route (evidence: `backend/app/main.py`)
- Client API → MongoDB: reads and writes (evidence: `backend/app/routes/client_routes.py`)
- Authentication API → MongoDB: reads and writes (evidence: `backend/app/routes/auth_routes.py`)
- Authentication API → JWT Utilities: creates and verifies tokens (evidence: `backend/app/routes/auth_routes.py`)
- Authentication API → Token Access Checks: uses access checks
- Appointment API → MongoDB: reads and writes (evidence: `backend/app/routes/agendamento_routes.py`)
- Appointment API → Token Access Checks: checks user (evidence: `backend/app/routes/agendamento_routes.py`)
- Queue and Service Control → MongoDB: reads and updates (evidence: `backend/app/routes/admin_routes.py`)
- Queue and Service Control → Token Access Checks: checks user (evidence: `backend/app/routes/admin_routes.py`)
- Barber API → MongoDB: reads and writes (evidence: `backend/app/routes/barbeiro_routes.py`)
- Service API → MongoDB: reads and writes (evidence: `backend/app/routes/servico_routes.py`)
- Appointment API → Request Schemas: validates input (evidence: `backend/app/routes/agendamento_routes.py`)
- Client API → Request Schemas: validates input (evidence: `backend/app/routes/client_routes.py`)
- Queue and Service Control → Report Aggregation: uses report aggregation (evidence: `backend/app/routes/admin_routes.py`)
- Report Aggregation → MongoDB: aggregates appointments (evidence: `backend/app/services/relatorio_service.py`)
- Queue UI → Queue and Service Control: manages queue
- Registration → Client API: submits registration
- Login → Authentication API: submits credentials
- Report Views → Queue and Service Control: requests reports
