# santifonzalida/geo-baches architecture

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

- Interactive diagram: https://gitdiagram.com/santifonzalida/geo-baches
- Repository: https://github.com/santifonzalida/geo-baches

## Overview

Geo Baches is a public pothole-reporting and map application with an administrative review panel. Residents browse approved reports, submit reports with location and optional photos, and confirm whether a pothole remains; administrators review pending reports, update status, and manage contact messages. The sampled frontend and backend sources show these capabilities and their main internal layers. Some modules are indexed but unsampled, so their internal behavior and specific frontend-to-backend links are omitted or left unverified.

Main entry points: [`frontend/src/app/services/baches.service.ts`](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/services/baches.service.ts) (Report client), [`frontend/src/app/components/mapa/mapa.component.ts`](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/mapa/mapa.component.ts) (Map and detail), [`frontend/src/app/components/admin-dashboard/admin-dashboard.component.ts`](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/admin-dashboard/admin-dashboard.component.ts) (Admin dashboard), [`backend/src/baches/baches.controller.ts`](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/baches.controller.ts) (Reports API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public map"]
  node_map_ui["Map and detail<br/>[mapa.component.ts]"]
  node_report_ui["Report entry<br/>[mapa.component.ts]"]
  node_bache_client["Report client<br/>[baches.service.ts]"]
  node_bache_model["Report model<br/>[bache.model.ts]"]
  node_contact_ui["About and contact"]
end

subgraph group_admin["Admin tools"]
  node_admin_dashboard["Admin dashboard"]
  node_pending_ui["Pending review"]
  node_login_ui["Admin login<br/>[login.component.ts]"]
  node_frontend_auth["Frontend auth<br/>[auth.service.ts]"]
end

subgraph group_backend["Backend services"]
  node_auth_api["Authentication API<br/>[auth.controller.ts]"]
  node_users["User and roles"]
  node_bache_api["Reports API"]
  node_report_service["Report operations<br/>[baches.service.ts]"]
  node_confirmations["Confirmations"]
  node_contact_api["Contact messages"]
  node_geocoding["Reverse geocoding"]
end

subgraph group_data["Data and integrations"]
  node_report_data[("Report records<br/>[bache.entity.ts]")]
  node_photo_service["Photo handling<br/>[fotos.service.ts]"]
  node_storage["Photo storage<br/>[storage.service.ts]"]
  node_postgres[("PostgreSQL")]
end

node_resident(("Resident"))
node_admin_user(("Administrator"))
node_s3[("S3-compatible bucket")]
node_nominatim["Nominatim"]

node_resident -->|"browses"| node_map_ui
node_map_ui -->|"loads reports"| node_bache_client
node_report_ui -.->|"submits report"| node_bache_client
node_bache_client -->|"maps data"| node_bache_model
node_map_ui -->|"renders reports"| node_bache_model
node_map_ui -.->|"sends confirmations"| node_bache_client
node_contact_ui -.->|"sends message"| node_contact_api
node_admin_user -->|"signs in"| node_login_ui
node_login_ui -.->|"requests login"| node_frontend_auth
node_frontend_auth -.->|"requests token"| node_auth_api
node_auth_api -->|"finds account"| node_users
node_admin_user -->|"manages reports"| node_admin_dashboard
node_admin_dashboard -->|"loads summaries"| node_bache_client
node_pending_ui -->|"reviews reports"| node_bache_client
node_admin_dashboard -.->|"loads messages"| node_contact_api
node_bache_client -.->|"calls reports API"| node_bache_api
node_bache_api -->|"delegates operations"| node_report_service
node_bache_api -->|"stores uploaded photo"| node_photo_service
node_report_service -.->|"manages reports"| node_report_data
node_confirmations -->|"uses report entities"| node_report_data
node_bache_client -.->|"requests address"| node_geocoding
node_geocoding -.->|"queries"| node_nominatim
node_photo_service -.->|"stores and retrieves"| node_storage
node_storage -->|"uses when configured"| node_s3
node_report_data -.->|"persists in"| node_postgres
node_contact_api -.->|"stores messages"| node_postgres

click node_map_ui "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/mapa/mapa.component.ts"
click node_report_ui "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/mapa/mapa.component.ts"
click node_bache_client "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/services/baches.service.ts"
click node_bache_model "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/models/bache.model.ts"
click node_contact_ui "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/acerca-de/acerca-de.component.ts"
click node_admin_dashboard "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/admin-dashboard/admin-dashboard.component.ts"
click node_pending_ui "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/admin-pendientes/admin-pendientes.component.ts"
click node_login_ui "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/login/login.component.ts"
click node_frontend_auth "https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/services/auth.service.ts"
click node_auth_api "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/auth/auth.controller.ts"
click node_users "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/usuarios/usuarios.service.ts"
click node_bache_api "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/baches.controller.ts"
click node_report_service "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/baches.service.ts"
click node_confirmations "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/confirmaciones.controller.ts"
click node_contact_api "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/contacto/contacto.controller.ts"
click node_geocoding "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/geocoding/geocoding.service.ts"
click node_report_data "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/entities/bache.entity.ts"
click node_photo_service "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/fotos.service.ts"
click node_storage "https://github.com/santifonzalida/geo-baches/blob/main/backend/src/storage/storage.service.ts"

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_map_ui,node_report_ui,node_bache_client,node_bache_model,node_contact_ui toneBlue
class node_admin_dashboard,node_pending_ui,node_login_ui,node_frontend_auth,node_s3 toneAmber
class node_auth_api,node_users,node_bache_api,node_report_service,node_confirmations,node_contact_api,node_geocoding toneMint
class node_report_data,node_photo_service,node_storage,node_postgres toneRose
class node_resident,node_admin_user,node_nominatim toneIndigo
```

## Components

### Public map

- [Map and detail](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/mapa/mapa.component.ts): `frontend/src/app/components/mapa/mapa.component.ts`
- [Report entry](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/mapa/mapa.component.ts): `frontend/src/app/components/mapa/mapa.component.ts`
- [Report client](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/services/baches.service.ts): `frontend/src/app/services/baches.service.ts`
- [Report model](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/models/bache.model.ts): `frontend/src/app/models/bache.model.ts`
- [About and contact](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/acerca-de/acerca-de.component.ts): `frontend/src/app/components/acerca-de/acerca-de.component.ts`

### Admin tools

- [Admin dashboard](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/admin-dashboard/admin-dashboard.component.ts): `frontend/src/app/components/admin-dashboard/admin-dashboard.component.ts`
- [Pending review](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/admin-pendientes/admin-pendientes.component.ts): `frontend/src/app/components/admin-pendientes/admin-pendientes.component.ts`
- [Admin login](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/components/login/login.component.ts): `frontend/src/app/components/login/login.component.ts`
- [Frontend auth](https://github.com/santifonzalida/geo-baches/blob/main/frontend/src/app/services/auth.service.ts): `frontend/src/app/services/auth.service.ts`

### Backend services

- [Authentication API](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/auth/auth.controller.ts): `backend/src/auth/auth.controller.ts`
- [User and roles](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/usuarios/usuarios.service.ts): `backend/src/usuarios/usuarios.service.ts`
- [Reports API](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/baches.controller.ts): `backend/src/baches/baches.controller.ts`
- [Report operations](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/baches.service.ts): `backend/src/baches/baches.service.ts`
- [Confirmations](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/confirmaciones.controller.ts): `backend/src/baches/confirmaciones.controller.ts`
- [Contact messages](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/contacto/contacto.controller.ts): `backend/src/contacto/contacto.controller.ts`
- [Reverse geocoding](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/geocoding/geocoding.service.ts): `backend/src/geocoding/geocoding.service.ts`

### Data and integrations

- [Report records](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/entities/bache.entity.ts): `backend/src/baches/entities/bache.entity.ts`
- [Photo handling](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/baches/fotos.service.ts): `backend/src/baches/fotos.service.ts`
- [Photo storage](https://github.com/santifonzalida/geo-baches/blob/main/backend/src/storage/storage.service.ts): `backend/src/storage/storage.service.ts`
- **PostgreSQL**

### Other components

- **Resident**
- **Administrator**
- **S3-compatible bucket**
- **Nominatim**

## Connections

- Resident → Map and detail: browses
- Map and detail → Report client: loads reports (evidence: `frontend/src/app/components/mapa/mapa.component.ts`)
- Report entry → Report client: submits report (evidence: `frontend/src/app/components/mapa/mapa.component.ts`)
- Report client → Report model: maps data (evidence: `frontend/src/app/services/baches.service.ts`)
- Map and detail → Report model: renders reports (evidence: `frontend/src/app/components/mapa/mapa.component.ts`)
- Map and detail → Report client: sends confirmations (evidence: `frontend/src/app/components/mapa/mapa.component.ts`)
- About and contact → Contact messages: sends message
- Administrator → Admin login: signs in
- Admin login → Frontend auth: requests login
- Frontend auth → Authentication API: requests token
- Authentication API → User and roles: finds account
- Administrator → Admin dashboard: manages reports
- Admin dashboard → Report client: loads summaries (evidence: `frontend/src/app/components/admin-dashboard/admin-dashboard.component.ts`)
- Pending review → Report client: reviews reports (evidence: `frontend/src/app/components/admin-pendientes/admin-pendientes.component.ts`)
- Admin dashboard → Contact messages: loads messages
- Report client → Reports API: calls reports API
- Reports API → Report operations: delegates operations (evidence: `backend/src/baches/baches.controller.ts`)
- Reports API → Photo handling: stores uploaded photo (evidence: `backend/src/baches/baches.controller.ts`)
- Report operations → Report records: manages reports
- Confirmations → Report records: uses report entities
- Report client → Reverse geocoding: requests address
- Reverse geocoding → Nominatim: queries
- Photo handling → Photo storage: stores and retrieves
- Photo storage → S3-compatible bucket: uses when configured (evidence: `backend/src/storage/storage.service.ts`)
- Report records → PostgreSQL: persists in
- Contact messages → PostgreSQL: stores messages
