# automatizaciones-ipg/eligetufuturocl architecture

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

- Interactive diagram: https://gitdiagram.com/automatizaciones-ipg/eligetufuturocl
- Repository: https://github.com/automatizaciones-ipg/eligetufuturocl

## Overview

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: [`src/layouts/Layout.astro`](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/layouts/Layout.astro) (Layout shell), [`src/datos_et/clean`](https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et/clean) (Clean catalogs), [`src/types.ts`](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/types.ts) (Shared types), [`src/pages/index.astro`](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/index.astro) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_offline_etl["Offline ETL"]
  node_raw_datasets[("Raw data<br/>source datasets")]
  node_etl_scripts["ETL scripts<br/>Python pipeline"]
  node_clean_catalogs[("Clean catalogs<br/>JSON catalogs")]
end

subgraph group_astro_site["Astro Site"]
  node_vocacional_content["Vocational data<br/>content schema<br/>[vocacionalData.tsx]"]
  node_shared_types["Shared types<br/>TypeScript contracts<br/>[types.ts]"]
  node_vocacional_types["Vocational types<br/>test contracts<br/>[vocacional.ts]"]
  node_formatters["Formatters<br/>display helpers<br/>[formatters.ts]"]
  node_layout_shell["Layout shell<br/>Astro layout<br/>[Layout.astro]"]
  node_shared_chrome["Shared chrome<br/>site UI"]
  node_landing_page["Landing page<br/>route<br/>[index.astro]"]
  node_career_route["Career route<br/>dynamic route<br/>[[id].astro]"]
  node_institution_route["Institution route<br/>dynamic route<br/>[[id].astro]"]
  node_tools_pages["Tools pages<br/>route set"]
  node_career_ui["Career UI<br/>React islands"]
  node_institution_ui["Institution UI<br/>React islands"]
  node_tools_ui["Tools UI<br/>React islands"]
  node_vocational_flow["Vocational test<br/>client workflow"]
end

subgraph group_backend["Backend Boundary"]
  node_request_api["Request API<br/>server endpoint"]
  node_supabase[("Supabase<br/>data service<br/>[supabase.ts]")]
  node_supabase_server[("Supabase server<br/>server client<br/>[supabaseServer.ts]")]
end

node_raw_datasets -->|"ingest"| node_etl_scripts
node_etl_scripts -->|"publish"| node_clean_catalogs
node_clean_catalogs -->|"feeds"| node_career_route
node_clean_catalogs -->|"feeds"| node_institution_route
node_clean_catalogs -->|"data"| node_career_ui
node_clean_catalogs -->|"data"| node_institution_ui
node_vocacional_content -->|"questions"| node_vocational_flow
node_vocacional_types -->|"types"| node_vocational_flow
node_shared_types -->|"contracts"| node_career_ui
node_shared_types -->|"contracts"| node_institution_ui
node_shared_types -->|"contracts"| node_tools_ui
node_shared_types -->|"contracts"| node_request_api
node_formatters -->|"present"| node_career_ui
node_formatters -->|"present"| node_institution_ui
node_layout_shell -->|"wraps"| node_shared_chrome
node_layout_shell -->|"wraps"| node_landing_page
node_layout_shell -->|"wraps"| node_career_route
node_layout_shell -->|"wraps"| node_institution_route
node_layout_shell -->|"wraps"| node_tools_pages
node_landing_page -->|"features"| node_career_ui
node_landing_page -->|"features"| node_tools_ui
node_career_route -->|"renders"| node_career_ui
node_institution_route -->|"renders"| node_institution_ui
node_tools_pages -->|"renders"| node_tools_ui
node_tools_pages -->|"renders"| node_vocational_flow
node_tools_pages -->|"submits"| node_request_api
node_request_api -->|"uses"| node_supabase_server
node_supabase_server -->|"connects"| node_supabase
node_shared_chrome -->|"shared"| node_landing_page

