How automatizaciones-ipg/eligetufuturocl works
1. Repository shape
- This is an Astro-based public information site with a mix of mostly static pages and a few interactive client-side widgets.
- The project is organized around a user journey for exploring carreras, instituciones, herramientas, noticias, and vocational guidance.
2. Presentation layer
- src/pages defines the site’s route map.
- The top-level landing experience is in src/pages/index.astro, with supporting sections like noticias and tool landing pages under src/pages/herramientas/*.
- The layout shell is centralized in src/layouts/Layout.astro, with common navigation/footer components used site-wide.
3. Interactive UI boundary
- Most rich interactions live in src/components/*.tsx, which suggests React islands inside Astro pages.
- Examples include search, calculators, test vocational, result display, institution/career cards, and informational widgets.
- src/components/*.astro is used for non-interactive structural parts like nav and welcome content.
4. Core domain modules
- The main business surface is divided into:
- Careers: CarreraDetalle, CarrerasDestacadas, BuscadorCarreras, dynamic route src/pages/carrera/[id].astro
- Institutions: DirectorioInstituciones, InstitucionDetalle, dynamic route src/pages/institucion/[id].astro
- Tools: calculators, calendar, events, FUAS guide, labor market, test vocacional, request-info flow
- This separation is important because each module likely consumes different slices of the same underlying education dataset.
5. Data-driven routes
- The dynamic pages src/pages/carrera/[id].astro and src/pages/institucion/[id].astro indicate that detailed views are generated from identifiers rather than hand-authored pages.
- These pages likely render from cleaned catalog data, so the architecture is catalog-driven rather than manually curated for each entity.
6. Vocational test subsystem
- The vocational assessment flow is its own mini-domain:
- src/data/vocacionalData.tsx provides the question/answer content or scoring metadata.
- src/hooks/useTestVocacional.ts manages client-side test state.
- src/services/vocacionalService.ts encapsulates matching/scoring logic.
- src/components/TestVocacional.tsx and ResultadosTest.tsx handle the UI.
- This is a clear boundary between content, logic, and presentation.
7. Data preparation pipeline
- src/datos_et/ is an offline ETL/data-engineering area, separate from the website runtime.
- Raw source files live in src/datos_et/raw/ as XLSX/CSV inputs, and cleaned outputs are in src/datos_et/clean/ as JSON.
- Python scripts such as procesador.py, inyector.py, inyector_empleabilidad.py, master_injector.py, and acreditacion_instituciones.py suggest a pipeline that ingests official education/labor datasets and transforms them for site consumption.
8. Primary data flow
- The overall flow appears to be:
- external/raw education and labor datasets → Python ETL scripts → cleaned JSON catalogs → Astro pages/components → end-user browsing and search.
- This means the site runtime is probably lightweight and mostly reads precomputed data rather than querying a heavy backend on every page load.
9. Backend / service boundary
- src/pages/api/solicitar-informacion.ts provides a server-side endpoint for user submissions or lead capture.
- lib/supabase.ts and lib/supabaseServer.ts indicate an integration boundary with Supabase, likely for persistence or form handling.
- Architecturally, this is the main place where user input leaves the static/catalog layer and reaches a backend service.
10. Shared types and utilities
- Shared contracts live in src/types.ts and src/types/vocacional.ts, which helps keep the catalog, services, and UI consistent.
- src/utils/formatters.ts suggests centralized formatting for display values like labels, numbers, or dates.
11. Styling and assets
- Global styling is in src/styles/global.css.
- Static assets are organized under public/ with separate folders for images and logos.
- This points to a conventional asset pipeline: mostly static delivery with no special frontend build complexity beyond Astro.
12. Runtime and deployment
- astro.config.mjs and wrangler.jsonc indicate an Astro app prepared for Cloudflare/Wrangler deployment.
- The presence of serverless API routes plus Astro pages suggests a deployment model where static content and lightweight server functions coexist.
13. What to emphasize in an architecture diagram
- Show three main layers: offline data ETL, Astro presentation/UI, and server-side integration/API.
- Highlight the two dynamic entity domains, carreras and instituciones, plus the independent vocational test toolchain.
- Treat Supabase and the request-information API as the only clearly visible external backend boundary in the repository.
Main entry points: Layout.astro Layout shell · clean Clean catalogs · types.ts Shared types · index.astro Landing page
Components 20
Offline ETL
Python pipeline that converts raw education and labor datasets into site-ready catalogs.
- Raw data · Official XLSX and CSV inputs for careers, institutions, and employment data.
src/datos_et/raw - ETL scripts · Processors and injectors that clean, enrich, and merge raw datasets.
src/datos_et - Clean catalogs · Prepared career and institution datasets consumed by the site runtime.
src/datos_et/clean
Astro Site
Public information site with routes, layout, and interactive island components.
- Vocational data · Question and scoring content for the vocational test subsystem.
src/data/vocacionalData.tsx - Shared types · Common domain types for catalogs, UI, and services.
src/types.ts - Vocational types · Types specific to the vocational assessment flow.
src/types/vocacional.ts - Formatters · Centralized formatting for labels, dates, numbers, and other display values.
src/utils/formatters.ts - Layout shell · Global page wrapper that provides the shared site frame.
src/layouts/Layout.astro - Shared chrome · Navigation, header, footer, and welcome sections reused across pages.
- Landing page · Top-level home experience that introduces the site and key entry points.
src/pages/index.astro - Career route · Identifier-based career detail page rendered from catalog data.
src/pages/carrera/[id].astro - Institution route · Identifier-based institution detail page rendered from catalog data.
src/pages/institucion/[id].astro - Tools pages · Astro routes for calculators, search, guidance, events, and request-info flows.
- Career UI · Career search, featured listings, and detail widgets.
- Institution UI · Institution directory and detail widgets.
- Tools UI · Calculators, calendar, events, labor market, and guidance widgets.
- Vocational test · Stateful test, scoring, and results presentation boundary.
Backend Boundary
Server-side request capture and Supabase integration.
- Request API · Server-side endpoint for user information requests and lead capture.
src/pages/api/solicitar-informacion.ts - Supabase · Backend persistence and integration layer used by the request flow.
lib/supabase.ts - Supabase server · Server-side Supabase access helper for API routes.
lib/supabaseServer.ts
Connections 29
- Raw data → ETL scripts: ingest · Python scripts read the raw official datasets and transform them.
- ETL scripts → Clean catalogs: publish · Processed outputs become cleaned JSON catalogs for the app.
- Clean catalogs → Career route: feeds · Career detail pages render from the cleaned career catalog.
- Clean catalogs → Institution route: feeds · Institution detail pages render from the cleaned institution catalog.
- Clean catalogs → Career UI: data · Search and featured career UI consume the catalog data.
- Clean catalogs → Institution UI: data · Institution directory UI consumes the catalog data.
- Vocational data → Vocational test: questions · Test content and scoring metadata drive the assessment flow.
- Vocational types → Vocational test: types · Shared vocational contracts shape the test and results models.
- Shared types → Career UI: contracts · Domain types keep career components aligned with catalog data.
- Shared types → Institution UI: contracts · Domain types keep institution components aligned with catalog data.
- Shared types → Tools UI: contracts · Shared types support the broader tools surface.
- Shared types → Request API: contracts · Request payload and response shapes are shared with the API layer.
- Formatters → Career UI: present · Formatting helpers normalize values shown in career components.
- Formatters → Institution UI: present · Formatting helpers normalize values shown in institution components.
- Layout shell → Shared chrome: wraps · The global layout assembles the common site chrome.
- Layout shell → Landing page: wraps · The landing page sits inside the shared layout shell.
- Layout shell → Career route: wraps · Dynamic career pages use the shared layout shell.
- Layout shell → Institution route: wraps · Dynamic institution pages use the shared layout shell.
- Layout shell → Tools pages: wraps · Tools routes use the shared layout shell.
- Landing page → Career UI: features · Home content surfaces career discovery entry points.
- Landing page → Tools UI: features · Home content surfaces the tools and guidance area.
- Career route → Career UI: renders · Career detail pages mount career-specific islands.
- Institution route → Institution UI: renders · Institution detail pages mount institution-specific islands.
- Tools pages → Tools UI: renders · Tools routes mount interactive calculators and guides.
- Tools pages → Vocational test: renders · The vocational test route uses the dedicated assessment flow.
- Tools pages → Request API: submits · The request-information page posts user input to the API.
- Request API → Supabase server: uses · The API route relies on server-side Supabase access.
- Supabase server → Supabase: connects · Server helper bridges to the Supabase backend.
- Shared chrome → Landing page: shared · Header, nav, footer, and welcome sections are reused on the site.