# clubtecla/tijuana-reporta architecture

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

- Interactive diagram: https://gitdiagram.com/clubtecla/tijuana-reporta
- Repository: https://github.com/clubtecla/tijuana-reporta

## Overview

Tijuana Reporta permite consultar incidencias en un mapa y crear reportes; la app móvil también ofrece autenticación y el backend expone autenticación y comentarios. El flujo de creación móvil llega desde la pantalla al hook de envío y a la capa HTTP de reportes. La evidencia disponible no muestra las implementaciones completas del mapa, la API de reportes ni los servicios de backend, así que sus conexiones internas se omiten. El README documenta además confirmación comunitaria e integración opcional con Google.

Main entry points: [`backend/cmd/api/main.go`](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/cmd/api/main.go) (Servidor API), [`frontend-mobile/app/(main)/_layout.tsx`](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/_layout.tsx) (App móvil), [`frontend-mobile/app/index.tsx`](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/index.tsx) (Bienvenida), [`frontend-web/src/App.tsx`](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-web/src/App.tsx) (Web React)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clientes"]
  node_mobile["App móvil<br/>[_layout.tsx]"]
  node_welcome["Bienvenida<br/>[index.tsx]"]
  node_web_app["Web React<br/>[App.tsx]"]
end

subgraph group_reporting["Incidencias"]
  node_mobile_report["Crear reporte<br/>[crear-reporte.tsx]"]
  node_create_hook["Flujo de envío<br/>[useCrearReporte.ts]"]
  node_report_mutation["Mutación reporte<br/>[hooks.ts]"]
  node_report_api["API reportes<br/>[api.ts]"]
  node_http_adapter["Adaptador HTTP<br/>[http.ts]"]
  node_map_mobile["Mapa móvil<br/>[index.tsx]"]
  node_web_map["Mapa web<br/>[MapContainer.tsx]"]
end

subgraph group_backend["API backend"]
  node_api_server["Servidor API<br/>[main.go]"]
  node_auth_handler["Manejadores auth<br/>[auth_handler.go]"]
  node_comments_handler["Manejador comentarios"]
  node_auth_service["Servicio auth<br/>[auth.go]"]
  node_comments_service["Servicio comentarios<br/>[comentario.go]"]
  node_middleware["Middleware auth<br/>[middleware.go]"]
end

subgraph group_persistence["Persistencia"]
  node_store["Store SQL<br/>[store.go]"]
  node_postgres[("PostgreSQL<br/>[postgres.go]")]
end

node_resident(("Ciudadano"))
node_google{{"Google OAuth"}}

node_resident -->|"inicia"| node_welcome
node_welcome -->|"navega"| node_mobile
node_resident -->|"completa"| node_mobile_report
node_mobile_report -->|"envía datos"| node_create_hook
node_create_hook -->|"ejecuta"| node_report_mutation
node_report_mutation -->|"solicita"| node_report_api
node_report_api -->|"usa"| node_http_adapter
node_mobile -->|"muestra"| node_map_mobile
node_resident -->|"consulta"| node_web_app
node_web_app -->|"renderiza"| node_web_map
node_api_server -->|"registra rutas"| node_auth_handler
node_api_server -->|"registra rutas"| node_comments_handler
node_api_server -->|"construye"| node_auth_service
node_api_server -->|"construye"| node_comments_service
node_api_server -->|"registra"| node_middleware
node_auth_handler -->|"invoca"| node_auth_service
node_comments_handler -->|"invoca"| node_comments_service
node_api_server -->|"crea"| node_store
node_api_server -->|"conecta"| node_postgres
node_resident -.->|"autentica opcionalmente"| node_google

