# marin1321/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/marin1321/portfolio
- Repository: https://github.com/marin1321/portfolio

## Overview

1. **Repository shape**
   - This is a **static Astro portfolio** with a single public page (`/`) plus a bilingual `404`.
   - Build output is a static site in `dist/`, intended for **Vercel** hosting.

2. **Primary architecture boundary**
   - The codebase is split into:
     - `src/data/` for all content and site configuration,
     - `src/components/` for presentation and small UI interactions,
     - `src/layouts/` for document-level chrome and SEO,
     - `src/pages/` for route entrypoints,
     - `public/` for files copied verbatim to the site root.

3. **Content is data-driven, not hardcoded in components**
   - The portfolio’s text, bilingual copy, project list, and work history live in TypeScript modules under `src/data/`.
   - Updating the portfolio content is meant to happen by editing those data files, with components remaining mostly unchanged.

4. **Internationalization model**
   - The site renders **both English and Spanish in the same static HTML**.
   - Language visibility is controlled by `<html data-lang="...">` and CSS rules that hide the inactive language.
   - `LangToggle` persists the choice in `localStorage` and emits a `lang:change` event so dependent UI like download links can update without full hydration.

5. **Page composition flow**
   - `src/pages/index.astro` is the composition root: it assembles the landing page from section components.
   - The main sections are `Hero`, `About`, `Work`, `Experience`, and `Contact`.
   - `BaseLayout` wraps the page with meta tags, Open Graph data, font setup, and other document-level concerns.

6. **Interactive UI boundaries**
   - Most components are Astro components with minimal client-side behavior.
   - Interactivity is concentrated in a few UI pieces: language toggle, theme toggle, project filtering/dialog behavior, and the contact form.
   - This keeps the site close to the “zero JS by default” Astro model.

7. **Data flow through the UI**
   - `src/data/projects.ts` feeds `ProjectCard`, `ProjectDialog`, `ProjectFilter`, and `ProjectLink`.
   - `src/data/experience.ts` feeds timeline-style experience rendering.
   - `src/data/i18n.ts` holds UI strings plus personal details and CV file references.
   - `src/data/site.ts` centralizes site metadata sourced from `PUBLIC_*` environment variables.

8. **Styling and design system**
   - Global styling is in `src/styles/global.css`, using **Tailwind CSS v4** with CSS-first `@theme` tokens.
   - Design tokens define the palette, typography weights, radii, shadows, and motion.
   - `ThemeToggle` supports light/dark presentation, so theme is a distinct UI concern rather than part of routing or content.

9. **Static assets and generation pipeline**
   - `public/` contains files deployed as-is: CV PDFs, `robots.txt`, `site.webmanifest`, and generated icons/OG assets.
   - `scripts/build-assets.mjs` generates icon variants and the Open Graph image from master SVGs in `src/assets/`.
   - The asset pipeline is separate from the page build, which keeps branding assets reproducible.

10. **SEO and metadata**
   - The layout and public files together provide the SEO surface: meta tags, Open Graph image, sitemap support, robots, and PWA manifest.
   - The 404 page is also bilingual, which suggests the project treats non-happy-path routing as part of the same localization model.

11. **Contact form boundary**
   - The contact form is designed to work with an optional **Formspree** endpoint from `PUBLIC_FORMSPREE_ENDPOINT`.
   - If that env var is absent, it falls back to a `mailto:` flow, so the site remains functional without backend configuration.

12. **Build, quality, and CI pipeline**
   - Developer workflow includes `astro check`/TypeScript validation, static build, preview, Lighthouse audit, and axe-core accessibility audit.
   - GitHub Actions runs build validation and accessibility checks on every push/PR.
   - Lighthouse is intentionally kept out of CI and used as a local or manual verification step.

13. **Operational/deployment boundary**
   - Vercel is the production host, with the Astro build output deployed as static files.
   - Any `PUBLIC_*` values are inlined at build time, so they are part of the client-visible configuration surface and must not contain secrets.

