# dayspot-organization/dayspot architecture

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

- Interactive diagram: https://gitdiagram.com/dayspot-organization/dayspot
- Repository: https://github.com/dayspot-organization/dayspot

## Overview

Dayspot is a multi-tenant scheduling platform for small businesses. A customer books without an account through a company’s public page: the Angular screen requests public company, service, provider, and availability data, then submits a booking to the API. Staff use the authenticated panel to manage appointments and clients; organization access is isolated with PostgreSQL row-level security. The map also includes signup/login and the shared API/data layer. Several frontend screens and API handlers were not excerpted, so their links are limited to documented routes and source-index references; WhatsApp notifications are planned, not implemented.

Main entry points: [`src/Api/Dados/AppDb.cs`](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/AppDb.cs) (Data access), [`web/src/app/app.routes.ts`](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/app.routes.ts) (Frontend routes), [`web/src/app/api/index.ts`](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/api/index.ts) (API client), [`src/Api/Rotas.cs`](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Rotas.cs) (API routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_public_booking["Public booking<br/>[agendar.ts]"]
  node_staff_agenda["Appointment agenda<br/>[agendamentos.ts]"]
  node_new_appointment["New appointment"]
  node_signup_screen["Signup screen<br/>[cadastro.ts]"]
  node_login_screen["Login screen<br/>[entrar.ts]"]
  node_panel_layout["Panel layout<br/>[layout.ts]"]
  node_routes["Frontend routes<br/>[app.routes.ts]"]
  node_api_client["API client<br/>[index.ts]"]
  node_http_layer["HTTP and errors<br/>[http.ts]"]
end

subgraph group_api["API workflows"]
  node_api_routes["API routing<br/>[Rotas.cs]"]
  node_public_api["Public booking API<br/>[Publico.cs]"]
  node_appointments_api["Appointments API<br/>[Agendamentos.cs]"]
  node_clients_api["Clients API<br/>[Clientes.cs]"]
end

subgraph group_identity["Identity and tenancy"]
  node_signup_api["Signup workflow<br/>[Cadastro.cs]"]
  node_login_api["Login and sessions<br/>[Login.cs]"]
  node_auth_middleware["Session authentication<br/>[Autenticacao.cs]"]
  node_tenant_context["Tenant context<br/>[AppDb.cs]"]
end

subgraph group_data["Persistence"]
  node_db_access["Data access<br/>[AppDb.cs]"]
  node_query_helpers["Domain queries<br/>[Consultas.cs]"]
  node_postgres[("PostgreSQL")]
end

node_customer(("Customer"))
node_staff(("Business staff"))
node_whatsapp{{"WhatsApp provider"}}

node_customer -->|"opens page"| node_public_booking
node_public_booking -->|"requests availability"| node_api_client
node_public_booking -->|"submits booking"| node_api_client
node_staff -->|"signs in"| node_login_screen
node_staff -->|"manages schedule"| node_staff_agenda
node_staff_agenda -->|"loads appointments"| node_api_client
node_new_appointment -->|"creates appointment"| node_api_client
node_signup_screen -->|"submits signup"| node_api_client
node_login_screen -->|"sends credentials"| node_api_client
node_api_client -->|"uses HTTP errors"| node_http_layer
node_routes -->|"routes public page"| node_public_booking
node_routes -->|"routes panel"| node_staff_agenda
node_routes -->|"routes creation"| node_new_appointment
node_routes -->|"routes signup"| node_signup_screen
node_routes -->|"routes login"| node_login_screen
node_routes -->|"wraps panel"| node_panel_layout
node_api_routes -->|"dispatches public"| node_public_api
node_api_routes -->|"dispatches appointments"| node_appointments_api
node_api_routes -->|"dispatches clients"| node_clients_api
node_api_routes -->|"dispatches signup"| node_signup_api
node_api_routes -->|"dispatches login"| node_login_api
node_public_api -->|"reads and books"| node_db_access
node_appointments_api -->|"reads and creates"| node_db_access
node_clients_api -->|"lists and creates"| node_db_access
node_signup_api -->|"opens session"| node_login_api
node_login_api -->|"checks user session"| node_db_access
node_auth_middleware -->|"checks session"| node_db_access
node_tenant_context -->|"sets tenant scope"| node_postgres
node_db_access -->|"queries and writes"| node_postgres
node_db_access -->|"delegates queries"| node_query_helpers
node_whatsapp -.-> node_public_api

click node_public_booking "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/agendar/agendar.ts"
click node_staff_agenda "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/agendamentos/agendamentos.ts"
click node_new_appointment "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/novo-agendamento/novo-agendamento.ts"
click node_signup_screen "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/cadastro/cadastro.ts"
click node_login_screen "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/entrar/entrar.ts"
click node_panel_layout "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/layout.ts"
click node_routes "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/app.routes.ts"
click node_api_client "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/api/index.ts"
click node_http_layer "https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/api/http.ts"
click node_api_routes "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Rotas.cs"
click node_public_api "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Publico.cs"
click node_appointments_api "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Agendamentos.cs"
click node_clients_api "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Clientes.cs"
click node_signup_api "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Cadastro.cs"
click node_login_api "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Login.cs"
click node_auth_middleware "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Autenticacao.cs"
click node_tenant_context "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/AppDb.cs"
click node_db_access "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/AppDb.cs"
click node_query_helpers "https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/Consultas.cs"

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_public_booking,node_staff_agenda,node_new_appointment,node_signup_screen,node_login_screen,node_panel_layout,node_routes,node_api_client,node_http_layer toneBlue
class node_api_routes,node_public_api,node_appointments_api,node_clients_api toneAmber
class node_signup_api,node_login_api,node_auth_middleware,node_tenant_context toneMint
class node_db_access,node_query_helpers,node_postgres toneRose
class node_customer,node_staff,node_whatsapp toneIndigo
```

## Components

### Web experience

- [Public booking](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/agendar/agendar.ts): `web/src/app/agendar/agendar.ts`
- [Appointment agenda](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/agendamentos/agendamentos.ts): `web/src/app/agendamentos/agendamentos.ts`
- [New appointment](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/novo-agendamento/novo-agendamento.ts): `web/src/app/novo-agendamento/novo-agendamento.ts`
- [Signup screen](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/cadastro/cadastro.ts): `web/src/app/cadastro/cadastro.ts`
- [Login screen](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/entrar/entrar.ts): `web/src/app/entrar/entrar.ts`
- [Panel layout](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/layout.ts): `web/src/app/layout.ts`
- [Frontend routes](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/app.routes.ts): `web/src/app/app.routes.ts`
- [API client](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/api/index.ts): `web/src/app/api/index.ts`
- [HTTP and errors](https://github.com/dayspot-organization/dayspot/blob/main/web/src/app/api/http.ts): `web/src/app/api/http.ts`

### API workflows

- [API routing](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Rotas.cs): `src/Api/Rotas.cs`
- [Public booking API](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Publico.cs): `src/Api/Publico.cs`
- [Appointments API](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Agendamentos.cs): `src/Api/Agendamentos.cs`
- [Clients API](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Clientes.cs): `src/Api/Clientes.cs`

### Identity and tenancy

- [Signup workflow](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Cadastro.cs): `src/Api/Cadastro.cs`
- [Login and sessions](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Login.cs): `src/Api/Login.cs`
- [Session authentication](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Autenticacao.cs): `src/Api/Autenticacao.cs`
- [Tenant context](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/AppDb.cs): `src/Api/Dados/AppDb.cs`

### Persistence

- [Data access](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/AppDb.cs): `src/Api/Dados/AppDb.cs`
- [Domain queries](https://github.com/dayspot-organization/dayspot/blob/main/src/Api/Dados/Consultas.cs): `src/Api/Dados/Consultas.cs`
- **PostgreSQL**

### Other components

- **Customer**
- **Business staff**
- **WhatsApp provider**

## Connections

- Customer → Public booking: opens page (evidence: `README.md`)
- Public booking → API client: requests availability (evidence: `web/src/app/agendar/agendar.ts`)
- Public booking → API client: submits booking (evidence: `web/src/app/agendar/agendar.ts`)
- Business staff → Login screen: signs in (evidence: `README.md`)
- Business staff → Appointment agenda: manages schedule (evidence: `README.md`)
- Appointment agenda → API client: loads appointments (evidence: `web/src/app/agendamentos/agendamentos.ts`)
- New appointment → API client: creates appointment (evidence: `web/src/app/novo-agendamento/novo-agendamento.ts`)
- Signup screen → API client: submits signup (evidence: `web/src/app/cadastro/cadastro.ts`)
- Login screen → API client: sends credentials (evidence: `web/src/app/entrar/entrar.ts`)
- API client → HTTP and errors: uses HTTP errors (evidence: `web/src/app/api/index.ts`)
- Frontend routes → Public booking: routes public page (evidence: `web/src/app/app.routes.ts`)
- Frontend routes → Appointment agenda: routes panel (evidence: `web/src/app/app.routes.ts`)
- Frontend routes → New appointment: routes creation (evidence: `web/src/app/app.routes.ts`)
- Frontend routes → Signup screen: routes signup (evidence: `web/src/app/app.routes.ts`)
- Frontend routes → Login screen: routes login (evidence: `web/src/app/app.routes.ts`)
- Frontend routes → Panel layout: wraps panel (evidence: `web/src/app/app.routes.ts`)
- API routing → Public booking API: dispatches public (evidence: `src/Api/Rotas.cs`)
- API routing → Appointments API: dispatches appointments (evidence: `src/Api/Rotas.cs`)
- API routing → Clients API: dispatches clients (evidence: `src/Api/Rotas.cs`)
- API routing → Signup workflow: dispatches signup (evidence: `src/Api/Rotas.cs`)
- API routing → Login and sessions: dispatches login (evidence: `src/Api/Rotas.cs`)
- Public booking API → Data access: reads and books (evidence: `src/Api/Publico.cs`)
- Appointments API → Data access: reads and creates (evidence: `src/Api/Agendamentos.cs`)
- Clients API → Data access: lists and creates (evidence: `src/Api/Clientes.cs`)
- Signup workflow → Login and sessions: opens session (evidence: `src/Api/Cadastro.cs`)
- Login and sessions → Data access: checks user session (evidence: `src/Api/Login.cs`)
- Session authentication → Data access: checks session (evidence: `src/Api/Autenticacao.cs`)
- Tenant context → PostgreSQL: sets tenant scope (evidence: `src/Api/Dados/AppDb.cs`)
- Data access → PostgreSQL: queries and writes (evidence: `src/Api/Dados/AppDb.cs`)
- Data access → Domain queries: delegates queries (evidence: `src/Api/Dados/AppDb.cs`)
- WhatsApp provider → Public booking API
