# luan-pascoal/matchmarcha architecture

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

- Interactive diagram: https://gitdiagram.com/luan-pascoal/matchmarcha
- Repository: https://github.com/luan-pascoal/matchmarcha

## Overview

MatchMarcha is a marketplace for finding driving instructors, managing lesson requests and vehicles, and communicating through chat. The main user journey runs from the React app’s routed pages to the PHP API, where domain controllers validate and handle requests; selected workflows persist data and send realtime notifications. The graph also preserves account, instructor, vehicle, and password-recovery capabilities. Evidence is limited to the README title, tree, source index, and sampled excerpts, so uncertain endpoint-to-controller and model relationships are omitted.

Main entry points: [`web/src/App.jsx`](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/App.jsx) (Application routes), [`api/index.php`](https://github.com/luan-pascoal/matchmarcha/blob/main/api/index.php) (HTTP API), [`app/models/Contato.php`](https://github.com/luan-pascoal/matchmarcha/blob/main/app/models/Contato.php) (Contact data access), [`app/controllers/MensagemController.php`](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/MensagemController.php) (Message operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Application routes<br/>[App.jsx]"]
  node_layout["Shared layout<br/>[AppLayout.jsx]"]
  node_home["Instructor discovery<br/>[HomePage.jsx]"]
  node_signup["Learner signup<br/>[CadastroAluno.jsx]"]
  node_instructor_signup["Instructor signup"]
  node_profile["Profile editing"]
  node_requests["Lesson requests"]
  node_vehicles["Vehicle management<br/>[MeusVeiculos.jsx]"]
  node_chat_ui["Chat interface<br/>[Chat.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_forgot["Password recovery<br/>[EsqueciSenha.jsx]"]
  node_new_password["Reset password<br/>[NovaSenha.jsx]"]
end

subgraph group_api["API and domain"]
  node_api["HTTP API<br/>[index.php]"]
  node_instructor_ctrl["Instructor operations"]
  node_user_ctrl["Account operations"]
  node_request_ctrl["Request operations"]
  node_vehicle_ctrl["Vehicle operations"]
  node_forgot_ctrl["Recovery email flow"]
  node_reset_ctrl["Password reset flow"]
end

subgraph group_messaging["Messaging and realtime"]
  node_message_ctrl["Message operations"]
  node_contact_ctrl["Contact operations"]
  node_pusher_service["Realtime publisher<br/>[PusherService.php]"]
  node_pusher_client["Realtime client<br/>[pusher.js]"]
  node_contact_model["Contact data access<br/>[Contato.php]"]
end

subgraph group_infrastructure["Runtime infrastructure"]
  node_database[("Relational database<br/>[Database.php]")]
  node_mail["Email transport<br/>[PHPMailer.php]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_instructor_signup
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_requests
node_app -->|"routes to"| node_vehicles
node_app -->|"routes to"| node_chat_ui
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_forgot
node_app -->|"routes to"| node_new_password
node_layout -->|"presents interface"| node_user
node_app -->|"fetches vehicles"| node_api
node_api -->|"routes requests"| node_user_ctrl
node_api -->|"routes requests"| node_instructor_ctrl
node_api -.->|"routes requests"| node_forgot_ctrl
node_api -.->|"routes requests"| node_reset_ctrl
node_api -.->|"routes requests"| node_request_ctrl
node_api -.->|"routes requests"| node_vehicle_ctrl
node_message_ctrl -->|"publishes events"| node_pusher_service
node_request_ctrl -->|"publishes events"| node_pusher_service
node_chat_ui -->|"subscribes through"| node_pusher_client
node_contact_ctrl -->|"uses contact data"| node_contact_model
node_message_ctrl -->|"checks contact"| node_contact_model
node_contact_model -->|"queries"| node_database
node_forgot_ctrl -->|"sends recovery mail"| node_mail

click node_app "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/App.jsx"
click node_layout "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/components/layout/AppLayout.jsx"
click node_home "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/Home/HomePage.jsx"
click node_signup "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/CadastroAluno/CadastroAluno.jsx"
click node_instructor_signup "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/CadastroInstrutor/CadastroInstrutor.jsx"
click node_profile "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/EditarPerfil/EditarPerfilInstrutor.jsx"
click node_requests "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/MinhasSolicitacoes/MinhasSolicitacoes.jsx"
click node_vehicles "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/MeusVeiculos/MeusVeiculos.jsx"
click node_chat_ui "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/Chat/Chat.jsx"
click node_login "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/Login/Login.jsx"
click node_forgot "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/EsqueciSenha/EsqueciSenha.jsx"
click node_new_password "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/NovaSenha/NovaSenha.jsx"
click node_api "https://github.com/luan-pascoal/matchmarcha/blob/main/api/index.php"
click node_instructor_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/InstrutorController.php"
click node_user_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/UsuarioController.php"
click node_request_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/SolicitacaoController.php"
click node_vehicle_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/VeiculoController.php"
click node_forgot_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/EsqueciSenhaController.php"
click node_reset_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/NovaSenhaController.php"
click node_message_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/MensagemController.php"
click node_contact_ctrl "https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/ContatoController.php"
click node_pusher_service "https://github.com/luan-pascoal/matchmarcha/blob/main/app/core/PusherService.php"
click node_pusher_client "https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/services/pusher.js"
click node_database "https://github.com/luan-pascoal/matchmarcha/blob/main/app/core/Database.php"
click node_contact_model "https://github.com/luan-pascoal/matchmarcha/blob/main/app/models/Contato.php"
click node_mail "https://github.com/luan-pascoal/matchmarcha/blob/main/app/core/phpmailer/src/PHPMailer.php"

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_layout,node_home,node_signup,node_instructor_signup,node_profile,node_requests,node_vehicles,node_chat_ui,node_login,node_forgot,node_new_password,node_user toneBlue
class node_api,node_instructor_ctrl,node_user_ctrl,node_request_ctrl,node_vehicle_ctrl,node_forgot_ctrl,node_reset_ctrl toneAmber
class node_message_ctrl,node_contact_ctrl,node_pusher_service,node_pusher_client,node_contact_model toneMint
class node_database,node_mail toneRose
```

## Components

### Web application

- [Application routes](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Shared layout](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/components/layout/AppLayout.jsx): `web/src/components/layout/AppLayout.jsx`
- [Instructor discovery](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/Home/HomePage.jsx): `web/src/pages/Home/HomePage.jsx`
- [Learner signup](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/CadastroAluno/CadastroAluno.jsx): `web/src/pages/CadastroAluno/CadastroAluno.jsx`
- [Instructor signup](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/CadastroInstrutor/CadastroInstrutor.jsx): `web/src/pages/CadastroInstrutor/CadastroInstrutor.jsx`
- [Profile editing](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/EditarPerfil/EditarPerfilInstrutor.jsx): `web/src/pages/EditarPerfil/EditarPerfilInstrutor.jsx`
- [Lesson requests](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/MinhasSolicitacoes/MinhasSolicitacoes.jsx): `web/src/pages/MinhasSolicitacoes/MinhasSolicitacoes.jsx`
- [Vehicle management](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/MeusVeiculos/MeusVeiculos.jsx): `web/src/pages/MeusVeiculos/MeusVeiculos.jsx`
- [Chat interface](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/Chat/Chat.jsx): `web/src/pages/Chat/Chat.jsx`
- [Login](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/Login/Login.jsx): `web/src/pages/Login/Login.jsx`
- [Password recovery](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/EsqueciSenha/EsqueciSenha.jsx): `web/src/pages/EsqueciSenha/EsqueciSenha.jsx`
- [Reset password](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/pages/NovaSenha/NovaSenha.jsx): `web/src/pages/NovaSenha/NovaSenha.jsx`

### API and domain

- [HTTP API](https://github.com/luan-pascoal/matchmarcha/blob/main/api/index.php): `api/index.php`
- [Instructor operations](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/InstrutorController.php): `app/controllers/InstrutorController.php`
- [Account operations](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/UsuarioController.php): `app/controllers/UsuarioController.php`
- [Request operations](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/SolicitacaoController.php): `app/controllers/SolicitacaoController.php`
- [Vehicle operations](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/VeiculoController.php): `app/controllers/VeiculoController.php`
- [Recovery email flow](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/EsqueciSenhaController.php): `app/controllers/EsqueciSenhaController.php`
- [Password reset flow](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/NovaSenhaController.php): `app/controllers/NovaSenhaController.php`

### Messaging and realtime

- [Message operations](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/MensagemController.php): `app/controllers/MensagemController.php`
- [Contact operations](https://github.com/luan-pascoal/matchmarcha/blob/main/app/controllers/ContatoController.php): `app/controllers/ContatoController.php`
- [Realtime publisher](https://github.com/luan-pascoal/matchmarcha/blob/main/app/core/PusherService.php): `app/core/PusherService.php`
- [Realtime client](https://github.com/luan-pascoal/matchmarcha/blob/main/web/src/services/pusher.js): `web/src/services/pusher.js`
- [Contact data access](https://github.com/luan-pascoal/matchmarcha/blob/main/app/models/Contato.php): `app/models/Contato.php`

### Runtime infrastructure

- [Relational database](https://github.com/luan-pascoal/matchmarcha/blob/main/app/core/Database.php): `app/core/Database.php`
- [Email transport](https://github.com/luan-pascoal/matchmarcha/blob/main/app/core/phpmailer/src/PHPMailer.php): `app/core/phpmailer/src/PHPMailer.php`

### Other components

- **User**

## Connections

- User → Application routes: uses (evidence: `web/src/App.jsx`)
- Application routes → Instructor discovery: routes to (evidence: `web/src/App.jsx`)
- Application routes → Learner signup: routes to (evidence: `web/src/App.jsx`)
- Application routes → Instructor signup: routes to (evidence: `web/src/App.jsx`)
- Application routes → Profile editing: routes to (evidence: `web/src/App.jsx`)
- Application routes → Lesson requests: routes to (evidence: `web/src/App.jsx`)
- Application routes → Vehicle management: routes to (evidence: `web/src/App.jsx`)
- Application routes → Chat interface: routes to (evidence: `web/src/App.jsx`)
- Application routes → Login: routes to (evidence: `web/src/App.jsx`)
- Application routes → Password recovery: routes to (evidence: `web/src/App.jsx`)
- Application routes → Reset password: routes to (evidence: `web/src/App.jsx`)
- Shared layout → User: presents interface (evidence: `web/src/components/layout/AppLayout.jsx`)
- Application routes → HTTP API: fetches vehicles (evidence: `web/src/App.jsx`)
- HTTP API → Account operations: routes requests (evidence: `api/index.php`)
- HTTP API → Instructor operations: routes requests (evidence: `api/index.php`)
- HTTP API → Recovery email flow: routes requests (evidence: `api/index.php`)
- HTTP API → Password reset flow: routes requests (evidence: `api/index.php`)
- HTTP API → Request operations: routes requests (evidence: `api/index.php`)
- HTTP API → Vehicle operations: routes requests (evidence: `api/index.php`)
- Message operations → Realtime publisher: publishes events (evidence: `app/controllers/MensagemController.php`)
- Request operations → Realtime publisher: publishes events (evidence: `app/controllers/SolicitacaoController.php`)
- Chat interface → Realtime client: subscribes through (evidence: `web/src/pages/Chat/Chat.jsx`)
- Contact operations → Contact data access: uses contact data (evidence: `app/controllers/ContatoController.php`)
- Message operations → Contact data access: checks contact (evidence: `app/controllers/MensagemController.php`)
- Contact data access → Relational database: queries (evidence: `app/models/Contato.php`)
- Recovery email flow → Email transport: sends recovery mail (evidence: `app/controllers/EsqueciSenhaController.php`)
