# matheusrocha-94/projetolocadora architecture

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

- Interactive diagram: https://gitdiagram.com/matheusrocha-94/projetolocadora
- Repository: https://github.com/matheusrocha-94/projetolocadora

## Overview

Dashboard de Frota is a PHP/MySQL fleet-inventory application with a browser dashboard. The main workflow is selecting a city, loading aggregated fleet metrics, and recording vehicle movements or operational-status changes; the dashboard then reflects the persisted state. Separate capabilities include vehicle registration and its history chart, plus model and city/cadastro endpoints. The README documents frontend/API integration, but the frontend source was not sampled, so its specific request wiring is not asserted here.

Main entry points: [`config/database.php`](https://github.com/matheusrocha-94/projetolocadora/blob/main/config/database.php) (PDO connection), [`api/bootstrap.php`](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/bootstrap.php) (JSON bootstrap), [`assets/js/app.js`](https://github.com/matheusrocha-94/projetolocadora/blob/main/assets/js/app.js) (API and charts), [`api/dashboard.php`](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/dashboard.php) (Fleet dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_dashboard_ui["Dashboard<br/>[index.html]"]
  node_frontend_logic["API and charts<br/>[app.js]"]
  node_dashboard_data["Dashboard layout<br/>[index.html]"]
end

subgraph group_api["PHP API"]
  node_dashboard_api["Fleet dashboard<br/>[dashboard.php]"]
  node_movement_api["Fleet movements<br/>[movimentacoes.php]"]
  node_status_api["Vehicle status"]
  node_vehicle_api["Vehicle registry<br/>[carros.php]"]
  node_registration_history["Registration history<br/>[cadastros.php]"]
  node_models_api["Available models<br/>[modelos.php]"]
  node_api_bootstrap["JSON bootstrap<br/>[bootstrap.php]"]
end

subgraph group_persistence["Data persistence"]
  node_db_connection["PDO connection<br/>[database.php]"]
  node_fleet_database[("Fleet data<br/>[schema.sql]")]
  node_initial_stock["Initial stock<br/>[seed.sql]"]
  node_movement_schema["Movement schema<br/>[schema.sql]"]
end

node_user(("Fleet operator"))

node_user -->|"uses"| node_dashboard_ui
node_dashboard_ui -->|"loads scripts"| node_frontend_logic
node_frontend_logic -->|"fetches dashboard"| node_dashboard_api
node_frontend_logic -->|"submits movements"| node_movement_api
node_frontend_logic -->|"updates status"| node_status_api
node_frontend_logic -->|"loads models"| node_models_api
node_dashboard_api -->|"requires"| node_api_bootstrap
node_movement_api -->|"requires"| node_api_bootstrap
node_status_api -->|"requires"| node_api_bootstrap
node_vehicle_api -->|"requires"| node_api_bootstrap
node_registration_history -->|"requires"| node_api_bootstrap
node_models_api -->|"requires"| node_api_bootstrap
node_api_bootstrap -->|"loads"| node_db_connection
node_dashboard_api -->|"queries via"| node_db_connection
node_movement_api -->|"reads and writes"| node_db_connection
node_status_api -->|"reads and writes"| node_db_connection
node_vehicle_api -->|"reads and writes"| node_db_connection
node_registration_history -->|"queries via"| node_db_connection
node_models_api -->|"queries via"| node_db_connection
node_db_connection -->|"connects to"| node_fleet_database
node_initial_stock -->|"seeds"| node_fleet_database

click node_dashboard_ui "https://github.com/matheusrocha-94/projetolocadora/blob/main/index.html"
click node_frontend_logic "https://github.com/matheusrocha-94/projetolocadora/blob/main/assets/js/app.js"
click node_dashboard_api "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/dashboard.php"
click node_movement_api "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/movimentacoes.php"
click node_status_api "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/status-veiculos.php"
click node_vehicle_api "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/carros.php"
click node_registration_history "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/cadastros.php"
click node_models_api "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/modelos.php"
click node_dashboard_data "https://github.com/matheusrocha-94/projetolocadora/blob/main/index.html"
click node_api_bootstrap "https://github.com/matheusrocha-94/projetolocadora/blob/main/api/bootstrap.php"
click node_db_connection "https://github.com/matheusrocha-94/projetolocadora/blob/main/config/database.php"
click node_fleet_database "https://github.com/matheusrocha-94/projetolocadora/blob/main/database/schema.sql"
click node_initial_stock "https://github.com/matheusrocha-94/projetolocadora/blob/main/database/seed.sql"
click node_movement_schema "https://github.com/matheusrocha-94/projetolocadora/blob/main/database/schema.sql"

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_dashboard_ui,node_frontend_logic,node_dashboard_data toneBlue
class node_dashboard_api,node_movement_api,node_status_api,node_vehicle_api,node_registration_history,node_models_api,node_api_bootstrap toneAmber
class node_db_connection,node_fleet_database,node_initial_stock,node_movement_schema toneMint
class node_user toneIndigo
```

## Components

### Dashboard UI

- [Dashboard](https://github.com/matheusrocha-94/projetolocadora/blob/main/index.html): `index.html`
- [API and charts](https://github.com/matheusrocha-94/projetolocadora/blob/main/assets/js/app.js): `assets/js/app.js`
- [Dashboard layout](https://github.com/matheusrocha-94/projetolocadora/blob/main/index.html): `index.html`

### PHP API

- [Fleet dashboard](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/dashboard.php): `api/dashboard.php`
- [Fleet movements](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/movimentacoes.php): `api/movimentacoes.php`
- [Vehicle status](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/status-veiculos.php): `api/status-veiculos.php`
- [Vehicle registry](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/carros.php): `api/carros.php`
- [Registration history](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/cadastros.php): `api/cadastros.php`
- [Available models](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/modelos.php): `api/modelos.php`
- [JSON bootstrap](https://github.com/matheusrocha-94/projetolocadora/blob/main/api/bootstrap.php): `api/bootstrap.php`

### Data persistence

- [PDO connection](https://github.com/matheusrocha-94/projetolocadora/blob/main/config/database.php): `config/database.php`
- [Fleet data](https://github.com/matheusrocha-94/projetolocadora/blob/main/database/schema.sql): `database/schema.sql`
- [Initial stock](https://github.com/matheusrocha-94/projetolocadora/blob/main/database/seed.sql): `database/seed.sql`
- [Movement schema](https://github.com/matheusrocha-94/projetolocadora/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Fleet operator**

## Connections

- Fleet operator → Dashboard: uses (evidence: `README.md`)
- Dashboard → API and charts: loads scripts (evidence: `README.md`)
- API and charts → Fleet dashboard: fetches dashboard (evidence: `README.md`)
- API and charts → Fleet movements: submits movements (evidence: `README.md`)
- API and charts → Vehicle status: updates status (evidence: `README.md`)
- API and charts → Available models: loads models (evidence: `README.md`)
- Fleet dashboard → JSON bootstrap: requires (evidence: `api/dashboard.php`)
- Fleet movements → JSON bootstrap: requires (evidence: `api/movimentacoes.php`)
- Vehicle status → JSON bootstrap: requires (evidence: `api/status-veiculos.php`)
- Vehicle registry → JSON bootstrap: requires (evidence: `api/carros.php`)
- Registration history → JSON bootstrap: requires (evidence: `api/cadastros.php`)
- Available models → JSON bootstrap: requires (evidence: `api/modelos.php`)
- JSON bootstrap → PDO connection: loads (evidence: `api/bootstrap.php`)
- Fleet dashboard → PDO connection: queries via (evidence: `api/dashboard.php`)
- Fleet movements → PDO connection: reads and writes (evidence: `api/movimentacoes.php`)
- Vehicle status → PDO connection: reads and writes (evidence: `api/status-veiculos.php`)
- Vehicle registry → PDO connection: reads and writes (evidence: `api/carros.php`)
- Registration history → PDO connection: queries via (evidence: `api/cadastros.php`)
- Available models → PDO connection: queries via (evidence: `api/modelos.php`)
- PDO connection → Fleet data: connects to (evidence: `config/database.php`)
- Initial stock → Fleet data: seeds (evidence: `README.md`)
