# prefeiturasp/sme-sigpae-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/prefeiturasp/sme-sigpae-frontend
- Repository: https://github.com/prefeiturasp/sme-sigpae-frontend

## Overview

SIGPAE is a React application for managing São Paulo’s school-meal program. Its main user journey is authenticated school, regional-office, and CODAE staff entering or reviewing meal-service requests; the application routes users to workflow screens, which use domain services to exchange data with the API. The README also describes product management, special diets, measurement, pre-receiving, and receiving. Several of these areas are represented from documented capabilities and the file tree; their internal calls were not sampled, so those links are left unasserted.

Main entry points: [`src/services/_base.ts`](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/_base.ts) (HTTP client), [`src/services/auth.jsx`](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/auth.jsx) (Authentication), [`src/App.tsx`](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/App.tsx) (Application), [`src/routes.jsx`](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/routes.jsx) (Route access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["Application<br/>[App.tsx]"]
  node_state["Redux state<br/>[reducers.jsx]"]
  node_routing["Route access<br/>[routes.jsx]"]
  node_route_config["Feature routes<br/>[index.ts]"]
  node_login["Login and recovery<br/>[index.tsx]"]
end

subgraph group_shell["Navigation and shared UI"]
  node_page_shell["Page shell<br/>[Page.jsx]"]
  node_sidebar["Navigation sidebar<br/>[SidebarContent.jsx]"]
  node_return_modal["Return confirmation<br/>[ModalVoltar.jsx]"]
end

subgraph group_food["Food-service workflows"]
  node_meal_requests["Meal-service requests<br/>[index.tsx]"]
  node_menu_changes["Menu changes<br/>[index.jsx]"]
  node_snack_kits["Snack-kit requests<br/>[index.jsx]"]
  node_suspensions["Meal suspensions<br/>[index.jsx]"]
end

subgraph group_operations["Program operations"]
  node_special_diets["Special diets"]
  node_products["Product management"]
  node_measurement["Initial measurement<br/>[index.jsx]"]
  node_pre_receiving["Pre-receiving<br/>[index.ts]"]
  node_receiving["Receiving checks"]
end

subgraph group_platform["Identity and data access"]
  node_auth["Authentication<br/>[auth.jsx]"]
  node_http_client["HTTP client<br/>[_base.ts]"]
  node_app_config["Runtime configuration<br/>[config.jsx]"]
  node_shared_constants["Shared workflow constants<br/>[shared.jsx]"]
end

node_school_staff(("School staff"))
node_regional_staff(("DRE staff"))
node_codae_staff(("CODAE staff"))
node_api[("SIGPAE API")]

node_app -->|"renders routes"| node_routing
node_app -->|"creates state"| node_state
node_routing -->|"routes to"| node_login
node_routing -->|"maps routes"| node_route_config
node_routing -->|"checks access"| node_auth
node_page_shell -->|"renders"| node_sidebar
node_school_staff -.->|"uses"| node_app
node_regional_staff -.->|"uses"| node_app
node_codae_staff -.->|"uses"| node_app
node_auth -->|"sends requests"| node_http_client
node_auth -->|"reads settings"| node_app_config
node_auth -.->|"authenticates"| node_api
node_http_client -->|"refreshes tokens"| node_auth
node_http_client -->|"uses base URL"| node_app_config
node_http_client -.->|"sends requests"| node_api
node_products -->|"calls API client"| node_http_client
node_special_diets -->|"calls API client"| node_http_client
node_measurement -.->|"calls API client"| node_http_client
node_receiving -->|"calls API client"| node_http_client
node_meal_requests -.->|"submits requests"| node_http_client
node_menu_changes -.->|"submits changes"| node_http_client
node_snack_kits -.->|"submits requests"| node_http_client
node_suspensions -.->|"submits requests"| node_http_client

click node_app "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/App.tsx"
click node_state "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/reducers.jsx"
click node_routing "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/routes.jsx"
click node_route_config "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/configs/rotas/index.ts"
click node_login "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Login/index.tsx"
click node_page_shell "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Shareable/Page/Page.jsx"
click node_sidebar "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Shareable/Sidebar/SidebarContent.jsx"
click node_return_modal "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Shareable/Page/ModalVoltar.jsx"
click node_meal_requests "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/InclusaoDeAlimentacao/Escola/Formulario/index.tsx"
click node_menu_changes "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/AlteracaoDeCardapio/Escola/index.jsx"
click node_snack_kits "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/SolicitacaoDeKitLanche/Container/index.jsx"
click node_suspensions "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/SuspensaoDeAlimentacao/index.jsx"
click node_special_diets "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/dietaEspecial.service.jsx"
click node_products "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/produto.service.jsx"
click node_measurement "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/screens/LancamentoInicial/PeriodoLancamentoMedicaoInicial/index.jsx"
click node_pre_receiving "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/configs/rotas/preRecebimento/index.ts"
click node_receiving "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/recebimento/questoesConferencia.service.ts"
click node_auth "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/auth.jsx"
click node_http_client "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/_base.ts"
click node_app_config "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/constants/config.jsx"
click node_shared_constants "https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/constants/shared.jsx"

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_state,node_routing,node_route_config,node_login toneBlue
class node_page_shell,node_sidebar,node_return_modal,node_api toneAmber
class node_meal_requests,node_menu_changes,node_snack_kits,node_suspensions toneMint
class node_special_diets,node_products,node_measurement,node_pre_receiving,node_receiving toneRose
class node_auth,node_http_client,node_app_config,node_shared_constants,node_school_staff,node_regional_staff,node_codae_staff toneIndigo
```

## Components

### Application entry

- [Application](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/App.tsx): `src/App.tsx`
- [Redux state](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/reducers.jsx): `src/reducers.jsx`
- [Route access](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/routes.jsx): `src/routes.jsx`
- [Feature routes](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/configs/rotas/index.ts): `src/configs/rotas/index.ts`
- [Login and recovery](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Login/index.tsx): `src/components/Login/index.tsx`

### Navigation and shared UI

- [Page shell](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Shareable/Page/Page.jsx): `src/components/Shareable/Page/Page.jsx`
- [Navigation sidebar](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Shareable/Sidebar/SidebarContent.jsx): `src/components/Shareable/Sidebar/SidebarContent.jsx`
- [Return confirmation](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/Shareable/Page/ModalVoltar.jsx): `src/components/Shareable/Page/ModalVoltar.jsx`

### Food-service workflows

- [Meal-service requests](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/InclusaoDeAlimentacao/Escola/Formulario/index.tsx): `src/components/InclusaoDeAlimentacao/Escola/Formulario/index.tsx`
- [Menu changes](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/AlteracaoDeCardapio/Escola/index.jsx): `src/components/AlteracaoDeCardapio/Escola/index.jsx`
- [Snack-kit requests](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/SolicitacaoDeKitLanche/Container/index.jsx): `src/components/SolicitacaoDeKitLanche/Container/index.jsx`
- [Meal suspensions](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/SuspensaoDeAlimentacao/index.jsx): `src/components/SuspensaoDeAlimentacao/index.jsx`

### Program operations

- [Special diets](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/dietaEspecial.service.jsx): `src/services/dietaEspecial.service.jsx`
- [Product management](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/produto.service.jsx): `src/services/produto.service.jsx`
- [Initial measurement](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/components/screens/LancamentoInicial/PeriodoLancamentoMedicaoInicial/index.jsx): `src/components/screens/LancamentoInicial/PeriodoLancamentoMedicaoInicial/index.jsx`
- [Pre-receiving](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/configs/rotas/preRecebimento/index.ts): `src/configs/rotas/preRecebimento/index.ts`
- [Receiving checks](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/recebimento/questoesConferencia.service.ts): `src/services/recebimento/questoesConferencia.service.ts`

### Identity and data access

- [Authentication](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/auth.jsx): `src/services/auth.jsx`
- [HTTP client](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/services/_base.ts): `src/services/_base.ts`
- [Runtime configuration](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/constants/config.jsx): `src/constants/config.jsx`
- [Shared workflow constants](https://github.com/prefeiturasp/sme-sigpae-frontend/blob/master/src/constants/shared.jsx): `src/constants/shared.jsx`

### Other components

- **School staff**
- **DRE staff**
- **CODAE staff**
- **SIGPAE API**

## Connections

- Application → Route access: renders routes (evidence: `src/App.tsx`)
- Application → Redux state: creates state (evidence: `src/index.jsx`)
- Route access → Login and recovery: routes to (evidence: `src/routes.jsx`)
- Route access → Feature routes: maps routes (evidence: `src/routes.jsx`)
- Route access → Authentication: checks access (evidence: `src/routes.jsx`)
- Page shell → Navigation sidebar: renders (evidence: `src/components/Shareable/Page/Page.jsx`)
- School staff → Application: uses (evidence: `README.md`)
- DRE staff → Application: uses (evidence: `README.md`)
- CODAE staff → Application: uses (evidence: `README.md`)
- Authentication → HTTP client: sends requests (evidence: `src/services/auth.jsx`)
- Authentication → Runtime configuration: reads settings (evidence: `src/services/auth.jsx`)
- Authentication → SIGPAE API: authenticates
- HTTP client → Authentication: refreshes tokens (evidence: `src/services/_base.ts`)
- HTTP client → Runtime configuration: uses base URL (evidence: `src/services/_base.ts`)
- HTTP client → SIGPAE API: sends requests
- Product management → HTTP client: calls API client (evidence: `src/services/produto.service.jsx`)
- Special diets → HTTP client: calls API client (evidence: `src/services/dietaEspecial.service.jsx`)
- Initial measurement → HTTP client: calls API client
- Receiving checks → HTTP client: calls API client (evidence: `src/services/recebimento/questoesConferencia.service.ts`)
- Meal-service requests → HTTP client: submits requests
- Menu changes → HTTP client: submits changes
- Snack-kit requests → HTTP client: submits requests
- Meal suspensions → HTTP client: submits requests
