# juanjosenavarro97/landing-infojobs architecture

> Architecture diagram of the GitHub repository juanjosenavarro97/landing-infojobs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juanjosenavarro97/landing-infojobs
- Repository: https://github.com/juanjosenavarro97/landing-infojobs

## Overview

##### Main Components
- Landing Page Application: Represent the entire Astro-based static site.
- Pages: At least one primary page component (src/pages/index.astro) that uses the components and layouts.
- Libraries & Helpers: Show helper modules in src/lib (like get-ij-studies.ts, query.ts, mocks.ts) which could be responsible for data fetching or assembling data for the landing page.
- External Services: Highlight the connection to the InfoJobs API (using the API token from environment variables) as indicated in the README under “Variables de entorno”. This external service is a crucial part of the project’s functionality.
- Public Assets: Represent static assets such as images, fonts, and other media available in the public directory.
- Configuration & Build: Include configuration files (astro.config.mjs, tailwind.config.mjs, tsconfig.json, package.json) used in building and deploying the project.

- Flow from the Landing Page Application (entry point) to the Page Component that utilizes the Layout.
- From the Layout, route to several Components (e.g., Header, HeroSearch, Footer).
- That UI components call or use shared modules/helpers from the src/lib directory.
- Developer/environment modules (e.g., environment variables from .env) feeding into the data-fetching modules.

##### Architectural Patterns and Principles
- Component-Based Architecture: Show how the modular UI components are organized and reused across the landing page.
- Separation of Concerns: Separate presentation (components, layouts, pages) from business/data logic (lib functions fetching data from API).
- External Integration: Emphasize the integration point with the external InfoJobs API, which is controlled using environment configurations.
- Static-Site Generation: Since Astro is used, note that the site is pre-rendered and optimized for performance.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Landing Page: src/pages/index.astro"]:::page
    B["Layout: src/layouts/Layout.astro"]:::page
    C["UI Components: src/components\n(Header.astro, Footer.astro, HeroSearch.astro, AdevintaInfo.astro, BentoInfo.astro, KingsLeagueInfo.astro, etc.)"]:::component
    D["UI Elements: src/components/ui\n(Button.astro, Icon.astro)"]:::component
    E["Libraries & Helpers: src/lib\n(get-ij-studies.ts, mocks.ts, query.ts)"]:::lib
    F["External API: InfoJobs API"]:::external
    G["Public Assets: public"]:::assets
    I5["Environment Config: .env.example"]:::env

    subgraph "Configuration & Build"
        I1["astro.config.mjs"]:::config
        I2["tailwind.config.mjs"]:::config
        I3["tsconfig.json"]:::config
        I4["package.json"]:::config
    end

    A -->|"uses"| B
    B -->|"renders"| C
    B -->|"renders"| D
    C -->|"calls"| E
    E -->|"fetchesDataFrom"| F
    I5 -->|"providesTokenTo"| E
    A -->|"includes"| G
    A -->|"builtWith"| I1
    A -->|"builtWith"| I2
    A -->|"builtWith"| I3
    A -->|"builtWith"| I4

    click A "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/src/pages/index.astro"
    click B "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/src/layouts/Layout.astro"
    click C "https://github.com/juanjosenavarro97/landing-infojobs/tree/main/src/components"
    click D "https://github.com/juanjosenavarro97/landing-infojobs/tree/main/src/components/ui"
    click E "https://github.com/juanjosenavarro97/landing-infojobs/tree/main/src/lib"
    click I1 "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/astro.config.mjs"
    click I2 "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/tailwind.config.mjs"
    click I3 "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/tsconfig.json"
    click I4 "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/package.json"
    click I5 "https://github.com/juanjosenavarro97/landing-infojobs/blob/main/.env.example"
    click G "https://github.com/juanjosenavarro97/landing-infojobs/tree/main/public"

    classDef page fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef component fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef lib fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef assets fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
    classDef config fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef env fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
```
