# guilhermelleiteads/sga architecture

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

- Interactive diagram: https://gitdiagram.com/guilhermelleiteads/sga
- Repository: https://github.com/guilhermelleiteads/sga

## Overview

This is a web-based academic and facilities operations system: staff manage classes, teachers, room requests and allocations, while users submit maintenance suggestions and staff track their status. The browser app routes users to these workflows and reports; frontend requests pass through a shared fetch helper to an Express API, whose domain routes delegate to services backed by Supabase. The graph preserves the documented-by-code feature areas, but some frontend-to-endpoint and database relationships are omitted where the supplied excerpts do not show the specific wiring.

Main entry points: [`font_end/src/App.js`](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/App.js) (Page router), [`beck_end/src/routes/index.js`](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/index.js) (API route registry), [`font_end/src/api.js`](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/api.js) (Fetch client), [`beck_end/src/config/supabase.js`](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/config/supabase.js) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["Page router<br/>[App.js]"]
  node_home["Operations home<br/>[Home.js]"]
  node_login["Login<br/>[Login.js]"]
  node_maintenance["Maintenance suggestions"]
  node_maintenance_reports["Maintenance report"]
  node_maintenance_dispatch["Maintenance dispatch"]
  node_room_request["Room requests"]
  node_class_teacher["Class and teacher setup"]
  node_lesson_assignment["Lesson assignment"]
  node_room_allocation["Room allocation"]
  node_reports["Report navigation<br/>[Relatorio.js]"]
  node_allocation_report["Allocation report"]
  node_room_report["Room report"]
  node_class_report["Class report"]
  node_api_client["Fetch client<br/>[api.js]"]
end

subgraph group_api["API and services"]
  node_express_app["Express API<br/>[app.js]"]
  node_api_routes["API route registry<br/>[index.js]"]
  node_maintenance_routes["Maintenance routes"]
  node_maintenance_service["Maintenance service"]
  node_class_routes["Class routes<br/>[turmasRoutes.js]"]
  node_class_service["Class service<br/>[turmasService.js]"]
  node_teacher_routes["Teacher routes<br/>[docentesRoutes.js]"]
  node_room_routes["Room routes<br/>[ambientesRoutes.js]"]
  node_assignment_routes["Assignment routes"]
  node_allocation_routes["Allocation routes<br/>[alocacoesRoutes.js]"]
  node_maintenance_client["Maintenance data access"]
  node_class_data["Class data access<br/>[turmasService.js]"]
end

subgraph group_data["Persistence"]
  node_supabase_config["Supabase client<br/>[supabase.js]"]
  node_supabase[("Supabase database")]
end

