# luan-h/multiagenda architecture

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

- Interactive diagram: https://gitdiagram.com/luan-h/multiagenda
- Repository: https://github.com/luan-h/multiagenda

## Overview

MultiAgenda is a Django-based, multi-company appointment-management system backed by PostgreSQL and raw SQL. Staff or clients enter through routed views; the system manages accounts, professionals, clients and services, then displays and saves appointments against professional availability. The documented agenda engine generates 30-minute slots for 30 days from each professional’s weekly schedule. The graph separates request handling from domain models and storage. Evidence is strongest for the sampled views, model relationships and URL routing; unsampled implementation details are not inferred.

Main entry points: [`multiagenda/urls.py`](https://github.com/luan-h/multiagenda/blob/main/multiagenda/urls.py) (URL routing), [`empresa/models.py`](https://github.com/luan-h/multiagenda/blob/main/empresa/models.py) (Company records), [`agenda/models.py`](https://github.com/luan-h/multiagenda/blob/main/agenda/models.py) (Agenda slots), [`profissional/views.py`](https://github.com/luan-h/multiagenda/blob/main/profissional/views.py) (Professional management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_routes["URL routing<br/>[urls.py]"]
  node_accounts["Accounts and access<br/>[views.py]"]
  node_professionals["Professional management<br/>[views.py]"]
  node_clients["Client management<br/>[views.py]"]
  node_services["Service management<br/>[views.py]"]
  node_bookings["Appointment workflow<br/>[views.py]"]
end

subgraph group_domain["Business domains"]
  node_companydata["Company records<br/>[models.py]"]
  node_userrecords["User records<br/>[models.py]"]
  node_professionalrecords["Professional records<br/>[models.py]"]
  node_clientrecords["Client records<br/>[models.py]"]
  node_servicerecords["Service records<br/>[models.py]"]
  node_bookingrecords["Appointment records<br/>[models.py]"]
  node_availability["Agenda slots<br/>[models.py]"]
  node_imagerecords["Image records<br/>[models.py]"]
end

subgraph group_data["Domain models"]
end

subgraph group_storage["Persistence"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Staff or client"))

node_visitor -.->|"opens"| node_routes
node_routes -->|"routes requests"| node_accounts
node_routes -->|"routes requests"| node_professionals
node_routes -->|"routes requests"| node_clients
node_routes -->|"routes requests"| node_services
node_routes -->|"routes requests"| node_bookings
node_accounts -->|"queries and updates"| node_postgres
node_professionals -->|"queries and updates"| node_postgres
node_clients -->|"queries and updates"| node_postgres
node_services -->|"queries and updates"| node_postgres
node_bookings -->|"reads and saves"| node_postgres
node_professionals -->|"generates slots"| node_availability
node_availability -.->|"stores availability"| node_postgres
node_companydata -.->|"maps table"| node_postgres
node_userrecords -.->|"belongs to"| node_companydata
node_professionalrecords -->|"belongs to"| node_companydata
node_clientrecords -->|"belongs to"| node_companydata
node_servicerecords -->|"belongs to"| node_companydata
node_bookingrecords -->|"references service"| node_servicerecords
node_bookingrecords -->|"references client"| node_clientrecords
node_availability -->|"references professional"| node_professionalrecords
node_availability -->|"references appointment"| node_bookingrecords
node_imagerecords -.->|"references client"| node_clientrecords

click node_routes "https://github.com/luan-h/multiagenda/blob/main/multiagenda/urls.py"
click node_accounts "https://github.com/luan-h/multiagenda/blob/main/usuario/views.py"
click node_professionals "https://github.com/luan-h/multiagenda/blob/main/profissional/views.py"
click node_clients "https://github.com/luan-h/multiagenda/blob/main/cliente/views.py"
click node_services "https://github.com/luan-h/multiagenda/blob/main/servico/views.py"
click node_bookings "https://github.com/luan-h/multiagenda/blob/main/agendamento/views.py"
click node_companydata "https://github.com/luan-h/multiagenda/blob/main/empresa/models.py"
click node_userrecords "https://github.com/luan-h/multiagenda/blob/main/usuario/models.py"
click node_professionalrecords "https://github.com/luan-h/multiagenda/blob/main/profissional/models.py"
click node_clientrecords "https://github.com/luan-h/multiagenda/blob/main/cliente/models.py"
click node_servicerecords "https://github.com/luan-h/multiagenda/blob/main/servico/models.py"
click node_bookingrecords "https://github.com/luan-h/multiagenda/blob/main/agendamento/models.py"
click node_availability "https://github.com/luan-h/multiagenda/blob/main/agenda/models.py"
click node_imagerecords "https://github.com/luan-h/multiagenda/blob/main/imagem/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_routes,node_accounts,node_professionals,node_clients,node_services,node_bookings,node_visitor toneBlue
class node_companydata,node_userrecords,node_professionalrecords,node_clientrecords,node_servicerecords,node_bookingrecords,node_availability,node_imagerecords toneAmber
class node_postgres toneRose
```

## Components

### Web workflows

- [URL routing](https://github.com/luan-h/multiagenda/blob/main/multiagenda/urls.py): `multiagenda/urls.py`
- [Accounts and access](https://github.com/luan-h/multiagenda/blob/main/usuario/views.py): `usuario/views.py`
- [Professional management](https://github.com/luan-h/multiagenda/blob/main/profissional/views.py): `profissional/views.py`
- [Client management](https://github.com/luan-h/multiagenda/blob/main/cliente/views.py): `cliente/views.py`
- [Service management](https://github.com/luan-h/multiagenda/blob/main/servico/views.py): `servico/views.py`
- [Appointment workflow](https://github.com/luan-h/multiagenda/blob/main/agendamento/views.py): `agendamento/views.py`

### Business domains

- [Company records](https://github.com/luan-h/multiagenda/blob/main/empresa/models.py): `empresa/models.py`
- [User records](https://github.com/luan-h/multiagenda/blob/main/usuario/models.py): `usuario/models.py`
- [Professional records](https://github.com/luan-h/multiagenda/blob/main/profissional/models.py): `profissional/models.py`
- [Client records](https://github.com/luan-h/multiagenda/blob/main/cliente/models.py): `cliente/models.py`
- [Service records](https://github.com/luan-h/multiagenda/blob/main/servico/models.py): `servico/models.py`
- [Appointment records](https://github.com/luan-h/multiagenda/blob/main/agendamento/models.py): `agendamento/models.py`
- [Agenda slots](https://github.com/luan-h/multiagenda/blob/main/agenda/models.py): `agenda/models.py`
- [Image records](https://github.com/luan-h/multiagenda/blob/main/imagem/models.py): `imagem/models.py`

### Persistence

- **PostgreSQL**

### Other components

- **Staff or client**

## Connections

- Staff or client → URL routing: opens
- URL routing → Accounts and access: routes requests (evidence: `multiagenda/urls.py`)
- URL routing → Professional management: routes requests (evidence: `multiagenda/urls.py`)
- URL routing → Client management: routes requests (evidence: `multiagenda/urls.py`)
- URL routing → Service management: routes requests (evidence: `multiagenda/urls.py`)
- URL routing → Appointment workflow: routes requests (evidence: `multiagenda/urls.py`)
- Accounts and access → PostgreSQL: queries and updates (evidence: `usuario/views.py`)
- Professional management → PostgreSQL: queries and updates (evidence: `profissional/views.py`)
- Client management → PostgreSQL: queries and updates (evidence: `cliente/views.py`)
- Service management → PostgreSQL: queries and updates (evidence: `servico/views.py`)
- Appointment workflow → PostgreSQL: reads and saves (evidence: `agendamento/views.py`)
- Professional management → Agenda slots: generates slots (evidence: `profissional/views.py`)
- Agenda slots → PostgreSQL: stores availability
- Company records → PostgreSQL: maps table
- User records → Company records: belongs to (evidence: `usuario/models.py`)
- Professional records → Company records: belongs to (evidence: `profissional/models.py`)
- Client records → Company records: belongs to (evidence: `cliente/models.py`)
- Service records → Company records: belongs to (evidence: `servico/models.py`)
- Appointment records → Service records: references service (evidence: `agendamento/models.py`)
- Appointment records → Client records: references client (evidence: `agendamento/models.py`)
- Agenda slots → Professional records: references professional (evidence: `agenda/models.py`)
- Agenda slots → Appointment records: references appointment (evidence: `agenda/models.py`)
- Image records → Client records: references client (evidence: `imagem/models.py`)