Main entry points: [`src/pages/index.astro`](https://github.com/marin1321/portfolio/blob/main/src/pages/index.astro) (Home page), [`src/layouts/BaseLayout.astro`](https://github.com/marin1321/portfolio/blob/main/src/layouts/BaseLayout.astro) (Base layout), [`src/components/ui/LangToggle.astro`](https://github.com/marin1321/portfolio/blob/main/src/components/ui/LangToggle.astro) (Lang toggle), [`.github/workflows/ci.yml`](https://github.com/marin1321/portfolio/blob/main/.github/workflows/ci.yml) (CI workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_content["Content & config"]
  node_n_site["Site config<br/>data module<br/>[site.ts]"]
  node_n_i18n["Copy & links<br/>data module<br/>[i18n.ts]"]
  node_n_projects["Projects data<br/>data module<br/>[projects.ts]"]
  node_n_experience["Experience data<br/>data module<br/>[experience.ts]"]
end

subgraph group_grp_ui["UI components"]
  node_n_header["Navbar<br/>layout ui<br/>[Navbar.astro]"]
  node_n_footer["Footer<br/>layout ui<br/>[Footer.astro]"]
  node_n_hero["Hero<br/>section<br/>[Hero.astro]"]
  node_n_about["About<br/>section<br/>[About.astro]"]
  node_n_work["Work<br/>section<br/>[Work.astro]"]
  node_n_exps["Experience<br/>section<br/>[Experience.astro]"]
  node_n_contact["Contact<br/>section<br/>[Contact.astro]"]
  node_n_lang(("Lang toggle<br/>interactive ui<br/>[LangToggle.astro]"))
  node_n_theme(("Theme toggle<br/>interactive ui<br/>[ThemeToggle.astro]"))
  node_n_localized["Localized<br/>i18n helper<br/>[Localized.astro]"]
  node_n_proj_ui["Project UI<br/>project components"]
  node_n_skill["Skill tag<br/>ui atom<br/>[SkillTag.astro]"]
  node_n_timeline["Timeline item<br/>ui atom<br/>[TimelineItem.astro]"]
  node_n_contact_form["Contact form<br/>interactive form<br/>[ContactForm.astro]"]
end

subgraph group_grp_shell["Page shell"]
  node_n_base["Base layout<br/>document shell<br/>[BaseLayout.astro]"]
  node_n_index["Home page<br/>route entry<br/>[index.astro]"]
  node_n_404["404 page<br/>route entry<br/>[404.astro]"]
end

subgraph group_grp_assets["Assets & styling"]
  node_n_global_css["Global CSS<br/>styling<br/>[global.css]"]
  node_n_public[("Public assets<br/>static assets")]
end

subgraph group_grp_tooling["Tooling & deploy"]
  node_n_build_assets["Asset build<br/>asset pipeline<br/>[build-assets.mjs]"]
  node_n_ci["CI workflow<br/>github actions<br/>[ci.yml]"]
  node_n_a11y["A11y check<br/>validation script<br/>[a11y.mjs]"]
  node_n_lighthouse["Lighthouse<br/>audit script<br/>[lighthouse.mjs]"]
end

node_n_index -->|"wrapped by"| node_n_base
node_n_404 -->|"wrapped by"| node_n_base
node_n_index -->|"composes"| node_n_header
node_n_index -->|"composes"| node_n_hero
node_n_index -->|"composes"| node_n_about
node_n_index -->|"composes"| node_n_work
node_n_index -->|"composes"| node_n_exps
node_n_index -->|"composes"| node_n_contact
node_n_index -->|"composes"| node_n_footer
node_n_header -->|"uses"| node_n_lang
node_n_header -->|"uses"| node_n_theme
node_n_hero -->|"renders"| node_n_localized
node_n_about -->|"reads"| node_n_i18n
node_n_work -->|"reads"| node_n_projects
node_n_work -->|"renders"| node_n_proj_ui
node_n_exps -->|"reads"| node_n_experience
node_n_exps -->|"renders"| node_n_timeline
node_n_contact -->|"contains"| node_n_contact_form
node_n_contact_form -->|"reads"| node_n_i18n
node_n_contact_form -->|"reads"| node_n_site
node_n_proj_ui -->|"reads"| node_n_projects
node_n_proj_ui -->|"reacts to"| node_n_lang
node_n_localized -->|"depends on"| node_n_lang
node_n_base -->|"reads"| node_n_site
node_n_base -->|"includes"| node_n_global_css
node_n_global_css -->|"supports"| node_n_lang
node_n_global_css -->|"supports"| node_n_theme
node_n_build_assets -->|"writes"| node_n_public
node_n_ci -->|"runs"| node_n_a11y
node_n_ci -->|"validates"| node_n_build_assets
node_n_ci -->|"builds"| node_n_index
node_n_lighthouse -->|"audits"| node_n_index
node_n_public -->|"serves"| node_n_base

click node_n_site "https://github.com/marin1321/portfolio/blob/main/src/data/site.ts"
click node_n_i18n "https://github.com/marin1321/portfolio/blob/main/src/data/i18n.ts"
click node_n_projects "https://github.com/marin1321/portfolio/blob/main/src/data/projects.ts"
click node_n_experience "https://github.com/marin1321/portfolio/blob/main/src/data/experience.ts"
click node_n_base "https://github.com/marin1321/portfolio/blob/main/src/layouts/BaseLayout.astro"
click node_n_index "https://github.com/marin1321/portfolio/blob/main/src/pages/index.astro"
click node_n_404 "https://github.com/marin1321/portfolio/blob/main/src/pages/404.astro"
click node_n_header "https://github.com/marin1321/portfolio/blob/main/src/components/layout/Navbar.astro"
click node_n_footer "https://github.com/marin1321/portfolio/blob/main/src/components/layout/Footer.astro"
click node_n_hero "https://github.com/marin1321/portfolio/blob/main/src/components/sections/Hero.astro"
click node_n_about "https://github.com/marin1321/portfolio/blob/main/src/components/sections/About.astro"
click node_n_work "https://github.com/marin1321/portfolio/blob/main/src/components/sections/Work.astro"
click node_n_exps "https://github.com/marin1321/portfolio/blob/main/src/components/sections/Experience.astro"
click node_n_contact "https://github.com/marin1321/portfolio/blob/main/src/components/sections/Contact.astro"
click node_n_lang "https://github.com/marin1321/portfolio/blob/main/src/components/ui/LangToggle.astro"
click node_n_theme "https://github.com/marin1321/portfolio/blob/main/src/components/ui/ThemeToggle.astro"
click node_n_localized "https://github.com/marin1321/portfolio/blob/main/src/components/ui/Localized.astro"
click node_n_skill "https://github.com/marin1321/portfolio/blob/main/src/components/ui/SkillTag.astro"
click node_n_timeline "https://github.com/marin1321/portfolio/blob/main/src/components/ui/TimelineItem.astro"
click node_n_contact_form "https://github.com/marin1321/portfolio/blob/main/src/components/ui/ContactForm.astro"
click node_n_global_css "https://github.com/marin1321/portfolio/blob/main/src/styles/global.css"
click node_n_public "https://github.com/marin1321/portfolio/tree/main/public"
click node_n_build_assets "https://github.com/marin1321/portfolio/blob/main/scripts/build-assets.mjs"
click node_n_ci "https://github.com/marin1321/portfolio/blob/main/.github/workflows/ci.yml"
click node_n_a11y "https://github.com/marin1321/portfolio/blob/main/scripts/a11y.mjs"
click node_n_lighthouse "https://github.com/marin1321/portfolio/blob/main/scripts/lighthouse.mjs"

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_n_site,node_n_i18n,node_n_projects,node_n_experience toneBlue
class node_n_header,node_n_footer,node_n_hero,node_n_about,node_n_work,node_n_exps,node_n_contact,node_n_lang,node_n_theme,node_n_localized,node_n_proj_ui,node_n_skill,node_n_timeline,node_n_contact_form toneAmber
class node_n_base,node_n_index,node_n_404 toneMint
class node_n_global_css,node_n_public toneRose
class node_n_build_assets,node_n_ci,node_n_a11y,node_n_lighthouse toneIndigo
```

## Components

### Content & config

Data modules and site configuration that drive the portfolio copy and metadata.

- [Site config](https://github.com/marin1321/portfolio/blob/main/src/data/site.ts): data module · Central site metadata and build-time public environment values. · `src/data/site.ts`
- [Copy & links](https://github.com/marin1321/portfolio/blob/main/src/data/i18n.ts): data module · Bilingual UI strings, personal details, and CV file references. · `src/data/i18n.ts`
- [Projects data](https://github.com/marin1321/portfolio/blob/main/src/data/projects.ts): data module · Project list and metadata consumed by the portfolio project UI. · `src/data/projects.ts`
- [Experience data](https://github.com/marin1321/portfolio/blob/main/src/data/experience.ts): data module · Work history and timeline content for the experience section. · `src/data/experience.ts`

### UI components

Presentation components and small interactions used to compose the site.

- [Navbar](https://github.com/marin1321/portfolio/blob/main/src/components/layout/Navbar.astro): layout ui · Top-level navigation and site header chrome. · `src/components/layout/Navbar.astro`
- [Footer](https://github.com/marin1321/portfolio/blob/main/src/components/layout/Footer.astro): layout ui · Bottom-page footer and supporting links. · `src/components/layout/Footer.astro`
- [Hero](https://github.com/marin1321/portfolio/blob/main/src/components/sections/Hero.astro): section · Landing intro section. · `src/components/sections/Hero.astro`
- [About](https://github.com/marin1321/portfolio/blob/main/src/components/sections/About.astro): section · Profile and summary section. · `src/components/sections/About.astro`
- [Work](https://github.com/marin1321/portfolio/blob/main/src/components/sections/Work.astro): section · Project showcase section. · `src/components/sections/Work.astro`
- [Experience](https://github.com/marin1321/portfolio/blob/main/src/components/sections/Experience.astro): section · Timeline-style career section. · `src/components/sections/Experience.astro`
- [Contact](https://github.com/marin1321/portfolio/blob/main/src/components/sections/Contact.astro): section · Contact section with outbound form or mail flow. · `src/components/sections/Contact.astro`
- [Lang toggle](https://github.com/marin1321/portfolio/blob/main/src/components/ui/LangToggle.astro): interactive ui · Persists language choice and broadcasts language changes. · `src/components/ui/LangToggle.astro`
- [Theme toggle](https://github.com/marin1321/portfolio/blob/main/src/components/ui/ThemeToggle.astro): interactive ui · Controls light and dark presentation mode. · `src/components/ui/ThemeToggle.astro`
- [Localized](https://github.com/marin1321/portfolio/blob/main/src/components/ui/Localized.astro): i18n helper · Shows language-specific content in the shared static HTML. · `src/components/ui/Localized.astro`
- **Project UI**: project components · Project card, dialog, filter, and link presentation flow.
- [Skill tag](https://github.com/marin1321/portfolio/blob/main/src/components/ui/SkillTag.astro): ui atom · Small reusable label for skills and tags. · `src/components/ui/SkillTag.astro`
- [Timeline item](https://github.com/marin1321/portfolio/blob/main/src/components/ui/TimelineItem.astro): ui atom · Reusable experience timeline row. · `src/components/ui/TimelineItem.astro`
- [Contact form](https://github.com/marin1321/portfolio/blob/main/src/components/ui/ContactForm.astro): interactive form · Formspree-or-mailto contact submission boundary. · `src/components/ui/ContactForm.astro`

### Page shell

Route entrypoints and document-level layout concerns.

- [Base layout](https://github.com/marin1321/portfolio/blob/main/src/layouts/BaseLayout.astro): document shell · Wraps pages with metadata, font setup, Open Graph, and SEO chrome. · `src/layouts/BaseLayout.astro`
- [Home page](https://github.com/marin1321/portfolio/blob/main/src/pages/index.astro): route entry · Main composition root assembling the portfolio landing page. · `src/pages/index.astro`
- [404 page](https://github.com/marin1321/portfolio/blob/main/src/pages/404.astro): route entry · Bilingual fallback page for missing routes. · `src/pages/404.astro`

### Assets & styling

Global styling plus generated/static assets delivered with the site.

- [Global CSS](https://github.com/marin1321/portfolio/blob/main/src/styles/global.css): styling · Tailwind v4 global stylesheet with CSS-first design tokens. · `src/styles/global.css`
- [Public assets](https://github.com/marin1321/portfolio/tree/main/public): static assets · Verbatim site-root files such as PDFs, robots, manifest, and generated icons. · `public`

### Tooling & deploy

Build-time scripts, checks, and deployment workflow.

- [Asset build](https://github.com/marin1321/portfolio/blob/main/scripts/build-assets.mjs): asset pipeline · Generates icons and Open Graph imagery from master SVG sources. · `scripts/build-assets.mjs`
- [CI workflow](https://github.com/marin1321/portfolio/blob/main/.github/workflows/ci.yml): github actions · Build and accessibility validation on push and pull request. · `.github/workflows/ci.yml`
- [A11y check](https://github.com/marin1321/portfolio/blob/main/scripts/a11y.mjs): validation script · Accessibility audit used in validation workflows. · `scripts/a11y.mjs`
- [Lighthouse](https://github.com/marin1321/portfolio/blob/main/scripts/lighthouse.mjs): audit script · Manual or local performance and quality audit. · `scripts/lighthouse.mjs`

## Connections

- Home page → Base layout: wrapped by · Home page is rendered inside the base layout.
- 404 page → Base layout: wrapped by · 404 page uses the same document shell and metadata surface.
- Home page → Navbar: composes · Landing page includes site navigation.
- Home page → Hero: composes · Landing page starts with the hero section.
- Home page → About: composes · Landing page includes the about section.
- Home page → Work: composes · Landing page includes the project showcase section.
- Home page → Experience: composes · Landing page includes the experience section.
- Home page → Contact: composes · Landing page ends with contact.
- Home page → Footer: composes · Landing page includes footer chrome.
- Navbar → Lang toggle: uses · Header exposes the language switcher.
- Navbar → Theme toggle: uses · Header exposes the theme switcher.
- Hero → Localized: renders · Hero content is language-aware.
- About → Copy & links: reads · About section pulls localized copy.
- Work → Projects data: reads · Work section is driven by project data.
- Work → Project UI: renders · Project showcase is built from project UI pieces.
- Experience → Experience data: reads · Experience section is driven by work-history data.
- Experience → Timeline item: renders · Experience section uses timeline rows.
- Contact → Contact form: contains · Contact section hosts the submission boundary.
- Contact form → Copy & links: reads · Contact form uses localized strings and CV references.
- Contact form → Site config: reads · Form endpoint and site metadata come from build-time config.
- Project UI → Projects data: reads · Project cards, dialogs, filters, and links all consume the project dataset.
- Project UI → Lang toggle: reacts to · Project-related UI updates when language changes.
- Localized → Lang toggle: depends on · Localized helper is driven by current language state.
- Base layout → Site config: reads · Base layout injects site metadata and public env values into SEO tags.
- Base layout → Global CSS: includes · Document shell loads the global stylesheet.
- Global CSS → Lang toggle: supports · CSS hides inactive language based on the html data-lang attribute.
- Global CSS → Theme toggle: supports · Design tokens and classes support theme presentation.
- Asset build → Public assets: writes · Generated icons and social images are emitted into public assets.
- CI workflow → A11y check: runs · CI includes accessibility validation.
- CI workflow → Asset build: validates · CI exercises the asset generation pipeline as part of build checks.
- CI workflow → Home page: builds · Workflow validates the static site build.
- Lighthouse → Home page: audits · Lighthouse targets the built site locally or manually.
- Public assets → Base layout: serves · Public files provide robots, manifest, PDFs, and generated imagery for the site shell.
