# gustavoresendedev/v2.atividadeescolar architecture

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

- Interactive diagram: https://gitdiagram.com/gustavoresendedev/v2.atividadeescolar
- Repository: https://github.com/gustavoresendedev/v2.atividadeescolar

## Overview

Nova Era Barbearia is a web-based barbershop booking system: customers browse the site and book a service, while staff sign in to manage appointments. The graph follows the public booking and staff-management workflows through the API, business rules, and SQLite, and includes shared scheduling rules, authentication, and privacy maintenance. README capabilities not visible in the excerpts are represented at their supported module paths; links are limited to documented or excerpted relationships, so some UI-to-API details remain unshown.

Main entry points: [`server/app.js`](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/app.js) (HTTP app and API), [`server/index.js`](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/index.js) (Server runtime), [`server/db.js`](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/db.js) (SQLite store), [`server/agenda.js`](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/agenda.js) (Appointment rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_site["Barbershop site<br/>[index.html]"]
  node_booking["Online booking<br/>[agendamento.js]"]
  node_privacy["Privacy policy<br/>[privacidade.html]"]
  node_stafflogin["Staff login<br/>[login.js]"]
  node_staffpanel["Agenda panel<br/>[painel.js]"]
end

subgraph group_service["Application service"]
  node_http["HTTP app and API<br/>[app.js]"]
  node_runtime["Server runtime<br/>[index.js]"]
  node_config["Runtime config<br/>[config.js]"]
end

subgraph group_domain["Scheduling domain"]
  node_sharedrules["Opening rules<br/>[regras.js]"]
  node_agenda["Appointment rules<br/>[agenda.js]"]
end

subgraph group_persistence["Data and identity"]
  node_auth["Session security<br/>[auth.js]"]
  node_users["Staff accounts<br/>[usuarios.js]"]
  node_database[("SQLite store<br/>[db.js]")]
end

node_customers(("Customer"))
node_staff(("Barber / admin"))

node_customers -->|"visits"| node_site
node_customers -->|"books through"| node_booking
node_customers -->|"reads"| node_privacy
node_staff -->|"signs in"| node_stafflogin
node_staff -->|"manages agenda"| node_staffpanel
node_booking -.->|"uses API"| node_http
node_stafflogin -.->|"uses API"| node_http
node_staffpanel -->|"calls API"| node_http
node_runtime -->|"loads"| node_config
node_runtime -->|"opens"| node_database
node_runtime -->|"initializes"| node_users
node_runtime -->|"creates"| node_http
node_runtime -->|"runs retention"| node_agenda
node_http -->|"dispatches booking"| node_agenda
node_http -->|"authenticates"| node_auth
node_http -->|"serves static files"| node_database
node_agenda -->|"uses calendar rules"| node_sharedrules
node_agenda -->|"reads and writes"| node_database
node_auth -->|"stores sessions"| node_database
node_users -->|"hashes passwords"| node_auth
node_users -->|"persists accounts"| node_database
node_http -.->|"serves pages"| node_site

click node_site "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/index.html"
click node_booking "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/agendamento.js"
click node_privacy "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/privacidade.html"
click node_stafflogin "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/login.js"
click node_staffpanel "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/painel.js"
click node_sharedrules "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/regras.js"
click node_http "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/app.js"
click node_runtime "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/index.js"
click node_agenda "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/agenda.js"
click node_auth "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/auth.js"
click node_users "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/usuarios.js"
click node_database "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/db.js"
click node_config "https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/config.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_site,node_booking,node_privacy,node_stafflogin,node_staffpanel toneBlue
class node_http,node_runtime,node_config toneAmber
class node_sharedrules,node_agenda toneMint
class node_auth,node_users,node_database toneRose
class node_customers,node_staff toneIndigo
```

## Components

### Web experience

- [Barbershop site](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/index.html): `public/index.html`
- [Online booking](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/agendamento.js): `public/js/agendamento.js`
- [Privacy policy](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/privacidade.html): `public/privacidade.html`
- [Staff login](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/login.js): `public/js/login.js`
- [Agenda panel](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/painel.js): `public/js/painel.js`

### Application service

- [HTTP app and API](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/app.js): `server/app.js`
- [Server runtime](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/index.js): `server/index.js`
- [Runtime config](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/config.js): `server/config.js`

### Scheduling domain

- [Opening rules](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/public/js/regras.js): `public/js/regras.js`
- [Appointment rules](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/agenda.js): `server/agenda.js`

### Data and identity

- [Session security](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/auth.js): `server/auth.js`
- [Staff accounts](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/usuarios.js): `server/usuarios.js`
- [SQLite store](https://github.com/gustavoresendedev/v2.atividadeescolar/blob/main/server/db.js): `server/db.js`

### Other components

- **Customer**
- **Barber / admin**

## Connections

- Customer → Barbershop site: visits (evidence: `README.md`)
- Customer → Online booking: books through (evidence: `README.md`)
- Customer → Privacy policy: reads (evidence: `README.md`)
- Barber / admin → Staff login: signs in (evidence: `README.md`)
- Barber / admin → Agenda panel: manages agenda (evidence: `README.md`)
- Online booking → HTTP app and API: uses API
- Staff login → HTTP app and API: uses API
- Agenda panel → HTTP app and API: calls API (evidence: `public/js/painel.js`)
- Server runtime → Runtime config: loads (evidence: `server/index.js`)
- Server runtime → SQLite store: opens (evidence: `server/index.js`)
- Server runtime → Staff accounts: initializes (evidence: `server/index.js`)
- Server runtime → HTTP app and API: creates (evidence: `server/index.js`)
- Server runtime → Appointment rules: runs retention (evidence: `server/index.js`)
- HTTP app and API → Appointment rules: dispatches booking (evidence: `server/app.js`)
- HTTP app and API → Session security: authenticates (evidence: `server/app.js`)
- HTTP app and API → SQLite store: serves static files (evidence: `server/app.js`)
- Appointment rules → Opening rules: uses calendar rules (evidence: `server/agenda.js`)
- Appointment rules → SQLite store: reads and writes (evidence: `server/agenda.js`)
- Session security → SQLite store: stores sessions (evidence: `server/auth.js`)
- Staff accounts → Session security: hashes passwords (evidence: `server/usuarios.js`)
- Staff accounts → SQLite store: persists accounts (evidence: `server/usuarios.js`)
- HTTP app and API → Barbershop site: serves pages