click node_mobile "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/_layout.tsx"
click node_welcome "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/index.tsx"
click node_mobile_report "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/crear-reporte.tsx"
click node_create_hook "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/useCrearReporte.ts"
click node_report_mutation "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/hooks.ts"
click node_report_api "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/api.ts"
click node_http_adapter "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/http.ts"
click node_map_mobile "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/index.tsx"
click node_web_app "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-web/src/App.tsx"
click node_web_map "https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-web/src/components/MapContainer.tsx"
click node_api_server "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/cmd/api/main.go"
click node_auth_handler "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/api/auth_handler.go"
click node_comments_handler "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/api/comentarios_handler.go"
click node_auth_service "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/service/auth.go"
click node_comments_service "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/service/comentario.go"
click node_middleware "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/middleware/middleware.go"
click node_store "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/database/store.go"
click node_postgres "https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/database/postgres.go"

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_mobile,node_welcome,node_web_app toneBlue
class node_mobile_report,node_create_hook,node_report_mutation,node_report_api,node_http_adapter,node_map_mobile,node_web_map toneAmber
class node_api_server,node_auth_handler,node_comments_handler,node_auth_service,node_comments_service,node_middleware toneMint
class node_store,node_postgres toneRose
class node_resident,node_google toneIndigo
```

## Components

### Clientes

- [App móvil](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/_layout.tsx): `frontend-mobile/app/(main)/_layout.tsx`
- [Bienvenida](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/index.tsx): `frontend-mobile/app/index.tsx`
- [Web React](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-web/src/App.tsx): `frontend-web/src/App.tsx`

### Incidencias

- [Crear reporte](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/crear-reporte.tsx): `frontend-mobile/app/(main)/crear-reporte.tsx`
- [Flujo de envío](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/useCrearReporte.ts): `frontend-mobile/src/features/reportes/useCrearReporte.ts`
- [Mutación reporte](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/hooks.ts): `frontend-mobile/src/features/reportes/hooks.ts`
- [API reportes](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/api.ts): `frontend-mobile/src/features/reportes/api.ts`
- [Adaptador HTTP](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/src/features/reportes/http.ts): `frontend-mobile/src/features/reportes/http.ts`
- [Mapa móvil](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-mobile/app/(main)/index.tsx): `frontend-mobile/app/(main)/index.tsx`
- [Mapa web](https://github.com/clubtecla/tijuana-reporta/blob/main/frontend-web/src/components/MapContainer.tsx): `frontend-web/src/components/MapContainer.tsx`

### API backend

- [Servidor API](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/cmd/api/main.go): `backend/cmd/api/main.go`
- [Manejadores auth](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/api/auth_handler.go): `backend/internal/api/auth_handler.go`
- [Manejador comentarios](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/api/comentarios_handler.go): `backend/internal/api/comentarios_handler.go`
- [Servicio auth](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/service/auth.go): `backend/internal/service/auth.go`
- [Servicio comentarios](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/service/comentario.go): `backend/internal/service/comentario.go`
- [Middleware auth](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/middleware/middleware.go): `backend/internal/middleware/middleware.go`

### Persistencia

- [Store SQL](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/database/store.go): `backend/internal/database/store.go`
- [PostgreSQL](https://github.com/clubtecla/tijuana-reporta/blob/main/backend/internal/database/postgres.go): `backend/internal/database/postgres.go`

### Other components

- **Ciudadano**
- **Google OAuth**

## Connections

- Ciudadano → Bienvenida: inicia
- Bienvenida → App móvil: navega
- Ciudadano → Crear reporte: completa
- Crear reporte → Flujo de envío: envía datos
- Flujo de envío → Mutación reporte: ejecuta
- Mutación reporte → API reportes: solicita
- API reportes → Adaptador HTTP: usa
- App móvil → Mapa móvil: muestra
- Ciudadano → Web React: consulta
- Web React → Mapa web: renderiza
- Servidor API → Manejadores auth: registra rutas
- Servidor API → Manejador comentarios: registra rutas
- Servidor API → Servicio auth: construye
- Servidor API → Servicio comentarios: construye
- Servidor API → Middleware auth: registra
- Manejadores auth → Servicio auth: invoca
- Manejador comentarios → Servicio comentarios: invoca
- Servidor API → Store SQL: crea
- Servidor API → PostgreSQL: conecta
- Ciudadano → Google OAuth: autentica opcionalmente
