# wither63z/encuentralo architecture

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

- Interactive diagram: https://gitdiagram.com/wither63z/encuentralo
- Repository: https://github.com/wither63z/encuentralo

## Overview

Encuéntralo es una aplicación escolar de objetos perdidos: la persona explora y filtra hallazgos, abre un detalle y puede iniciar un reclamo; también puede reportar un objeto encontrado o buscar coincidencias con algo perdido. El inspector docente revisa estados y reclamos. La app permite datos mock locales o Supabase, además de autenticación y fotos. Las flechas se limitan a relaciones visibles en los extractos o documentadas en el README; algunas implementaciones de páginas, radar y persistencia no fueron muestreadas.

Main entry points: [`src/App.tsx`](https://github.com/wither63z/encuentralo/blob/main/src/App.tsx) (Navegación principal), [`src/services/obtenerRepositorio.ts`](https://github.com/wither63z/encuentralo/blob/main/src/services/obtenerRepositorio.ts) (Selección repositorio), [`src/pages/PaginaListado.tsx`](https://github.com/wither63z/encuentralo/blob/main/src/pages/PaginaListado.tsx) (Listado y filtros), [`src/features/reportar/PaginaReportar.tsx`](https://github.com/wither63z/encuentralo/blob/main/src/features/reportar/PaginaReportar.tsx) (Reportar hallazgo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Aplicación y navegación"]
  node_app["Navegación principal<br/>[App.tsx]"]
  node_pages["Pantallas principales"]
  node_types["Contratos de dominio<br/>[index.ts]"]
  node_config["Estados y textos<br/>[constantes.ts]"]
  node_ui["Componentes visuales"]
end

subgraph group_discovery["Explorar y encontrar"]
  node_listing["Listado y filtros<br/>[PaginaListado.tsx]"]
  node_object_components["Tarjetas y detalle"]
  node_object_hooks["Carga de objetos"]
  node_filter_logic["Filtrado y reglas"]
  node_matches["Coincidencias perdidas"]
  node_radar["Radar de búsqueda"]
end

subgraph group_flows["Reportes y reclamos"]
  node_report_page["Reportar hallazgo<br/>[PaginaReportar.tsx]"]
  node_report_logic["Validar y registrar<br/>[useReportar.ts]"]
  node_photo["Preparar fotografías<br/>[fotos.ts]"]
  node_claim["Formulario de reclamo"]
  node_claim_logic["Procesar reclamo<br/>[useReclamo.ts]"]
end

subgraph group_operations["Inspector y acceso"]
  node_inspector["Panel inspector"]
  node_inspector_logic["Gestión de estados<br/>[useInspector.ts]"]
  node_auth["Sesión y roles<br/>[servicioAuth.ts]"]
end

subgraph group_data["Datos e integraciones"]
  node_repo_api["Repositorio de objetos"]
  node_repo_select["Selección repositorio"]
  node_mock[("Datos mock locales<br/>[repositorioMock.ts]")]
  node_supabase_repo[("Persistencia Supabase")]
end

node_person(("Estudiante o docente"))
node_supabase[("Supabase")]

node_person -->|"usa"| node_app
node_app -->|"elige pantalla"| node_pages
node_app -->|"renderiza"| node_inspector
node_app -->|"renderiza"| node_report_page
node_app -->|"renderiza"| node_matches
node_app -->|"consulta sesión"| node_auth
node_listing -.->|"usa datos"| node_object_hooks
node_listing -.->|"muestra objetos"| node_object_components
node_listing -.->|"filtra"| node_filter_logic
node_matches -.->|"calcula coincidencias"| node_filter_logic
node_inspector -->|"gestiona"| node_inspector_logic
node_inspector -->|"incluye panel"| node_radar
node_inspector_logic -->|"carga y actualiza"| node_repo_select
node_report_page -->|"envía formulario"| node_report_logic
node_report_page -->|"selecciona foto"| node_photo
node_report_logic -->|"comprime foto"| node_photo
node_report_logic -->|"registra objeto"| node_repo_select
node_claim -.->|"envía datos"| node_claim_logic
node_claim_logic -->|"registra reclamo"| node_repo_select
node_repo_select -.->|"obtiene implementación"| node_repo_api
node_repo_select -.->|"usa modo demo"| node_mock
node_repo_select -.->|"usa modo real"| node_supabase_repo
node_supabase_repo -.->|"lee y escribe"| node_supabase
node_mock -.->|"conserva cambios locales"| node_person
node_app -->|"usa vistas y resultados"| node_types
node_app -->|"lee textos"| node_config
node_object_components -.->|"usa controles visuales"| node_ui

click node_app "https://github.com/wither63z/encuentralo/blob/main/src/App.tsx"
click node_pages "https://github.com/wither63z/encuentralo/tree/main/src/pages"
click node_listing "https://github.com/wither63z/encuentralo/blob/main/src/pages/PaginaListado.tsx"
click node_object_components "https://github.com/wither63z/encuentralo/tree/main/src/components/objetos"
click node_object_hooks "https://github.com/wither63z/encuentralo/tree/main/src/hooks"
click node_filter_logic "https://github.com/wither63z/encuentralo/tree/main/src/utils"
click node_matches "https://github.com/wither63z/encuentralo/tree/main/src/features/coincidencias"
click node_radar "https://github.com/wither63z/encuentralo/tree/main/src/features/radar"
click node_report_page "https://github.com/wither63z/encuentralo/blob/main/src/features/reportar/PaginaReportar.tsx"
click node_report_logic "https://github.com/wither63z/encuentralo/blob/main/src/hooks/useReportar.ts"
click node_photo "https://github.com/wither63z/encuentralo/blob/main/src/services/fotos.ts"
click node_claim "https://github.com/wither63z/encuentralo/blob/main/src/components/reclamo/FormularioReclamo.tsx"
click node_claim_logic "https://github.com/wither63z/encuentralo/blob/main/src/hooks/useReclamo.ts"
click node_inspector "https://github.com/wither63z/encuentralo/blob/main/src/features/inspector/PaginaInspector.tsx"
click node_inspector_logic "https://github.com/wither63z/encuentralo/blob/main/src/hooks/useInspector.ts"
click node_auth "https://github.com/wither63z/encuentralo/blob/main/src/services/servicioAuth.ts"
click node_repo_api "https://github.com/wither63z/encuentralo/blob/main/src/services/RepositorioObjetos.ts"
click node_repo_select "https://github.com/wither63z/encuentralo/blob/main/src/services/obtenerRepositorio.ts"
click node_mock "https://github.com/wither63z/encuentralo/blob/main/src/services/repositorioMock.ts"
click node_supabase_repo "https://github.com/wither63z/encuentralo/blob/main/src/services/repositorioSupabase.ts"
click node_types "https://github.com/wither63z/encuentralo/blob/main/src/types/index.ts"
click node_config "https://github.com/wither63z/encuentralo/blob/main/src/config/constantes.ts"
click node_ui "https://github.com/wither63z/encuentralo/tree/main/src/components/ui"

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_pages,node_types,node_config,node_ui toneBlue
class node_listing,node_object_components,node_object_hooks,node_filter_logic,node_matches,node_radar,node_supabase toneAmber
class node_report_page,node_report_logic,node_photo,node_claim,node_claim_logic toneMint
class node_inspector,node_inspector_logic,node_auth toneRose
class node_repo_api,node_repo_select,node_mock,node_supabase_repo,node_person toneIndigo
```

## Components

### Aplicación y navegación

- [Navegación principal](https://github.com/wither63z/encuentralo/blob/main/src/App.tsx): `src/App.tsx`
- [Pantallas principales](https://github.com/wither63z/encuentralo/tree/main/src/pages): `src/pages`
- [Contratos de dominio](https://github.com/wither63z/encuentralo/blob/main/src/types/index.ts): `src/types/index.ts`
- [Estados y textos](https://github.com/wither63z/encuentralo/blob/main/src/config/constantes.ts): `src/config/constantes.ts`
- [Componentes visuales](https://github.com/wither63z/encuentralo/tree/main/src/components/ui): `src/components/ui`

### Explorar y encontrar

- [Listado y filtros](https://github.com/wither63z/encuentralo/blob/main/src/pages/PaginaListado.tsx): `src/pages/PaginaListado.tsx`
- [Tarjetas y detalle](https://github.com/wither63z/encuentralo/tree/main/src/components/objetos): `src/components/objetos`
- [Carga de objetos](https://github.com/wither63z/encuentralo/tree/main/src/hooks): `src/hooks`
- [Filtrado y reglas](https://github.com/wither63z/encuentralo/tree/main/src/utils): `src/utils`
- [Coincidencias perdidas](https://github.com/wither63z/encuentralo/tree/main/src/features/coincidencias): `src/features/coincidencias`
- [Radar de búsqueda](https://github.com/wither63z/encuentralo/tree/main/src/features/radar): `src/features/radar`

### Reportes y reclamos

- [Reportar hallazgo](https://github.com/wither63z/encuentralo/blob/main/src/features/reportar/PaginaReportar.tsx): `src/features/reportar/PaginaReportar.tsx`
- [Validar y registrar](https://github.com/wither63z/encuentralo/blob/main/src/hooks/useReportar.ts): `src/hooks/useReportar.ts`
- [Preparar fotografías](https://github.com/wither63z/encuentralo/blob/main/src/services/fotos.ts): `src/services/fotos.ts`
- [Formulario de reclamo](https://github.com/wither63z/encuentralo/blob/main/src/components/reclamo/FormularioReclamo.tsx): `src/components/reclamo/FormularioReclamo.tsx`
- [Procesar reclamo](https://github.com/wither63z/encuentralo/blob/main/src/hooks/useReclamo.ts): `src/hooks/useReclamo.ts`

### Inspector y acceso

- [Panel inspector](https://github.com/wither63z/encuentralo/blob/main/src/features/inspector/PaginaInspector.tsx): `src/features/inspector/PaginaInspector.tsx`
- [Gestión de estados](https://github.com/wither63z/encuentralo/blob/main/src/hooks/useInspector.ts): `src/hooks/useInspector.ts`
- [Sesión y roles](https://github.com/wither63z/encuentralo/blob/main/src/services/servicioAuth.ts): `src/services/servicioAuth.ts`

### Datos e integraciones

- [Repositorio de objetos](https://github.com/wither63z/encuentralo/blob/main/src/services/RepositorioObjetos.ts): `src/services/RepositorioObjetos.ts`
- [Selección repositorio](https://github.com/wither63z/encuentralo/blob/main/src/services/obtenerRepositorio.ts): `src/services/obtenerRepositorio.ts`
- [Datos mock locales](https://github.com/wither63z/encuentralo/blob/main/src/services/repositorioMock.ts): `src/services/repositorioMock.ts`
- [Persistencia Supabase](https://github.com/wither63z/encuentralo/blob/main/src/services/repositorioSupabase.ts): `src/services/repositorioSupabase.ts`

### Other components

- **Estudiante o docente**
- **Supabase**

## Connections

- Estudiante o docente → Navegación principal: usa (evidence: `README.md`)
- Navegación principal → Pantallas principales: elige pantalla (evidence: `src/App.tsx`)
- Navegación principal → Panel inspector: renderiza (evidence: `src/App.tsx`)
- Navegación principal → Reportar hallazgo: renderiza (evidence: `src/App.tsx`)
- Navegación principal → Coincidencias perdidas: renderiza (evidence: `src/App.tsx`)
- Navegación principal → Sesión y roles: consulta sesión (evidence: `src/App.tsx`)
- Listado y filtros → Carga de objetos: usa datos (evidence: `src/pages/PaginaListado.tsx`)
- Listado y filtros → Tarjetas y detalle: muestra objetos
- Listado y filtros → Filtrado y reglas: filtra
- Coincidencias perdidas → Filtrado y reglas: calcula coincidencias
- Panel inspector → Gestión de estados: gestiona (evidence: `src/features/inspector/PaginaInspector.tsx`)
- Panel inspector → Radar de búsqueda: incluye panel (evidence: `src/features/inspector/PaginaInspector.tsx`)
- Gestión de estados → Selección repositorio: carga y actualiza (evidence: `src/hooks/useInspector.ts`)
- Reportar hallazgo → Validar y registrar: envía formulario (evidence: `src/features/reportar/PaginaReportar.tsx`)
- Reportar hallazgo → Preparar fotografías: selecciona foto (evidence: `src/features/reportar/PaginaReportar.tsx`)
- Validar y registrar → Preparar fotografías: comprime foto (evidence: `src/hooks/useReportar.ts`)
- Validar y registrar → Selección repositorio: registra objeto (evidence: `src/hooks/useReportar.ts`)
- Formulario de reclamo → Procesar reclamo: envía datos
- Procesar reclamo → Selección repositorio: registra reclamo (evidence: `src/hooks/useReclamo.ts`)
- Selección repositorio → Repositorio de objetos: obtiene implementación
- Selección repositorio → Datos mock locales: usa modo demo (evidence: `README.md`)
- Selección repositorio → Persistencia Supabase: usa modo real (evidence: `README.md`)
- Persistencia Supabase → Supabase: lee y escribe (evidence: `README.md`)
- Datos mock locales → Estudiante o docente: conserva cambios locales (evidence: `README.md`)
- Navegación principal → Contratos de dominio: usa vistas y resultados (evidence: `src/App.tsx`)
- Navegación principal → Estados y textos: lee textos (evidence: `src/App.tsx`)
- Tarjetas y detalle → Componentes visuales: usa controles visuales (evidence: `src/components/objetos/DetalleObjeto.tsx`)
