# wandersonelias/alexaimoveis architecture

> Architecture diagram of the GitHub repository wandersonelias/alexaimoveis, 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/wandersonelias/alexaimoveis
- Repository: https://github.com/wandersonelias/alexaimoveis

## Overview

Alexaimoveis combines a web manager for users, properties and viewing appointments with an API and an Alexa voice-search channel for available properties. The main workflow is a web or voice request reaching an API route, then a controller and repository querying domain models backed by MySQL. The README describes the accessibility goal and Alexa integration; sampled code confirms API routing and the Alexa property-search implementation. Frontend-to-API request wiring and the Alexa skill implementation are not shown, so those connections are not inferred.

Main entry points: [`backend/src/app.js`](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/app.js) (HTTP API), [`frontend/src/routes.jsx`](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/routes.jsx) (Web page routes), [`backend/src/controllers/authController.js`](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/authController.js) (Authentication), [`backend/src/repositories/userRepository.js`](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/userRepository.js) (User queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web management"]
  node_manager["Web manager<br/>[App.jsx]"]
  node_web_routes["Web page routes<br/>[routes.jsx]"]
  node_property_ui["Property pages<br/>[imoveis.jsx]"]
  node_appointment_ui["Appointment pages<br/>[agendamentos.jsx]"]
  node_user_ui["User pages<br/>[usuarios.jsx]"]
  node_property_details["Property details<br/>[ImoveisDetalhe.jsx]"]
  node_appointment_details["Appointment details"]
  node_user_details["User details"]
end

subgraph group_api["API and access"]
  node_api_app["HTTP API<br/>[app.js]"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_auth_middleware["Token authorization<br/>[authMiddleware.js]"]
end

subgraph group_domain["Property services"]
  node_property_controller["Property operations"]
  node_appointment_controller["Appointment operations"]
  node_user_controller["User operations<br/>[userController.js]"]
  node_alexa_controller["Voice property search<br/>[alexaController.js]"]
  node_property_repo["Property queries"]
  node_appointment_repo["Appointment queries"]
  node_user_repo["User queries<br/>[userRepository.js]"]
  node_alexa_repo["Voice search queries<br/>[alexaRepository.js]"]
end

subgraph group_data["Persistence"]
  node_property_model["Property records<br/>[imovelModel.js]"]
  node_appointment_model["Appointment records"]
  node_user_model["User records<br/>[userModel.js]"]
  node_mysql[("MySQL database<br/>[db.js]")]
end

node_web_user(("Web user"))
node_alexa(("Alexa voice interface"))

node_web_user -->|"uses"| node_manager
node_manager -->|"routes pages"| node_web_routes
node_web_routes -->|"routes to"| node_property_details
node_web_routes -->|"routes to"| node_appointment_details
node_web_routes -->|"routes to"| node_user_details
node_api_app -->|"routes requests"| node_auth_controller
node_api_app -->|"routes requests"| node_property_controller
node_api_app -->|"routes requests"| node_appointment_controller
node_api_app -->|"routes requests"| node_user_controller
node_api_app -->|"routes searches"| node_alexa_controller
node_auth_controller -->|"looks up users"| node_user_repo
node_auth_middleware -->|"checks blacklist"| node_auth_controller
node_property_controller -->|"queries properties"| node_property_repo
node_appointment_controller -->|"manages appointments"| node_appointment_repo
node_user_controller -->|"manages users"| node_user_repo
node_alexa_controller -->|"searches properties"| node_alexa_repo
node_property_repo -->|"queries records"| node_property_model
node_appointment_repo -->|"queries records"| node_appointment_model
node_user_repo -->|"queries records"| node_user_model
node_alexa_repo -->|"filters availability"| node_property_model
node_property_model -->|"uses connection"| node_mysql
node_appointment_model -->|"uses connection"| node_mysql
node_user_model -->|"uses connection"| node_mysql
node_alexa -.->|"voice integration"| node_api_app

click node_manager "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/App.jsx"
click node_web_routes "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/routes.jsx"
click node_property_ui "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/imoveis.jsx"
click node_appointment_ui "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/agendamentos.jsx"
click node_user_ui "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/usuarios.jsx"
click node_property_details "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/Detalhes/ImoveisDetalhe.jsx"
click node_appointment_details "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/Detalhes/AgendamentoDetalhe.jsx"
click node_user_details "https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/Detalhes/UsuariosDetalhe.jsx"
click node_api_app "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/app.js"
click node_auth_controller "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/authController.js"
click node_auth_middleware "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/middlewares/authMiddleware.js"
click node_property_controller "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/imovelController.js"
click node_appointment_controller "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/agendamentoController.js"
click node_user_controller "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/userController.js"
click node_alexa_controller "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/alexaController.js"
click node_property_repo "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/imovelRepository.js"
click node_appointment_repo "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/agendamentoRepository.js"
click node_user_repo "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/userRepository.js"
click node_alexa_repo "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/alexaRepository.js"
click node_property_model "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/models/imovelModel.js"
click node_appointment_model "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/models/agendamentoModel.js"
click node_user_model "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/models/userModel.js"
click node_mysql "https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/db.js"

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_manager,node_web_routes,node_property_ui,node_appointment_ui,node_user_ui,node_property_details,node_appointment_details,node_user_details,node_web_user toneBlue
class node_api_app,node_auth_controller,node_auth_middleware toneAmber
class node_property_controller,node_appointment_controller,node_user_controller,node_alexa_controller,node_property_repo,node_appointment_repo,node_user_repo,node_alexa_repo toneMint
class node_property_model,node_appointment_model,node_user_model,node_mysql toneRose
class node_alexa toneIndigo
```

## Components

### Web management

- [Web manager](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Web page routes](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/routes.jsx): `frontend/src/routes.jsx`
- [Property pages](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/imoveis.jsx): `frontend/src/pages/dashboard/imoveis.jsx`
- [Appointment pages](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/agendamentos.jsx): `frontend/src/pages/dashboard/agendamentos.jsx`
- [User pages](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/usuarios.jsx): `frontend/src/pages/dashboard/usuarios.jsx`
- [Property details](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/Detalhes/ImoveisDetalhe.jsx): `frontend/src/pages/dashboard/Detalhes/ImoveisDetalhe.jsx`
- [Appointment details](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/Detalhes/AgendamentoDetalhe.jsx): `frontend/src/pages/dashboard/Detalhes/AgendamentoDetalhe.jsx`
- [User details](https://github.com/wandersonelias/alexaimoveis/blob/master/frontend/src/pages/dashboard/Detalhes/UsuariosDetalhe.jsx): `frontend/src/pages/dashboard/Detalhes/UsuariosDetalhe.jsx`

### API and access

- [HTTP API](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/app.js): `backend/src/app.js`
- [Authentication](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Token authorization](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/middlewares/authMiddleware.js): `backend/src/middlewares/authMiddleware.js`

### Property services

- [Property operations](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/imovelController.js): `backend/src/controllers/imovelController.js`
- [Appointment operations](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/agendamentoController.js): `backend/src/controllers/agendamentoController.js`
- [User operations](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/userController.js): `backend/src/controllers/userController.js`
- [Voice property search](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/controllers/alexaController.js): `backend/src/controllers/alexaController.js`
- [Property queries](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/imovelRepository.js): `backend/src/repositories/imovelRepository.js`
- [Appointment queries](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/agendamentoRepository.js): `backend/src/repositories/agendamentoRepository.js`
- [User queries](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/userRepository.js): `backend/src/repositories/userRepository.js`
- [Voice search queries](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/repositories/alexaRepository.js): `backend/src/repositories/alexaRepository.js`

### Persistence

- [Property records](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/models/imovelModel.js): `backend/src/models/imovelModel.js`
- [Appointment records](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/models/agendamentoModel.js): `backend/src/models/agendamentoModel.js`
- [User records](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/models/userModel.js): `backend/src/models/userModel.js`
- [MySQL database](https://github.com/wandersonelias/alexaimoveis/blob/master/backend/src/db.js): `backend/src/db.js`

### Other components

- **Web user**
- **Alexa voice interface**

## Connections

- Web user → Web manager: uses (evidence: `README.md`)
- Web manager → Web page routes: routes pages (evidence: `frontend/src/App.jsx`)
- Web page routes → Property details: routes to (evidence: `frontend/src/routes.jsx`)
- Web page routes → Appointment details: routes to (evidence: `frontend/src/routes.jsx`)
- Web page routes → User details: routes to (evidence: `frontend/src/routes.jsx`)
- HTTP API → Authentication: routes requests (evidence: `backend/src/app.js`)
- HTTP API → Property operations: routes requests (evidence: `backend/src/app.js`)
- HTTP API → Appointment operations: routes requests (evidence: `backend/src/app.js`)
- HTTP API → User operations: routes requests (evidence: `backend/src/app.js`)
- HTTP API → Voice property search: routes searches (evidence: `backend/src/app.js`)
- Authentication → User queries: looks up users (evidence: `backend/src/controllers/authController.js`)
- Token authorization → Authentication: checks blacklist (evidence: `backend/src/middlewares/authMiddleware.js`)
- Property operations → Property queries: queries properties (evidence: `backend/src/controllers/imovelController.js`)
- Appointment operations → Appointment queries: manages appointments (evidence: `backend/src/controllers/agendamentoController.js`)
- User operations → User queries: manages users (evidence: `backend/src/controllers/userController.js`)
- Voice property search → Voice search queries: searches properties (evidence: `backend/src/controllers/alexaController.js`)
- Property queries → Property records: queries records (evidence: `backend/src/repositories/imovelRepository.js`)
- Appointment queries → Appointment records: queries records (evidence: `backend/src/repositories/agendamentoRepository.js`)
- User queries → User records: queries records (evidence: `backend/src/repositories/userRepository.js`)
- Voice search queries → Property records: filters availability (evidence: `backend/src/repositories/alexaRepository.js`)
- Property records → MySQL database: uses connection (evidence: `backend/src/models/imovelModel.js`)
- Appointment records → MySQL database: uses connection (evidence: `backend/src/models/agendamentoModel.js`)
- User records → MySQL database: uses connection (evidence: `backend/src/models/userModel.js`)
- Alexa voice interface → HTTP API: voice integration (evidence: `README.md`)
