# eelhuevo/mapainteractivo architecture

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

- Interactive diagram: https://gitdiagram.com/eelhuevo/mapainteractivo
- Repository: https://github.com/eelhuevo/mapainteractivo

## Overview

UniMap is a campus-mapping application: users authenticate or enter as guests, then explore campus spaces in a searchable, filterable 2D map or 3D viewer, with schedules, routes, QR codes, and favorites. The browser client gets visible campus data from the Laravel REST API; Supabase/PostGIS is the shared persistence layer. The graph preserves the documented feature branches, but source excerpts are partial, so it avoids inferring detailed frontend call chains or unsampled controller behavior.

Main entry points: [`frontend/js/core/api.js`](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/core/api.js) (API client), [`backend/routes/api.php`](https://github.com/eelhuevo/mapainteractivo/blob/main/backend/routes/api.php) (API routes), [`backend/app/Models`](https://github.com/eelhuevo/mapainteractivo/tree/main/backend/app/Models) (Campus and user models), [`frontend/js/app.js`](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/app.js) (Map application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Map application<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_explore["Campus exploration"]
  node_map2d["2D canvas<br/>[map2d.js]"]
  node_search["Search and filters<br/>[busqueda.js]"]
  node_viewer3d["3D viewer<br/>[viewer3d.js]"]
  node_schedules["Schedules<br/>[horarios.js]"]
  node_favorites["Favorites<br/>[favoritos.js]"]
  node_routes["Pedestrian routes<br/>[ruta.js]"]
  node_qr["QR codes<br/>[qr.js]"]
  node_suggestions["Space suggestions<br/>[sugerencias.js]"]
end

subgraph group_api["REST API"]
  node_api_routes["API routes<br/>[api.php]"]
  node_auth_api["Authentication API<br/>[AuthController.php]"]
  node_space_api["Space API"]
  node_building_api["Building API"]
  node_route_api["Route API<br/>[RutaController.php]"]
  node_admin_api["Admin management"]
end

subgraph group_domain["Campus domain"]
  node_domain_models["Campus and user models"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase / PostGIS")]

node_visitor -->|"opens"| node_webapp
node_webapp -->|"offers access"| node_auth
node_webapp -->|"shows map"| node_map2d
node_webapp -->|"switches view"| node_viewer3d
node_api_client -->|"requests data"| node_api_routes
node_api_routes -->|"routes to"| node_auth_api
node_api_routes -->|"routes to"| node_space_api
node_api_routes -->|"routes to"| node_building_api
node_api_routes -->|"routes to"| node_route_api
node_api_routes -->|"routes to"| node_admin_api
node_auth_api -->|"uses accounts"| node_domain_models
node_space_api -->|"queries spaces"| node_domain_models
node_building_api -->|"queries buildings"| node_domain_models
node_route_api -->|"loads destination"| node_domain_models
node_admin_api -->|"manages records"| node_domain_models
node_domain_models -->|"persists data"| node_supabase
node_search -.->|"uses campus data"| node_api_client
node_schedules -.->|"loads schedules"| node_api_client
node_favorites -.->|"syncs favorites"| node_api_client
node_routes -.->|"requests routes"| node_api_client
node_qr -.->|"requests codes"| node_api_client
node_suggestions -.->|"loads suggestions"| node_api_client

click node_webapp "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/app.js"
click node_auth "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/auth/auth.js"
click node_api_client "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/core/api.js"
click node_map2d "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/map2d.js"
click node_search "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/busqueda.js"
click node_viewer3d "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/view3d/viewer3d.js"
click node_schedules "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/horarios.js"
click node_favorites "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/favoritos.js"
click node_routes "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/ruta.js"
click node_qr "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/qr.js"
click node_suggestions "https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/sugerencias.js"
click node_api_routes "https://github.com/eelhuevo/mapainteractivo/blob/main/backend/routes/api.php"
click node_auth_api "https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/AuthController.php"
click node_space_api "https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/EspacioController.php"
click node_building_api "https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/EdificioController.php"
click node_route_api "https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/RutaController.php"
click node_admin_api "https://github.com/eelhuevo/mapainteractivo/tree/main/backend/app/Http/Controllers/Api/Admin"
click node_domain_models "https://github.com/eelhuevo/mapainteractivo/tree/main/backend/app/Models"

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_api_client toneBlue
class node_map2d,node_search,node_viewer3d,node_schedules,node_favorites,node_routes,node_qr,node_suggestions,node_supabase toneAmber
class node_api_routes,node_auth_api,node_space_api,node_building_api,node_route_api,node_admin_api toneMint
class node_domain_models toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [Map application](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Authentication](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/auth/auth.js): `frontend/js/auth/auth.js`
- [API client](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/core/api.js): `frontend/js/core/api.js`

### Campus exploration

- [2D canvas](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/map2d.js): `frontend/js/map/map2d.js`
- [Search and filters](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/busqueda.js): `frontend/js/map/busqueda.js`
- [3D viewer](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/view3d/viewer3d.js): `frontend/js/view3d/viewer3d.js`
- [Schedules](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/horarios.js): `frontend/js/map/horarios.js`
- [Favorites](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/favoritos.js): `frontend/js/map/favoritos.js`
- [Pedestrian routes](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/ruta.js): `frontend/js/map/ruta.js`
- [QR codes](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/qr.js): `frontend/js/map/qr.js`
- [Space suggestions](https://github.com/eelhuevo/mapainteractivo/blob/main/frontend/js/map/sugerencias.js): `frontend/js/map/sugerencias.js`

### REST API

- [API routes](https://github.com/eelhuevo/mapainteractivo/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Authentication API](https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/AuthController.php): `backend/app/Http/Controllers/Api/AuthController.php`
- [Space API](https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/EspacioController.php): `backend/app/Http/Controllers/Api/EspacioController.php`
- [Building API](https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/EdificioController.php): `backend/app/Http/Controllers/Api/EdificioController.php`
- [Route API](https://github.com/eelhuevo/mapainteractivo/blob/main/backend/app/Http/Controllers/Api/RutaController.php): `backend/app/Http/Controllers/Api/RutaController.php`
- [Admin management](https://github.com/eelhuevo/mapainteractivo/tree/main/backend/app/Http/Controllers/Api/Admin): `backend/app/Http/Controllers/Api/Admin`

### Campus domain

- [Campus and user models](https://github.com/eelhuevo/mapainteractivo/tree/main/backend/app/Models): `backend/app/Models`

### Other components

- **Visitor**
- **Supabase / PostGIS**

## Connections

- Visitor → Map application: opens (evidence: `README.md`)
- Map application → Authentication: offers access (evidence: `README.md`)
- Map application → 2D canvas: shows map (evidence: `README.md`)
- Map application → 3D viewer: switches view (evidence: `README.md`)
- API client → API routes: requests data (evidence: `README.md`)
- API routes → Authentication API: routes to (evidence: `backend/routes/api.php`)
- API routes → Space API: routes to (evidence: `backend/routes/api.php`)
- API routes → Building API: routes to (evidence: `backend/routes/api.php`)
- API routes → Route API: routes to (evidence: `backend/routes/api.php`)
- API routes → Admin management: routes to (evidence: `backend/routes/api.php`)
- Authentication API → Campus and user models: uses accounts (evidence: `backend/app/Http/Controllers/Api/AuthController.php`)
- Space API → Campus and user models: queries spaces (evidence: `backend/app/Http/Controllers/Api/EspacioController.php`)
- Building API → Campus and user models: queries buildings (evidence: `backend/app/Http/Controllers/Api/EdificioController.php`)
- Route API → Campus and user models: loads destination (evidence: `backend/app/Http/Controllers/Api/RutaController.php`)
- Admin management → Campus and user models: manages records (evidence: `backend/app/Http/Controllers/Api/Admin/AdminEspacioController.php`)
- Campus and user models → Supabase / PostGIS: persists data (evidence: `README.md`)
- Search and filters → API client: uses campus data
- Schedules → API client: loads schedules
- Favorites → API client: syncs favorites
- Pedestrian routes → API client: requests routes
- QR codes → API client: requests codes
- Space suggestions → API client: loads suggestions
