# patovamp/dreamjob-astro architecture

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

- Interactive diagram: https://gitdiagram.com/patovamp/dreamjob-astro
- Repository: https://github.com/patovamp/dreamjob-astro

## Overview

#### Purpose and runtime

This is an Astro site for a job/employment platform with public marketing, job/company discovery, authentication, role-oriented dashboards, profile management, plan selection, and payment checkout. Astro file-based routing is the application entry mechanism: `src/pages/index.astro`, `src/pages/dashboard.astro`, and `src/pages/payment.astro`. It runs through the Astro/Node.js toolchain configured in `astro.config.mjs` and packaged with pnpm.

#### Route and layout layer

Pages map directly to user-facing routes, separating public journeys from authenticated/account journeys:
- Public discovery and conversion: `src/pages/index.astro`, `src/pages/empleos.astro`, `src/pages/companias.astro`, `src/pages/planes.astro`.
- Identity and onboarding: `src/pages/login.astro`, `src/pages/register.astro`, `src/pages/register/usuario.astro`, `src/pages/register/empresa.astro`.
- Account operations: `src/pages/dashboard.astro`, `src/pages/profile.astro`, `src/pages/payment.astro`.

`src/layouts/BaseLayout.astro` is the shared page shell and likely centralizes common document structure and shared navigation styling.

#### Presentation composition

Astro components organize the major product surfaces:
- Shared/site navigation: `src/components/Header.astro`.
- Subscription-plan selection: `src/components/PlansSection.astro`, `src/components/PlanCard.astro`.
- Checkout UI: `src/components/checkout/CheckoutHeader.astro`, `src/components/checkout/OrderSummary.astro`, `src/components/checkout/PaymentForm.astro`, `src/components/checkout/PayButton.astro`.
- Dashboard views by account role/entity: `src/components/dashboard/Empleado.astro`, `src/components/dashboard/Empleador.astro`, `src/components/dashboard/Empresa.astro`.

This indicates server-rendered Astro page composition with targeted browser-side behavior rather than a separate SPA application.

#### Identity, user, and backend boundary

The `src/lib` layer is the boundary between UI/routes and remote user/job services:
- Authentication/session behavior: `src/lib/auth.js`.
- Current-user retrieval: `src/lib/fetchUserData.js`.
- Profile mutation: `src/lib/userPatch.js`.
- Job listing retrieval: `src/lib/listJobs.js`.
- Shared typing contract: `src/lib/types.d.ts`.

The exact backend and identity provider are not identified in the repository inputs. Consumers should treat these library modules as the integration seam for API URLs, credentials/tokens, response shapes, and error handling.

#### Client-side interaction layer

Browser JavaScript is split by journey and loaded alongside Astro-rendered pages/components:
- Auth lifecycle: `src/javascript/login.js`, `src/javascript/register.js`, `src/javascript/logout.js`.
- Account/profile mutation: `src/javascript/profile.js`, `src/javascript/usuarioForm.js`.
- Job and dashboard behavior: `src/javascript/empleo.js`, `src/javascript/dashboard.js`, `src/javascript/empleado.js`.
- Navigation behavior: `src/javascript/navbar.js`, `src/javascript/menuHamburguesa.js`.

Control flow is generally page render → client event handler → `src/lib` API call → DOM/UI update or navigation. This boundary should remain explicit to avoid embedding service logic directly in components.

#### Plans and payment flow

The commercial flow is: plan discovery via `src/pages/planes.astro` and `src/components/PlansSection.astro` → payment route `src/pages/payment.astro` → checkout composition using `src/components/checkout/OrderSummary.astro`, `src/components/checkout/PaymentForm.astro`, and `src/components/checkout/PayButton.astro`. No named payment gateway, server endpoint, or webhook implementation appears in the supplied tree; payment integration details must be verified before extending transactional behavior.

#### Styling and static assets

Styles are organized per product surface under `src/css`, including `src/css/dashboard.css`, `src/css/payment.css`, and `src/css/planes.css`; these support independently styled route domains. Static public assets belong in `public`, while source-managed assets are under `src/assets`.

