How patovamp/dreamjob-astro works
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: dashboard.astro Account routes · BaseLayout.astro Base layout · index.astro Public discovery routes · fetchUserData.js User/profile service
Components 20
Astro Runtime
- Astro / Node toolchain · Build and server runtime packaged with pnpm.
astro.config.mjs
Routes & Layout
- Base layout · Shared document shell and navigation styling.
src/layouts/BaseLayout.astro - Public discovery routes · Home, jobs, companies, and plans journeys.
src/pages/index.astro - Identity routes · Login and role-specific registration journeys.
src/pages/login.astro - Account routes · Dashboard, profile, and payment journeys.
src/pages/dashboard.astro
UI Composition
- Site header
src/components/Header.astro - Plan selection · Composes subscription plans and plan cards.
src/components/PlansSection.astro - Checkout UI · Order summary, payment form, and pay action.
src/components/checkout/PaymentForm.astro - Role dashboards · Employee, employer, and company dashboard views.
src/components/dashboard/Empleado.astro
Browser Behavior
- Navigation behavior · Navbar and hamburger-menu interaction.
src/javascript/navbar.js - Auth lifecycle · Login, registration, and logout handlers.
src/javascript/login.js - Profile handlers · Profile and user-form mutation behavior.
src/javascript/profile.js - Job & dashboard handlers · Job interactions and dashboard behavior.
src/javascript/dashboard.js
Service Boundary
- Auth/session service · Remote authentication and session seam.
src/lib/auth.js - User/profile service · Current-user retrieval and profile mutation seam.
src/lib/fetchUserData.js - Job listing service · Remote job retrieval seam.
src/lib/listJobs.js - Shared API types · Shared response and user-shape contract.
src/lib/types.d.ts - Remote identity & job APIs · Provider and endpoints are not identified in the repository inputs.
Other components
- Surface styles · Route-domain styling for dashboard, payment, and plans.
src/css/dashboard.css - Static assets · Public files and source-managed assets.
public
Connections 28
- 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