click node_raw_datasets "https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et/raw"
click node_etl_scripts "https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et"
click node_clean_catalogs "https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et/clean"
click node_vocacional_content "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/data/vocacionalData.tsx"
click node_shared_types "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/types.ts"
click node_vocacional_types "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/types/vocacional.ts"
click node_formatters "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/utils/formatters.ts"
click node_layout_shell "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/layouts/Layout.astro"
click node_landing_page "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/index.astro"
click node_career_route "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/carrera/[id].astro"
click node_institution_route "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/institucion/[id].astro"
click node_request_api "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/api/solicitar-informacion.ts"
click node_supabase "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/lib/supabase.ts"
click node_supabase_server "https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/lib/supabaseServer.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_raw_datasets,node_etl_scripts,node_clean_catalogs toneBlue
class node_vocacional_content,node_shared_types,node_vocacional_types,node_formatters,node_layout_shell,node_shared_chrome,node_landing_page,node_career_route,node_institution_route,node_tools_pages,node_career_ui,node_institution_ui,node_tools_ui,node_vocational_flow toneAmber
class node_request_api,node_supabase,node_supabase_server toneMint
```

## Components

### Offline ETL

Python pipeline that converts raw education and labor datasets into site-ready catalogs.

- [Raw data](https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et/raw): source datasets · Official XLSX and CSV inputs for careers, institutions, and employment data. · `src/datos_et/raw`
- [ETL scripts](https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et): Python pipeline · Processors and injectors that clean, enrich, and merge raw datasets. · `src/datos_et`
- [Clean catalogs](https://github.com/automatizaciones-ipg/eligetufuturocl/tree/main/src/datos_et/clean): JSON 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](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/data/vocacionalData.tsx): content schema · Question and scoring content for the vocational test subsystem. · `src/data/vocacionalData.tsx`
- [Shared types](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/types.ts): TypeScript contracts · Common domain types for catalogs, UI, and services. · `src/types.ts`
- [Vocational types](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/types/vocacional.ts): test contracts · Types specific to the vocational assessment flow. · `src/types/vocacional.ts`
- [Formatters](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/utils/formatters.ts): display helpers · Centralized formatting for labels, dates, numbers, and other display values. · `src/utils/formatters.ts`
- [Layout shell](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/layouts/Layout.astro): Astro layout · Global page wrapper that provides the shared site frame. · `src/layouts/Layout.astro`
- **Shared chrome**: site UI · Navigation, header, footer, and welcome sections reused across pages.
- [Landing page](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/index.astro): route · Top-level home experience that introduces the site and key entry points. · `src/pages/index.astro`
- [Career route](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/carrera/[id].astro): dynamic route · Identifier-based career detail page rendered from catalog data. · `src/pages/carrera/[id].astro`
- [Institution route](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/institucion/[id].astro): dynamic route · Identifier-based institution detail page rendered from catalog data. · `src/pages/institucion/[id].astro`
- **Tools pages**: route set · Astro routes for calculators, search, guidance, events, and request-info flows.
- **Career UI**: React islands · Career search, featured listings, and detail widgets.
- **Institution UI**: React islands · Institution directory and detail widgets.
- **Tools UI**: React islands · Calculators, calendar, events, labor market, and guidance widgets.
- **Vocational test**: client workflow · Stateful test, scoring, and results presentation boundary.

### Backend Boundary

Server-side request capture and Supabase integration.

- [Request API](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/src/pages/api/solicitar-informacion.ts): server endpoint · Server-side endpoint for user information requests and lead capture. · `src/pages/api/solicitar-informacion.ts`
- [Supabase](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/lib/supabase.ts): data service · Backend persistence and integration layer used by the request flow. · `lib/supabase.ts`
- [Supabase server](https://github.com/automatizaciones-ipg/eligetufuturocl/blob/main/lib/supabaseServer.ts): server client · Server-side Supabase access helper for API routes. · `lib/supabaseServer.ts`

## Connections

- 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.
