How marin1321/portfolio works
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: index.astro Home page · BaseLayout.astro Base layout · LangToggle.astro Lang toggle · ci.yml CI workflow
Components 27
Content & config
Data modules and site configuration that drive the portfolio copy and metadata.
- Site config · Central site metadata and build-time public environment values.
src/data/site.ts - Copy & links · Bilingual UI strings, personal details, and CV file references.
src/data/i18n.ts - Projects data · Project list and metadata consumed by the portfolio project UI.
src/data/projects.ts - Experience data · 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 · Top-level navigation and site header chrome.
src/components/layout/Navbar.astro - Footer · Bottom-page footer and supporting links.
src/components/layout/Footer.astro - Hero · Landing intro section.
src/components/sections/Hero.astro - About · Profile and summary section.
src/components/sections/About.astro - Work · Project showcase section.
src/components/sections/Work.astro - Experience · Timeline-style career section.
src/components/sections/Experience.astro - Contact · Contact section with outbound form or mail flow.
src/components/sections/Contact.astro - Lang toggle · Persists language choice and broadcasts language changes.
src/components/ui/LangToggle.astro - Theme toggle · Controls light and dark presentation mode.
src/components/ui/ThemeToggle.astro - Localized · Shows language-specific content in the shared static HTML.
src/components/ui/Localized.astro - Project UI · Project card, dialog, filter, and link presentation flow.
- Skill tag · Small reusable label for skills and tags.
src/components/ui/SkillTag.astro - Timeline item · Reusable experience timeline row.
src/components/ui/TimelineItem.astro - Contact form · Formspree-or-mailto contact submission boundary.
src/components/ui/ContactForm.astro
Page shell
Route entrypoints and document-level layout concerns.
- Base layout · Wraps pages with metadata, font setup, Open Graph, and SEO chrome.
src/layouts/BaseLayout.astro - Home page · Main composition root assembling the portfolio landing page.
src/pages/index.astro - 404 page · Bilingual fallback page for missing routes.
src/pages/404.astro
Assets & styling
Global styling plus generated/static assets delivered with the site.
- Global CSS · Tailwind v4 global stylesheet with CSS-first design tokens.
src/styles/global.css - Public 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 · Generates icons and Open Graph imagery from master SVG sources.
scripts/build-assets.mjs - CI workflow · Build and accessibility validation on push and pull request.
.github/workflows/ci.yml - A11y check · Accessibility audit used in validation workflows.
scripts/a11y.mjs - Lighthouse · Manual or local performance and quality audit.
scripts/lighthouse.mjs
Connections 33
- 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.