Main entry points: [`src/pages/dashboard.astro`](https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/dashboard.astro) (Account routes), [`src/layouts/BaseLayout.astro`](https://github.com/patovamp/dreamjob-astro/blob/main/src/layouts/BaseLayout.astro) (Base layout), [`src/pages/index.astro`](https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/index.astro) (Public discovery routes), [`src/lib/fetchUserData.js`](https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/fetchUserData.js) (User/profile service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Astro Runtime"]
  node_astro{{"Astro / Node toolchain<br/>runtime<br/>[astro.config.mjs]"}}
end

subgraph group_routes["Routes &amp; Layout"]
  node_base_layout["Base layout<br/>Astro layout<br/>[BaseLayout.astro]"]
  node_public_routes["Public discovery routes<br/>Astro pages<br/>[index.astro]"]
  node_auth_routes["Identity routes<br/>Astro pages<br/>[login.astro]"]
  node_account_routes["Account routes<br/>Astro pages<br/>[dashboard.astro]"]
end

subgraph group_ui["UI Composition"]
  node_header["Site header<br/>Astro component<br/>[Header.astro]"]
  node_plans_section["Plan selection<br/>Astro component<br/>[PlansSection.astro]"]
  node_checkout["Checkout UI<br/>Astro components<br/>[PaymentForm.astro]"]
  node_role_dashboard["Role dashboards<br/>Astro components<br/>[Empleado.astro]"]
end

subgraph group_client["Browser Behavior"]
  node_navigation_js["Navigation behavior<br/>browser JS<br/>[navbar.js]"]
  node_auth_js["Auth lifecycle<br/>browser JS<br/>[login.js]"]
  node_account_js["Profile handlers<br/>browser JS<br/>[profile.js]"]
  node_job_dashboard_js["Job &amp; dashboard handlers<br/>browser JS<br/>[dashboard.js]"]
end

subgraph group_integration["Service Boundary"]
  node_auth_service["Auth/session service<br/>lib integration<br/>[auth.js]"]
  node_user_service["User/profile service<br/>lib integration<br/>[fetchUserData.js]"]
  node_jobs_service["Job listing service<br/>lib integration<br/>[listJobs.js]"]
  node_api_contracts["Shared API types<br/>TypeScript declarations<br/>[types.d.ts]"]
  node_remote_services[("Remote identity &amp; job APIs<br/>external services")]
end

node_styles["Surface styles<br/>CSS<br/>[dashboard.css]"]
node_assets["Static assets<br/>asset directories"]

node_astro -->|"serves"| node_public_routes
node_astro -->|"serves"| node_auth_routes
node_astro -->|"serves"| node_account_routes
node_public_routes -->|"uses"| node_base_layout
node_auth_routes -->|"uses"| node_base_layout
node_account_routes -->|"uses"| node_base_layout
node_base_layout -->|"composes"| node_header
node_header -->|"loads"| node_navigation_js
node_public_routes -->|"renders plans"| node_plans_section
node_plans_section -->|"continues to payment"| node_account_routes
node_account_routes -->|"renders payment"| node_checkout
node_account_routes -->|"renders dashboard"| node_role_dashboard
node_auth_routes -->|"loads"| node_auth_js
node_account_routes -->|"loads"| node_account_js
node_account_routes -->|"loads"| node_job_dashboard_js
node_auth_js -->|"auth requests"| node_auth_service
node_account_js -->|"reads and updates user"| node_user_service
node_job_dashboard_js -->|"retrieves jobs"| node_jobs_service
node_job_dashboard_js -->|"retrieves current user"| node_user_service
node_auth_service -->|"integrates"| node_remote_services
node_user_service -->|"integrates"| node_remote_services
node_jobs_service -->|"integrates"| node_remote_services
node_auth_service -.->|"uses shapes"| node_api_contracts
node_user_service -.->|"uses shapes"| node_api_contracts
node_jobs_service -.->|"uses shapes"| node_api_contracts
node_public_routes -.->|"styled by"| node_styles
node_account_routes -.->|"styled by"| node_styles
node_base_layout -.->|"serves assets"| node_assets

click node_astro "https://github.com/patovamp/dreamjob-astro/blob/main/astro.config.mjs"
click node_base_layout "https://github.com/patovamp/dreamjob-astro/blob/main/src/layouts/BaseLayout.astro"
click node_public_routes "https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/index.astro"
click node_auth_routes "https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/login.astro"
click node_account_routes "https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/dashboard.astro"
click node_header "https://github.com/patovamp/dreamjob-astro/blob/main/src/components/Header.astro"
click node_plans_section "https://github.com/patovamp/dreamjob-astro/blob/main/src/components/PlansSection.astro"
click node_checkout "https://github.com/patovamp/dreamjob-astro/blob/main/src/components/checkout/PaymentForm.astro"
click node_role_dashboard "https://github.com/patovamp/dreamjob-astro/blob/main/src/components/dashboard/Empleado.astro"
click node_navigation_js "https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/navbar.js"
click node_auth_js "https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/login.js"
click node_account_js "https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/profile.js"
click node_job_dashboard_js "https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/dashboard.js"
click node_auth_service "https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/auth.js"
click node_user_service "https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/fetchUserData.js"
click node_jobs_service "https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/listJobs.js"
click node_api_contracts "https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/types.d.ts"
click node_styles "https://github.com/patovamp/dreamjob-astro/blob/main/src/css/dashboard.css"
click node_assets "https://github.com/patovamp/dreamjob-astro/tree/main/public"

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_astro toneBlue
class node_base_layout,node_public_routes,node_auth_routes,node_account_routes toneAmber
class node_header,node_plans_section,node_checkout,node_role_dashboard toneMint
class node_navigation_js,node_auth_js,node_account_js,node_job_dashboard_js toneRose
class node_auth_service,node_user_service,node_jobs_service,node_api_contracts,node_remote_services toneIndigo
class node_styles,node_assets toneNeutral
```

## Components

### Astro Runtime

- [Astro / Node toolchain](https://github.com/patovamp/dreamjob-astro/blob/main/astro.config.mjs): runtime · Build and server runtime packaged with pnpm. · `astro.config.mjs`

### Routes & Layout

- [Base layout](https://github.com/patovamp/dreamjob-astro/blob/main/src/layouts/BaseLayout.astro): Astro layout · Shared document shell and navigation styling. · `src/layouts/BaseLayout.astro`
- [Public discovery routes](https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/index.astro): Astro pages · Home, jobs, companies, and plans journeys. · `src/pages/index.astro`
- [Identity routes](https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/login.astro): Astro pages · Login and role-specific registration journeys. · `src/pages/login.astro`
- [Account routes](https://github.com/patovamp/dreamjob-astro/blob/main/src/pages/dashboard.astro): Astro pages · Dashboard, profile, and payment journeys. · `src/pages/dashboard.astro`

### UI Composition

- [Site header](https://github.com/patovamp/dreamjob-astro/blob/main/src/components/Header.astro): Astro component · `src/components/Header.astro`
- [Plan selection](https://github.com/patovamp/dreamjob-astro/blob/main/src/components/PlansSection.astro): Astro component · Composes subscription plans and plan cards. · `src/components/PlansSection.astro`
- [Checkout UI](https://github.com/patovamp/dreamjob-astro/blob/main/src/components/checkout/PaymentForm.astro): Astro components · Order summary, payment form, and pay action. · `src/components/checkout/PaymentForm.astro`
- [Role dashboards](https://github.com/patovamp/dreamjob-astro/blob/main/src/components/dashboard/Empleado.astro): Astro components · Employee, employer, and company dashboard views. · `src/components/dashboard/Empleado.astro`

### Browser Behavior

- [Navigation behavior](https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/navbar.js): browser JS · Navbar and hamburger-menu interaction. · `src/javascript/navbar.js`
- [Auth lifecycle](https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/login.js): browser JS · Login, registration, and logout handlers. · `src/javascript/login.js`
- [Profile handlers](https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/profile.js): browser JS · Profile and user-form mutation behavior. · `src/javascript/profile.js`
- [Job & dashboard handlers](https://github.com/patovamp/dreamjob-astro/blob/main/src/javascript/dashboard.js): browser JS · Job interactions and dashboard behavior. · `src/javascript/dashboard.js`

### Service Boundary

- [Auth/session service](https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/auth.js): lib integration · Remote authentication and session seam. · `src/lib/auth.js`
- [User/profile service](https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/fetchUserData.js): lib integration · Current-user retrieval and profile mutation seam. · `src/lib/fetchUserData.js`
- [Job listing service](https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/listJobs.js): lib integration · Remote job retrieval seam. · `src/lib/listJobs.js`
- [Shared API types](https://github.com/patovamp/dreamjob-astro/blob/main/src/lib/types.d.ts): TypeScript declarations · Shared response and user-shape contract. · `src/lib/types.d.ts`
- **Remote identity & job APIs**: external services · Provider and endpoints are not identified in the repository inputs.

### Other components

- [Surface styles](https://github.com/patovamp/dreamjob-astro/blob/main/src/css/dashboard.css): CSS · Route-domain styling for dashboard, payment, and plans. · `src/css/dashboard.css`
- [Static assets](https://github.com/patovamp/dreamjob-astro/tree/main/public): asset directories · Public files and source-managed assets. · `public`

## Connections

- Astro / Node toolchain → Public discovery routes: serves
- Astro / Node toolchain → Identity routes: serves
- Astro / Node toolchain → Account routes: serves
- Public discovery routes → Base layout: uses
- Identity routes → Base layout: uses
- Account routes → Base layout: uses
- Base layout → Site header: composes
- Site header → Navigation behavior: loads
- Public discovery routes → Plan selection: renders plans
- Plan selection → Account routes: continues to payment
- Account routes → Checkout UI: renders payment
- Account routes → Role dashboards: renders dashboard
- Identity routes → Auth lifecycle: loads
- Account routes → Profile handlers: loads
- Account routes → Job & dashboard handlers: loads
- Auth lifecycle → Auth/session service: auth requests
- Profile handlers → User/profile service: reads and updates user
- Job & dashboard handlers → Job listing service: retrieves jobs
- Job & dashboard handlers → User/profile service: retrieves current user
- Auth/session service → Remote identity & job APIs: integrates
- User/profile service → Remote identity & job APIs: integrates
- Job listing service → Remote identity & job APIs: integrates
- Auth/session service → Shared API types: uses shapes
- User/profile service → Shared API types: uses shapes
- Job listing service → Shared API types: uses shapes
- Public discovery routes → Surface styles: styled by
- Account routes → Surface styles: styled by
- Base layout → Static assets: serves assets
