How josue1414/predicamap works
1. This is a React single-page application built with Vite. The runtime entry is src/main.jsx, which mounts App.jsx and loads global styles from src/index.css. The repo is set up for modern frontend delivery with Vite, Tailwind/PostCSS, ESLint, and Vercel deployment.
2. The app’s top-level structure is view-based, not route-heavy in the file tree. The main screens live under src/vistas: VistaLogin.jsx, VistaDashboard.jsx, and VistaPublicador.jsx. These likely represent the unauthenticated entry point, the main authenticated workspace, and a role-specific/publicador workspace.
3. A central architectural concern is map-centric territory management. The src/hooks/useMapa.js hook appears to be the main map integration layer, and several UI pieces support it: VisorMapa.jsx renders the map, ManejadorClicksMapa.jsx handles interaction on the map surface, ControlesTrazado.jsx provides drawing controls, and ModalTachuela.jsx supports pin/marker editing.
4. Most domain behavior is organized into “manager” hooks under src/hooks/modulos. These hooks split responsibilities by feature: useGestorTerritorios, useGestorTachuelas, useGestorHistorial, useGestorProgreso, useMarcadoresPersonales, plus useControlesUI and useEstadoGlobal. This suggests a layered design where React components stay mostly presentational while hooks own state and business rules.
5. The app’s state boundaries appear to be: global UI state, map state, and feature-specific domain state. useEstadoGlobal and useControlesUI likely coordinate cross-cutting concerns, while the other hooks manage separate datasets such as territories, history, progress, personal markers, and “tachuelas” (pins). This separation is important for drawing the architecture because the UI components probably consume these hooks rather than talking directly to backend services.
6. There is a notable sidebar/menu subsystem under src/componentes/menu-lateral. It contains section components such as SeccionAjustesGenerales, SeccionBuscarMapa, SeccionDibujarTerritorio, SeccionDirectorio, SeccionHistorial, SeccionMiPerfil, SeccionMiProgreso, SeccionMisRevisitas, SeccionSembrarCasas, SeccionTerritorios, and master/admin flows for congregations. MenuLateral.jsx and MenuTerritorio.jsx likely orchestrate which section is visible based on role and current task.
7. Additional UI components support the workflow around congregation, city, and building context. Examples include CabeceraCongregacion.jsx, BuscadorCiudad.jsx, FormularioSeccion.jsx, and MenuEdificio.jsx. These imply that the app is not just a map viewer; it also manages structured operational data tied to congregations and locations.
8. The presence of src/componentes/menu-lateral/SeccionMasterCongregaciones.jsx and SeccionMasterNuevaCongregacion.jsx suggests a privileged administrative subsystem. That is a separate boundary from the regular “publicador” experience and likely controls organization-level setup and management.
9. Backend connectivity is centralized through src/utilidades/clienteSupabase.js, which strongly indicates Supabase is the primary external data store/auth provider. From an architecture perspective, the frontend talks to Supabase for persistence and probably authentication, while the various “gestor” hooks mediate all domain reads and writes.
10. The app likely uses role-based access and workflow state to switch between major areas: login, dashboard, and publisher/publicador mode. The VistaDashboard and VistaPublicador separation implies that once authenticated, users enter different feature sets depending on their role or responsibility.
11. The repository also contains deployment and environment scaffolding: .env.example for configuration, vercel.json for hosting/deployment behavior, and public/ for static assets. This means the diagram should include a frontend hosting boundary plus an external Supabase boundary, with the browser as the primary runtime.
12. In short, the architecture is: React/Vite UI at the edge, role-based views in the middle, feature-specific state hooks as the domain layer, and Supabase as the persistence/auth backend. The map and territory workflow is the core business subsystem, and the sidebar sections are the main user-facing entry points into that workflow.
Main entry points: useMapa.js useMapa · VisorMapa.jsx Mapa · clienteSupabase.js Supabase · MenuLateral.jsx Menu lateral
Components 26
Shell
React/Vite entry and shared app composition
- main · Bootstraps React and mounts the app
src/main.jsx - App · Top-level composition and app wiring
src/App.jsx - Global CSS · Shared application styling
src/index.css - Vista router · Chooses the active view and layout
src/componentes/ControladorVista.jsx
Views
Top-level screen states for login and workspaces
- Login · Unauthenticated entry screen
src/vistas/VistaLogin.jsx - Dashboard · Primary authenticated workspace
src/vistas/VistaDashboard.jsx - Publicador · Role-specific publishing workspace
src/vistas/VistaPublicador.jsx
Workflow
Map-centric UI, sidebar sections, and domain hooks
- Menu lateral · Main sidebar container and section host
src/componentes/MenuLateral.jsx - Menu territorio · Territory-specific menu orchestration
src/componentes/MenuTerritorio.jsx - Menu publicador · Sidebar variant for publisher flows
src/componentes/menu-lateral/MenuLateralPublicador.jsx - Mapa · Primary map canvas and rendering surface
src/componentes/VisorMapa.jsx - Clicks mapa · Handles pointer interaction on the map
src/componentes/ManejadorClicksMapa.jsx - Trazado · Drawing controls for territory creation
src/componentes/ControlesTrazado.jsx - Tachuela modal · Edits pins and marker details
src/componentes/ModalTachuela.jsx - Buscar ciudad · City search and location lookup
src/componentes/BuscadorCiudad.jsx - Cabecera cong. · Congregation context and identity header
src/componentes/CabeceraCongregacion.jsx - Menu edificio · Building-specific actions and context
src/componentes/MenuEdificio.jsx - useMapa · Central map integration layer
src/hooks/useMapa.js - Estado global · Cross-cutting UI and app state
src/hooks/modulos/useEstadoGlobal.js - Controles UI · UI controls and shared interaction state
src/hooks/modulos/useControlesUI.js - Territorios · Territory data and business rules
src/hooks/modulos/useGestorTerritorios.js - Tachuelas · Pin and marker management
src/hooks/modulos/useGestorTachuelas.js - Historial · Change history and audit trail
src/hooks/modulos/useGestorHistorial.js - Progreso · Progress tracking and completion state
src/hooks/modulos/useGestorProgreso.js - Marcadores · Personal marker management
src/hooks/modulos/useMarcadoresPersonales.js
Infra
External persistence and auth boundary
- Supabase · Auth and persistent data store
src/utilidades/clienteSupabase.js
Connections 31
- main → App: mounts · App bootstrap renders the root component
- App → Global CSS: loads · Global styling is applied at app start
- App → Vista router: delegates · App hands layout and screen selection to the controller
- Vista router → Login: shows · Unauthenticated state routes to login
- Vista router → Dashboard: shows · Authenticated default workspace
- Vista router → Publicador: shows · Role-based publisher workspace
- Dashboard → Menu lateral: contains · Dashboard includes the main sidebar
- Dashboard → Mapa: renders · Primary map workspace
- Publicador → Menu publicador: contains · Publisher-specific sidebar
- Publicador → Mapa: renders · Publisher workspace centers on the map
- Menu lateral → Menu territorio: orchestrates · Sidebar switches between workflow sections
- Menu lateral → Buscar ciudad: exposes · Search and lookup entry point
- Menu lateral → Cabecera cong.: shows · Shared congregation context header
- Menu lateral → Menu edificio: includes · Building context actions
- Mapa → useMapa: driven by · Map rendering and state are coordinated by the map hook
- Mapa → Clicks mapa: uses · Surface interaction is handled separately
- Mapa → Trazado: uses · Drawing tools attach to the map workspace
- Mapa → Tachuela modal: opens · Marker editing is surfaced through a modal
- useMapa → Estado global: reads · Map layer consumes shared app state
- useMapa → Controles UI: coordinates · UI control state influences map behavior
- useMapa → Territorios: reads · Territory data feeds map behavior
- useMapa → Tachuelas: reads · Pins and markers are sourced from domain state
- useMapa → Historial: records · Map actions contribute to history
- useMapa → Progreso: updates · Map activity affects progress tracking
- useMapa → Marcadores: syncs · Personal markers are integrated into the map layer
- Territorios → Supabase: persists · Territory data is stored through Supabase
- Tachuelas → Supabase: persists · Pin changes are saved to backend storage
- Historial → Supabase: persists · History entries are backed by Supabase
- Progreso → Supabase: persists · Progress state is stored remotely
- Marcadores → Supabase: persists · Personal markers are synchronized with backend data
- Estado global → Supabase: auth/state · Cross-cutting state depends on the backend client