node_user(("Staff and users"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_maintenance
node_app -->|"routes to"| node_maintenance_reports
node_app -->|"routes to"| node_maintenance_dispatch
node_app -->|"routes to"| node_room_request
node_app -->|"routes to"| node_class_teacher
node_app -->|"routes to"| node_lesson_assignment
node_app -->|"routes to"| node_room_allocation
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_allocation_report
node_app -->|"routes to"| node_room_report
node_app -->|"routes to"| node_class_report
node_maintenance -.->|"uses"| node_api_client
node_class_teacher -->|"submits through"| node_api_client
node_api_client -.->|"fetches API"| node_express_app
node_express_app -->|"mounts"| node_api_routes
node_api_routes -->|"registers"| node_maintenance_routes
node_api_routes -->|"registers"| node_class_routes
node_api_routes -->|"registers"| node_teacher_routes
node_api_routes -->|"registers"| node_room_routes
node_api_routes -->|"registers"| node_assignment_routes
node_api_routes -->|"registers"| node_allocation_routes
node_maintenance_routes -->|"calls"| node_maintenance_service
node_class_routes -->|"delegates"| node_class_service
node_maintenance_service -->|"queries"| node_supabase_config
node_class_service -->|"queries"| node_supabase_config
node_supabase_config -.->|"connects"| node_supabase

click node_app "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/App.js"
click node_home "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Home.js"
click node_login "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Login.js"
click node_maintenance "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Sujest%C3%A3o_manuten%C3%A7%C3%A3o.js"
click node_maintenance_reports "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_manuten%C3%A7%C3%A3o.js"
click node_maintenance_dispatch "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Direcionamento_de_manuten%C3%A7%C3%A3o.js"
click node_room_request "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Solicita%C3%A7%C3%A3o_de_Ambiente.js"
click node_class_teacher "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Cadastro_de_turma_doscente.js"
click node_lesson_assignment "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Atribui%C3%A7%C3%A3o_de_aula.js"
click node_room_allocation "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Aloca%C3%A7%C3%A3o_de_ambiente.js"
click node_reports "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio.js"
click node_allocation_report "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_alocacoes.js"
click node_room_report "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_ambientes.js"
click node_class_report "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_turmas.js"
click node_api_client "https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/api.js"
click node_express_app "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/app.js"
click node_api_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/index.js"
click node_maintenance_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/manutencaoRoutes.js"
click node_maintenance_service "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/manutencaoService.js"
click node_class_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/turmasRoutes.js"
click node_class_service "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/turmasService.js"
click node_teacher_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/docentesRoutes.js"
click node_room_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/ambientesRoutes.js"
click node_assignment_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/atribuicoesRoutes.js"
click node_allocation_routes "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/alocacoesRoutes.js"
click node_maintenance_client "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/manutencaoService.js"
click node_class_data "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/turmasService.js"
click node_supabase_config "https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/config/supabase.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_app,node_home,node_login,node_maintenance,node_maintenance_reports,node_maintenance_dispatch,node_room_request,node_class_teacher,node_lesson_assignment,node_room_allocation,node_reports,node_allocation_report,node_room_report,node_class_report,node_api_client,node_user toneBlue
class node_express_app,node_api_routes,node_maintenance_routes,node_maintenance_service,node_class_routes,node_class_service,node_teacher_routes,node_room_routes,node_assignment_routes,node_allocation_routes,node_maintenance_client,node_class_data toneAmber
class node_supabase_config,node_supabase toneMint
```

## Components

### Web interface

- [Page router](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/App.js): `font_end/src/App.js`
- [Operations home](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Home.js): `font_end/src/Home.js`
- [Login](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Login.js): `font_end/src/Login.js`
- [Maintenance suggestions](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Sujest%C3%A3o_manuten%C3%A7%C3%A3o.js): `font_end/src/Sujestão_manutenção.js`
- [Maintenance report](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_manuten%C3%A7%C3%A3o.js): `font_end/src/Relatorio_de_manutenção.js`
- [Maintenance dispatch](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Direcionamento_de_manuten%C3%A7%C3%A3o.js): `font_end/src/Direcionamento_de_manutenção.js`
- [Room requests](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Solicita%C3%A7%C3%A3o_de_Ambiente.js): `font_end/src/Solicitação_de_Ambiente.js`
- [Class and teacher setup](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Cadastro_de_turma_doscente.js): `font_end/src/Cadastro_de_turma_doscente.js`
- [Lesson assignment](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Atribui%C3%A7%C3%A3o_de_aula.js): `font_end/src/Atribuição_de_aula.js`
- [Room allocation](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Aloca%C3%A7%C3%A3o_de_ambiente.js): `font_end/src/Alocação_de_ambiente.js`
- [Report navigation](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio.js): `font_end/src/Relatorio.js`
- [Allocation report](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_alocacoes.js): `font_end/src/Relatorio_de_alocacoes.js`
- [Room report](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_ambientes.js): `font_end/src/Relatorio_de_ambientes.js`
- [Class report](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/Relatorio_de_turmas.js): `font_end/src/Relatorio_de_turmas.js`
- [Fetch client](https://github.com/guilhermelleiteads/sga/blob/master/font_end/src/api.js): `font_end/src/api.js`

### API and services

- [Express API](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/app.js): `beck_end/src/app.js`
- [API route registry](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/index.js): `beck_end/src/routes/index.js`
- [Maintenance routes](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/manutencaoRoutes.js): `beck_end/src/routes/manutencaoRoutes.js`
- [Maintenance service](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/manutencaoService.js): `beck_end/src/services/manutencaoService.js`
- [Class routes](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/turmasRoutes.js): `beck_end/src/routes/turmasRoutes.js`
- [Class service](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/turmasService.js): `beck_end/src/services/turmasService.js`
- [Teacher routes](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/docentesRoutes.js): `beck_end/src/routes/docentesRoutes.js`
- [Room routes](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/ambientesRoutes.js): `beck_end/src/routes/ambientesRoutes.js`
- [Assignment routes](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/atribuicoesRoutes.js): `beck_end/src/routes/atribuicoesRoutes.js`
- [Allocation routes](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/routes/alocacoesRoutes.js): `beck_end/src/routes/alocacoesRoutes.js`
- [Maintenance data access](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/manutencaoService.js): `beck_end/src/services/manutencaoService.js`
- [Class data access](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/services/turmasService.js): `beck_end/src/services/turmasService.js`

### Persistence

- [Supabase client](https://github.com/guilhermelleiteads/sga/blob/master/beck_end/src/config/supabase.js): `beck_end/src/config/supabase.js`
- **Supabase database**

### Other components

- **Staff and users**

## Connections

- Staff and users → Page router: opens (evidence: `font_end/src/App.js`)
- Page router → Operations home: routes to (evidence: `font_end/src/App.js`)
- Page router → Login: routes to (evidence: `font_end/src/App.js`)
- Page router → Maintenance suggestions: routes to (evidence: `font_end/src/App.js`)
- Page router → Maintenance report: routes to (evidence: `font_end/src/App.js`)
- Page router → Maintenance dispatch: routes to (evidence: `font_end/src/App.js`)
- Page router → Room requests: routes to (evidence: `font_end/src/App.js`)
- Page router → Class and teacher setup: routes to (evidence: `font_end/src/App.js`)
- Page router → Lesson assignment: routes to (evidence: `font_end/src/App.js`)
- Page router → Room allocation: routes to (evidence: `font_end/src/App.js`)
- Page router → Report navigation: routes to (evidence: `font_end/src/App.js`)
- Page router → Allocation report: routes to (evidence: `font_end/src/App.js`)
- Page router → Room report: routes to (evidence: `font_end/src/App.js`)
- Page router → Class report: routes to (evidence: `font_end/src/App.js`)
- Maintenance suggestions → Fetch client: uses (evidence: `font_end/src/Sujestão_manutenção.js`)
- Class and teacher setup → Fetch client: submits through (evidence: `font_end/src/Cadastro_de_turma_doscente.js`)
- Fetch client → Express API: fetches API
- Express API → API route registry: mounts (evidence: `beck_end/src/app.js`)
- API route registry → Maintenance routes: registers (evidence: `beck_end/src/routes/index.js`)
- API route registry → Class routes: registers (evidence: `beck_end/src/routes/index.js`)
- API route registry → Teacher routes: registers (evidence: `beck_end/src/routes/index.js`)
- API route registry → Room routes: registers (evidence: `beck_end/src/routes/index.js`)
- API route registry → Assignment routes: registers (evidence: `beck_end/src/routes/index.js`)
- API route registry → Allocation routes: registers (evidence: `beck_end/src/routes/index.js`)
- Maintenance routes → Maintenance service: calls (evidence: `beck_end/src/routes/manutencaoRoutes.js`)
- Class routes → Class service: delegates (evidence: `beck_end/src/routes/turmasRoutes.js`)
- Maintenance service → Supabase client: queries (evidence: `beck_end/src/services/manutencaoService.js`)
- Class service → Supabase client: queries (evidence: `beck_end/src/services/turmasService.js`)
- Supabase client → Supabase database: connects
