# willbugs/pontocar architecture

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

- Interactive diagram: https://gitdiagram.com/willbugs/pontocar
- Repository: https://github.com/willbugs/pontocar

## Overview

PontoCar Web unifies workshop, inventory, finance, accounting, customer records and Realizar’s works, rentals and condominium functions in one React client and .NET API. Users enter through the routed web app, authenticate, and use module screens; API controllers handle requests against shared SQL Server state. The README documents the unified scope, while excerpts show routing, API setup, selected controller persistence, and NFe service registration. Most module screens and controllers were not sampled, so their links are omitted or marked unverified rather than inferred as concrete calls.

Main entry points: [`frontend/src/App.tsx`](https://github.com/willbugs/pontocar/blob/main/frontend/src/App.tsx) (React application), [`backend/PontoCar.Api/Program.cs`](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Program.cs) (ASP.NET API), [`backend/PontoCar.Infrastructure/Data/PontoCarDbContext.cs`](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Data/PontoCarDbContext.cs) (SQL Server database), [`frontend/src/pages/caixa/CaixaPage.tsx`](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/caixa/CaixaPage.tsx) (Cash screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["React application<br/>[App.tsx]"]
  node_authui["Login and identity<br/>[AuthContext.tsx]"]
  node_clientui["Customer records<br/>[ClientesPage.tsx]"]
  node_workui["Workshop screens<br/>[OSPage.tsx]"]
  node_inventoryui["Inventory screens<br/>[EstoquePage.tsx]"]
  node_cashui["Cash screens<br/>[CaixaPage.tsx]"]
  node_accountui["Accounting screens"]
  node_worksui["Works screens<br/>[ObrasPage.tsx]"]
  node_rentalui["Rental screens<br/>[AlugueisPage.tsx]"]
  node_condoui["Condominium screen<br/>[CondominioPage.tsx]"]
  node_reportsui["Reports screens<br/>[RelatoriosPage.tsx]"]
end

subgraph group_api["API and domain"]
  node_apiapp["ASP.NET API<br/>[Program.cs]"]
  node_authapi["Authentication API<br/>[AuthController.cs]"]
  node_customers["Customer domain<br/>[Cliente.cs]"]
  node_workshop["Work orders"]
  node_inventory["Inventory movements"]
  node_nfe["Invoice issuance"]
end

subgraph group_finance["Finance operations"]
  node_cash["Cash and accounts"]
  node_accounting["Accounting records"]
end

subgraph group_realizar["Realizar modules"]
  node_works["Works management<br/>[ObrasController.cs]"]
  node_rentals["Rental contracts"]
  node_condominium["Condominium module<br/>[CondominioPage.tsx]"]
end

subgraph group_infra["Persistence and integrations"]
  node_db[("SQL Server database")]
  node_tokenservice["Refresh token service"]
end

node_user(("Staff user"))
node_sefaz["SEFAZ"]

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_clientui
node_webapp -->|"routes to"| node_workui
node_webapp -->|"routes to"| node_inventoryui
node_webapp -->|"routes to"| node_cashui
node_webapp -->|"routes to"| node_accountui
node_webapp -->|"routes to"| node_worksui
node_webapp -->|"routes to"| node_rentalui
node_webapp -->|"routes to"| node_condoui
node_webapp -->|"routes to"| node_reportsui
node_webapp -.->|"uses API"| node_apiapp
node_apiapp -->|"maps controllers"| node_authapi
node_authapi -->|"reads and writes"| node_db
node_workshop -->|"reads and writes"| node_db
node_works -->|"reads and writes"| node_db
node_apiapp -->|"configures"| node_db
node_apiapp -->|"registers"| node_nfe
node_nfe -->|"submits invoice"| node_sefaz
node_apiapp -->|"registers"| node_tokenservice
node_cashui -.->|"uses API"| node_cash
node_accountui -.->|"uses API"| node_accounting
node_worksui -.->|"uses API"| node_works
node_rentalui -.->|"uses API"| node_rentals
node_condoui -.->|"supports module"| node_condominium

click node_webapp "https://github.com/willbugs/pontocar/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/willbugs/pontocar/blob/main/frontend/src/contexts/AuthContext.tsx"
click node_clientui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/clientes/ClientesPage.tsx"
click node_workui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/os/OSPage.tsx"
click node_inventoryui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/estoque/EstoquePage.tsx"
click node_cashui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/caixa/CaixaPage.tsx"
click node_accountui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/contabilidade/ContabilidadePage.tsx"
click node_worksui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/obras/ObrasPage.tsx"
click node_rentalui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/alugueis/AlugueisPage.tsx"
click node_condoui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/condominio/CondominioPage.tsx"
click node_reportsui "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/relatorios/RelatoriosPage.tsx"
click node_apiapp "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Program.cs"
click node_authapi "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/AuthController.cs"
click node_customers "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Domain/Entities/Cliente.cs"
click node_workshop "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/OrdensServicoController.cs"
click node_inventory "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Domain/Entities/MovimentoEstoque.cs"
click node_cash "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/MovimentosContaController.cs"
click node_accounting "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/LancamentosContabeisController.cs"
click node_works "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/ObrasController.cs"
click node_rentals "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/ContratosAluguelController.cs"
click node_condominium "https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/condominio/CondominioPage.tsx"
click node_nfe "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Services/NFe/UnimakeNFeService.cs"
click node_db "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Data/PontoCarDbContext.cs"
click node_tokenservice "https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Services/RefreshTokenService.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_webapp,node_authui,node_clientui,node_workui,node_inventoryui,node_cashui,node_accountui,node_worksui,node_rentalui,node_condoui,node_reportsui,node_user toneBlue
class node_apiapp,node_authapi,node_customers,node_workshop,node_inventory,node_nfe toneAmber
class node_cash,node_accounting toneMint
class node_works,node_rentals,node_condominium toneRose
class node_db,node_tokenservice,node_sefaz toneIndigo
```

## Components

### Web client

- [React application](https://github.com/willbugs/pontocar/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Login and identity](https://github.com/willbugs/pontocar/blob/main/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [Customer records](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/clientes/ClientesPage.tsx): `frontend/src/pages/clientes/ClientesPage.tsx`
- [Workshop screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/os/OSPage.tsx): `frontend/src/pages/os/OSPage.tsx`
- [Inventory screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/estoque/EstoquePage.tsx): `frontend/src/pages/estoque/EstoquePage.tsx`
- [Cash screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/caixa/CaixaPage.tsx): `frontend/src/pages/caixa/CaixaPage.tsx`
- [Accounting screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/contabilidade/ContabilidadePage.tsx): `frontend/src/pages/contabilidade/ContabilidadePage.tsx`
- [Works screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/obras/ObrasPage.tsx): `frontend/src/pages/obras/ObrasPage.tsx`
- [Rental screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/alugueis/AlugueisPage.tsx): `frontend/src/pages/alugueis/AlugueisPage.tsx`
- [Condominium screen](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/condominio/CondominioPage.tsx): `frontend/src/pages/condominio/CondominioPage.tsx`
- [Reports screens](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/relatorios/RelatoriosPage.tsx): `frontend/src/pages/relatorios/RelatoriosPage.tsx`

### API and domain

- [ASP.NET API](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Program.cs): `backend/PontoCar.Api/Program.cs`
- [Authentication API](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/AuthController.cs): `backend/PontoCar.Api/Controllers/AuthController.cs`
- [Customer domain](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Domain/Entities/Cliente.cs): `backend/PontoCar.Domain/Entities/Cliente.cs`
- [Work orders](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/OrdensServicoController.cs): `backend/PontoCar.Api/Controllers/OrdensServicoController.cs`
- [Inventory movements](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Domain/Entities/MovimentoEstoque.cs): `backend/PontoCar.Domain/Entities/MovimentoEstoque.cs`
- [Invoice issuance](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Services/NFe/UnimakeNFeService.cs): `backend/PontoCar.Infrastructure/Services/NFe/UnimakeNFeService.cs`

### Finance operations

- [Cash and accounts](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/MovimentosContaController.cs): `backend/PontoCar.Api/Controllers/MovimentosContaController.cs`
- [Accounting records](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/LancamentosContabeisController.cs): `backend/PontoCar.Api/Controllers/LancamentosContabeisController.cs`

### Realizar modules

- [Works management](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/ObrasController.cs): `backend/PontoCar.Api/Controllers/ObrasController.cs`
- [Rental contracts](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Api/Controllers/ContratosAluguelController.cs): `backend/PontoCar.Api/Controllers/ContratosAluguelController.cs`
- [Condominium module](https://github.com/willbugs/pontocar/blob/main/frontend/src/pages/condominio/CondominioPage.tsx): `frontend/src/pages/condominio/CondominioPage.tsx`

### Persistence and integrations

- [SQL Server database](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Data/PontoCarDbContext.cs): `backend/PontoCar.Infrastructure/Data/PontoCarDbContext.cs`
- [Refresh token service](https://github.com/willbugs/pontocar/blob/main/backend/PontoCar.Infrastructure/Services/RefreshTokenService.cs): `backend/PontoCar.Infrastructure/Services/RefreshTokenService.cs`

### Other components

- **Staff user**
- **SEFAZ**

## Connections

- Staff user → React application: uses (evidence: `README.md`)
- React application → Login and identity: routes to (evidence: `frontend/src/App.tsx`)
- React application → Customer records: routes to (evidence: `frontend/src/App.tsx`)
- React application → Workshop screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → Inventory screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → Cash screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → Accounting screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → Works screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → Rental screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → Condominium screen: routes to (evidence: `frontend/src/App.tsx`)
- React application → Reports screens: routes to (evidence: `frontend/src/App.tsx`)
- React application → ASP.NET API: uses API (evidence: `README.md`)
- ASP.NET API → Authentication API: maps controllers (evidence: `backend/PontoCar.Api/Program.cs`)
- Authentication API → SQL Server database: reads and writes (evidence: `backend/PontoCar.Api/Controllers/AuthController.cs`)
- Work orders → SQL Server database: reads and writes (evidence: `backend/PontoCar.Api/Controllers/OrdensServicoController.cs`)
- Works management → SQL Server database: reads and writes (evidence: `backend/PontoCar.Api/Controllers/ObrasController.cs`)
- ASP.NET API → SQL Server database: configures (evidence: `backend/PontoCar.Api/Program.cs`)
- ASP.NET API → Invoice issuance: registers (evidence: `backend/PontoCar.Api/Program.cs`)
- Invoice issuance → SEFAZ: submits invoice (evidence: `backend/PontoCar.Infrastructure/Services/NFe/UnimakeNFeService.cs`)
- ASP.NET API → Refresh token service: registers (evidence: `backend/PontoCar.Api/Program.cs`)
- Cash screens → Cash and accounts: uses API (evidence: `README.md`)
- Accounting screens → Accounting records: uses API (evidence: `README.md`)
- Works screens → Works management: uses API (evidence: `README.md`)
- Rental screens → Rental contracts: uses API (evidence: `README.md`)
- Condominium screen → Condominium module: supports module (evidence: `README.md`)
