# matheusapaxtech-projects/prisa-logistica architecture

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

- Interactive diagram: https://gitdiagram.com/matheusapaxtech-projects/prisa-logistica
- Repository: https://github.com/matheusapaxtech-projects/prisa-logistica

## Overview

NILT is Prisa Logística’s transport-management system. Users manage people, customers, vehicles and orders, plan and dispatch freight, follow trips on a live operations board, then handle financial records and monthly results. The README identifies Supabase as the database, authentication and file platform. The graph preserves the documented product areas; several domain connections are dashed because their implementation was not sampled. Source evidence confirms the board’s calls to its query and action modules, calculator route saving, and the retentions spreadsheet’s database-backed query.

Main entry points: [`web/src/app/(app)/layout.tsx`](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/layout.tsx) (NILT web app), [`web/src/app/(app)/quadro/quadro-cliente.tsx`](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/quadro/quadro-cliente.tsx) (Live operations board), [`web/src/app/(app)/financeiro`](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/financeiro) (Financial operations), [`web/src/app/(app)/viagens`](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/viagens) (Trip execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and platform"]
  node_webapp["NILT web app<br/>[layout.tsx]"]
  node_auth["Login and access<br/>[page.tsx]"]
  node_supabase[("Supabase platform")]
end

subgraph group_registers["People and fleet"]
  node_people["Person records"]
  node_customers["Customer records"]
  node_drivers["Drivers and owners"]
  node_vehicles["Vehicles and sets"]
end

subgraph group_operations["Freight operations"]
  node_orders["Freight orders"]
  node_dispatch["Dispatch and deals"]
  node_availability["Driver availability"]
  node_trips["Trip execution"]
  node_board["Live operations board<br/>[quadro-cliente.tsx]"]
end

subgraph group_finance["Finance"]
  node_finance["Financial operations"]
  node_ofx["OFX import"]
  node_payables["Payables and receivables<br/>[page.tsx]"]
  node_withholdings["Tax withholdings<br/>[page.tsx]"]
  node_retentionquery["Monthly retention query<br/>[consultas.ts]"]
  node_csv["CSV export<br/>[route.ts]"]
end

subgraph group_insight["Planning and oversight"]
  node_calculator["Freight calculator"]
  node_dashboard["Operations dashboard<br/>[page.tsx]"]
  node_audit["Audit history<br/>[page.tsx]"]
end

node_operator(("Prisa staff"))

node_operator -.->|"uses"| node_webapp
node_operator -.->|"signs in"| node_auth
node_webapp -.->|"uses platform"| node_supabase
node_auth -.->|"authenticates"| node_supabase
node_webapp -.->|"manages"| node_people
node_webapp -.->|"manages"| node_customers
node_webapp -.->|"manages"| node_drivers
node_webapp -.->|"manages"| node_vehicles
node_webapp -.->|"records"| node_orders
node_orders -.->|"dispatched through"| node_dispatch
node_dispatch -.->|"checks"| node_availability
node_dispatch -.->|"coordinates"| node_trips
node_trips -.->|"tracked on"| node_board
node_board -.->|"renders in"| node_webapp
node_board -->|"subscribes and reads"| node_supabase
node_board -->|"calls trip actions"| node_webapp
node_calculator -.->|"saves routes via"| node_supabase
node_calculator -->|"can prefill from"| node_trips
node_dashboard -.->|"summarizes"| node_trips
node_dashboard -.->|"uses board rules"| node_board
node_finance -.->|"imports statements"| node_ofx
node_finance -.->|"handles"| node_payables
node_finance -.->|"handles"| node_withholdings
node_ofx -->|"calls finance actions"| node_finance
node_csv -->|"queries month"| node_retentionquery
node_retentionquery -->|"reads"| node_supabase
node_audit -.->|"reads history"| node_supabase

click node_webapp "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/layout.tsx"
click node_auth "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/login/page.tsx"
click node_people "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/_pessoa"
click node_customers "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/clientes"
click node_drivers "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/motoristas"
click node_vehicles "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/veiculos"
click node_orders "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/pedidos"
click node_dispatch "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/despacho"
click node_availability "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/disponiveis"
click node_trips "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/viagens"
click node_board "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/quadro/quadro-cliente.tsx"
click node_calculator "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/calculadora/calculadora-cliente.tsx"
click node_dashboard "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/(inicio)/page.tsx"
click node_audit "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/auditoria/page.tsx"
click node_finance "https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/financeiro"
click node_ofx "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/importar/importar-cliente.tsx"
click node_payables "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/pagar/page.tsx"
click node_withholdings "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/retencoes/page.tsx"
click node_retentionquery "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/retencoes/consultas.ts"
click node_csv "https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/retencoes/planilha/route.ts"

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_webapp,node_auth,node_supabase toneBlue
class node_people,node_customers,node_drivers,node_vehicles toneAmber
class node_orders,node_dispatch,node_availability,node_trips,node_board toneMint
class node_finance,node_ofx,node_payables,node_withholdings,node_retentionquery,node_csv toneRose
class node_calculator,node_dashboard,node_audit,node_operator toneIndigo
```

## Components

### Access and platform

- [NILT web app](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/layout.tsx): `web/src/app/(app)/layout.tsx`
- [Login and access](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/login/page.tsx): `web/src/app/login/page.tsx`
- **Supabase platform**

### People and fleet

- [Person records](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/_pessoa): `web/src/app/(app)/_pessoa`
- [Customer records](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/clientes): `web/src/app/(app)/clientes`
- [Drivers and owners](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/motoristas): `web/src/app/(app)/motoristas`
- [Vehicles and sets](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/veiculos): `web/src/app/(app)/veiculos`

### Freight operations

- [Freight orders](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/pedidos): `web/src/app/(app)/pedidos`
- [Dispatch and deals](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/despacho): `web/src/app/(app)/despacho`
- [Driver availability](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/disponiveis): `web/src/app/(app)/disponiveis`
- [Trip execution](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/viagens): `web/src/app/(app)/viagens`
- [Live operations board](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/quadro/quadro-cliente.tsx): `web/src/app/(app)/quadro/quadro-cliente.tsx`

### Finance

- [Financial operations](https://github.com/matheusapaxtech-projects/prisa-logistica/tree/main/web/src/app/(app)/financeiro): `web/src/app/(app)/financeiro`
- [OFX import](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/importar/importar-cliente.tsx): `web/src/app/(app)/financeiro/importar/importar-cliente.tsx`
- [Payables and receivables](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/pagar/page.tsx): `web/src/app/(app)/financeiro/pagar/page.tsx`
- [Tax withholdings](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/retencoes/page.tsx): `web/src/app/(app)/financeiro/retencoes/page.tsx`
- [Monthly retention query](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/retencoes/consultas.ts): `web/src/app/(app)/financeiro/retencoes/consultas.ts`
- [CSV export](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/financeiro/retencoes/planilha/route.ts): `web/src/app/(app)/financeiro/retencoes/planilha/route.ts`

### Planning and oversight

- [Freight calculator](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/calculadora/calculadora-cliente.tsx): `web/src/app/(app)/calculadora/calculadora-cliente.tsx`
- [Operations dashboard](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/(inicio)/page.tsx): `web/src/app/(app)/(inicio)/page.tsx`
- [Audit history](https://github.com/matheusapaxtech-projects/prisa-logistica/blob/main/web/src/app/(app)/auditoria/page.tsx): `web/src/app/(app)/auditoria/page.tsx`

### Other components

- **Prisa staff**

## Connections

- Prisa staff → NILT web app: uses
- Prisa staff → Login and access: signs in
- NILT web app → Supabase platform: uses platform (evidence: `README.md`)
- Login and access → Supabase platform: authenticates (evidence: `README.md`)
- NILT web app → Person records: manages (evidence: `README.md`)
- NILT web app → Customer records: manages (evidence: `README.md`)
- NILT web app → Drivers and owners: manages (evidence: `README.md`)
- NILT web app → Vehicles and sets: manages (evidence: `README.md`)
- NILT web app → Freight orders: records (evidence: `README.md`)
- Freight orders → Dispatch and deals: dispatched through (evidence: `web/src/app/(app)/despacho/actions.ts`)
- Dispatch and deals → Driver availability: checks
- Dispatch and deals → Trip execution: coordinates
- Trip execution → Live operations board: tracked on (evidence: `README.md`)
- Live operations board → NILT web app: renders in
- Live operations board → Supabase platform: subscribes and reads (evidence: `web/src/app/(app)/quadro/quadro-cliente.tsx`)
- Live operations board → NILT web app: calls trip actions (evidence: `web/src/app/(app)/quadro/quadro-cliente.tsx`)
- Freight calculator → Supabase platform: saves routes via
- Freight calculator → Trip execution: can prefill from (evidence: `web/src/app/(app)/calculadora/calculadora-cliente.tsx`)
- Operations dashboard → Trip execution: summarizes (evidence: `web/src/app/(app)/(inicio)/page.tsx`)
- Operations dashboard → Live operations board: uses board rules
- Financial operations → OFX import: imports statements (evidence: `README.md`)
- Financial operations → Payables and receivables: handles (evidence: `README.md`)
- Financial operations → Tax withholdings: handles
- OFX import → Financial operations: calls finance actions (evidence: `web/src/app/(app)/financeiro/importar/importar-cliente.tsx`)
- CSV export → Monthly retention query: queries month (evidence: `web/src/app/(app)/financeiro/retencoes/planilha/route.ts`)
- Monthly retention query → Supabase platform: reads
- Audit history → Supabase platform: reads history
