Creating a production-ready engineering blueprint aligned with the prior IA and this project's React + Vite + Tailwind stack, and saving it in the repo as the implementation reference.
Noting the repo is React + Vite + Tailwind v4 (not Next.js). Writing the engineering blueprint to match that constraint while preserving the premium portfolio architecture from the IA phase.
Engineering Foundation — Technical Blueprint
Project: Premium Personal Portfolio / Graphic Resume
Phase: Step 2 — Engineering Foundation (no application code yet)
Aligned with: Strategy & IA (Step 1)
Runtime constraint: React + Vite + TypeScript + Tailwind CSS v4 (static SPA)
Full document also saved at docs/02-engineering-foundation.md.
0. Constraint Alignment
This repo is Vite + React 19 + Tailwind v4, not Next.js. The blueprint keeps Next-grade patterns (typed content modules, metadata per route, image discipline, strict component boundaries) without a server runtime.
| Layer | Decision |
|---|
| Bundler | Vite 7 |
| UI | React 19 |
| Language | TypeScript strict |
| Styling | Tailwind CSS v4 (@tailwindcss/vite) |
| Routing | react-router (to add) |
| Motion | framer-motion (to add) |
| SEO head | react-helmet-async (to add) |
| Classes | clsx + tailwind-merge → cn() (already present) |
| Content | Local typed TS modules — no CMS / DB / uploads |
| Deploy | Static host + SPA fallback |
Why Vite over Next here: no server needs, faster DX, simpler static hosting, full design-system control, compatible with single-file build constraints. For a content-frozen portfolio, SSR adds cost without leverage.
1. Technical Stack & Boilerplate Selection
1.1 Locked stack
| Concern | Package | Why it fits a premium portfolio |
|---|
| App shell | react, react-dom | Standard, excellent design-system ecosystem |
| Build | vite + @vitejs/plugin-react | Instant HMR, native ESM, first-class TS |
| Types | typescript (strict) | Content schemas become compile-time contracts |
| Styling | tailwindcss@4 | Token-driven utilities; fast visual iteration |
| Class composition | clsx + tailwind-merge | Safe conditional classes |
| Routing | react-router v7 | Deep-linkable /work/:slug |
| Motion | framer-motion | Page/section transitions, filter layout, reduced-motion |
| Head/SEO | react-helmet-async | Title, description, OG, canonical per route |
| Icons | lucide-react | Neutral, tree-shakeable, consistent optical size |
| Media | Custom Img + optional vite-imagetools / Sharp CLI | No next/image; we own the pipeline |
| Validation (optional) | zod | Friendly runtime guards on content modules |
| Lint | ESLint 9 + typescript-eslint + jsx-a11y | Quality + accessibility |
| Format | Prettier + prettier-plugin-tailwindcss | Class order = clean visual diffs |
Do not add: CMS SDKs, auth/admin/upload, Redux/Zustand, CSS-in-JS, MUI/Chakra/Ant, carousel/parallax kits.
1.2 Why this stack wins
- Aesthetic control — tokens + handcrafted components, not kit chrome
- Performance ceiling — route-level code split, no SSR hydration tax
- Content as code — broken content fails the build
- Shareable project URLs without a server
- Motion as craft — portfolio-grade micro-interactions with
useReducedMotion
- 30-minute project additions without touching layout code
1.3 Scalable folder structure
public/assets/projects/{slug}/ # cover + gallery media
public/assets/about/ # portrait, resume.pdf
public/assets/brand/ # favicon, og-default.jpg
src/
main.tsx / App.tsx / index.css
content/ # ★ single source of truth
site.ts, home.ts, about.ts, contact.ts, categories.ts
projects/_template.ts, index.ts, {slug}.ts
types/ # site, content, project, blocks
config/ # motion, seo, constants
components/
layout/ AppShell, Header, Footer, Container, Section, MobileNav
ui/ Button, Badge, Tag, Link, Eyebrow, Input, Prose...
content/ Hero, ProjectCard, ProjectGrid, FilterBar, blocks wrappers...
blocks/ BlockRenderer, FullImage, ImageGrid, Quote, Metrics...
media/ Img, Video
motion/ PageTransition, Reveal
seo/ SEO
pages/ Home, WorkIndex, Project, About, NotFound
hooks/ usePrefersReducedMotion, useFilteredProjects, useMediaQuery...
lib/ cn, projects (selectors), format
docs/ strategy, engineering, CONTENT.md
Rules: content/ never imports components/. Pages compose sections. Blocks are pure presentational. Public media uses absolute paths (/assets/...) so content stays bundler-agnostic.
2. Design System Foundation (Tokens & Constraints)
2.1 Theme strategy
CSS custom properties = source of truth → Tailwind v4 @theme bridges utilities.
Design intent → :root / [data-theme] variables → @theme inline → utilities in components
Why hybrid: runtime theme readiness, non-Tailwind consumers (Framer, SVG), single-file tuning, Tailwind v4 CSS-first config.
v1 mode decision: ship one authored theme (light-editorial or dark-editorial). Wire data-theme from day one; do not ship a half-broken toggle.
Glassmorphism policy: only on floating chrome (sticky header, mobile sheet). Never on photography. Spec: color-mix bg ~72% + backdrop-blur-12 + hairline; solid fallback.
2.2 Essential tokens
Color (semantic only)
bg, bg-elevated, bg-muted, fg, fg-muted, fg-subtle, border, border-strong, accent, accent-fg, accent-soft, overlay, system success/warning/danger (rare).
Components use semantic utilities (bg-bg, text-fg-muted) — never raw hex in JSX.
Typography (1.25 modular scale from 16px)
xs 12 → 6xl ~61 for hero. Roles: --font-sans (body/UI), --font-display (headlines), --font-mono (indexes). Display tracking ~-0.02em; eyebrows 0.08em sparingly.
Spacing
4px base, 8px rhythm. Scale: 0–32 (128px). Semantic:
--space-section-y: clamp(4.5rem, 8vw, 8rem) · --space-gutter: clamp(1.25rem, 4vw, 2rem) · prose measure 42rem · container 80–90rem.
Breakpoints (mobile-first)
sm 640 · md 768 · lg 1024 · xl 1280 · 2xl 1536
Radius
none (default for project imagery) · sm 4 · md 8 · lg 12 · full. Mixed image radii = amateur.
Elevation
Hairline borders + subtle shadows (elev-1 rest, elev-2 hover, elev-3 modal). Dark theme: luminous borders, shadows nearly off.
Z-index (named)
base 0 · dropdown 20 · sticky 40 · header 50 · overlay 60 · modal 70 · toast 80
Motion
Ease-out cubic-bezier(0.16, 1, 0.3, 1) · fast 150 / base 250 / slow 400 / page 500. JS variants in config/motion.ts must match CSS tokens.
2.3 Implementation
src/index.css:
@import "tailwindcss"
:root { …variables… } (+ [data-theme="dark"] if prepared)
@theme inline { …map to Tailwind… }
@layer base — reset, selection, focus-visible, reduced-motion
- Rare custom utilities only
Component rules: token utilities · cn() · variant APIs (primary|ghost, sm|md|lg) · no one-off hex.
2.4 Global style pillars
Quiet surfaces · tight display type · 90% neutral / 10% accent · full-bleed imagery without photo shadows · minimal chrome · system cursor · accent ::selection · visible focus rings · no scroll-jacking.
3. Component Library Strategy
3.1 Hierarchy
Tokens → ui/ atoms → layout/ + content/ organisms → pages → routes
↘ blocks/ (project body)
↘ motion/ + media/ + seo/
3.2 Layout
| Component | Role | Key props |
|---|
AppShell | Header + main + footer frame | children |
Header | Nav, brand, CTA, compact-on-scroll | navItems[], cta, brand, compactOnScroll? |
MobileNav | Sheet/full-screen <md | open, onClose, items, cta |
Footer | Secondary nav, socials, copyright | navItems, socialLinks, copyright, locationNote? |
Container | Width + gutters | size?: default|narrow|wide|full, as? |
Section | Vertical rhythm + anchor | id?, eyebrow?, title?, description?, padY? |
3.3 Atomic UI
| Component | Role | Key props |
|---|
Button | Primary action | variant, size, href?, iconLeft/Right?, disabled? |
Badge | Availability/status | tone?: neutral|accent|success, children |
Tag | Filter chip / meta | label, active?, count?, onClick?, as? |
IconButton | Icon-only control | label (required aria), icon, variant? |
Input / Textarea | Form fields | label, error?, hint? + controlled props |
Link | Internal/external | href, external?, variant?: inline|nav|quiet |
Eyebrow | Small section label | children |
Divider | Hairline | label? |
Prose | Rich text measure/styles | size?: base|lg |
3.4 Content components
| Component | Role | Key props |
|---|
HeroSection | 5-second positioning | titleLines[], subtitle, availabilityNote?, ctaPrimary, ctaSecondary?, backgroundMedia? |
ProjectCard | Gallery molecule | slug, title, category, year, cover{src,alt,ratio}, highlight?, href, priority?, index? |
ProjectGrid | Editorial/uniform layout | projects, layout?: editorial|uniform |
FilterBar | Category filter + URL sync | categories[{slug,label,count}], active, onChange |
FeaturedWork | Home selected work | projects, heading?, viewAllHref? |
Capabilities | Services list | items[{indexLabel,title,description,tags}] |
AboutTeaser | Home humanizing band | portrait, headline, shortBio, facts[], href |
Credibility | Stats + clients | stats?, clients? |
Testimonials | Static quote stack | items[{quote,author,role,company}] |
ContactSection | Conversion finale | headline, intro, email, note?, formEnabled? |
ProjectHeader / ProjectFacts | Detail title + meta row | Project fields |
ProjectBody | Block list host | blocks: MediaBlock[] |
NextProject |
3.5 Interaction
| Component | Role | Key props |
|---|
Reveal | Scroll-in once; no-op if reduced motion | delay?, y?, once? |
PageTransition | Route AnimatePresence | children keyed by pathname |
BlockRenderer | block.type → component map | block: MediaBlock |
Lightbox | Optional later; a11y focus trap | open, onClose, items, startIndex |
3.6 API conventions
Exported FooProps · mergeable className · href polymorphism on Button/Link · no fetching inside components · forward refs on interactive atoms · data enters only as props from pages/content.
4. Data Layer & Content Modeling
4.1 Format: TypeScript modules (not JSON, not MDX for v1)
| Format | Verdict |
|---|
| JSON | No types, weak refactors |
| MDX | Defer until journal exists |
| TS modules | Adopt — types, comments, autocomplete, tree-shake |
| Zod | Optional guard at registry boundary |
4.2 Core schemas (implementation-ready)
Project
interface Project {
id: string;
slug: string;
title: string;
subtitle?: string;
shortDescription: string; // ≤160 chars — cards + SEO
fullDescription: string;
categoryId: string;
tags: string[];
cover: MediaRef; // src, alt (required), ratio?, blurDataURL?
year: number | string;
period?: string;
client?: string;
industry?: string;
role: string[];
collaborators?: { name: string; role: string; url?: string }[];
tools: string[];
featured: boolean;
highlight: "standard" | "large" | "hero";
sortOrder: number;
links?: { label: string; url: string; type: "live" | "behance" | "dribbble" | "other" }[];
content: MediaBlock[];
testimonial?: { quote: string; author: string; role: string; company?: string };
metrics?: { value: string; label: string; context?: string }[];
relatedProjectIds?: string[];
status: "published" | "draft" | "archived";
seo?: { title?: string; description?: string; ogImage?: string };
}
MediaBlock — discriminated union:
fullImage · imageGrid · video · text · quote · metrics · palette · beforeAfter
Also define: SiteSettings, Category, HomeContent (with explicit featuredProjectIds: string[]), AboutContent, ContactContent, SocialLink, MediaRef.
4.3 Folder contracts
src/content/projects/{slug}.ts ↔ public/assets/projects/{slug}/
cover.webp + 01-overview.webp ... kebab-case, zero-padded
Selectors (src/lib/projects.ts):
getPublishedProjects · getFeaturedProjects(ids) (preserves order) · getProjectBySlug · getProjectsByCategory · getAdjacentProjects · getCategoryCounts
Drafts never render. Featured order is curated in home.ts, never “first N by date.”
5. Performance & Asset Management
5.1 Authoring targets
| Asset | Long edge | Format |
|---|
| Cover | 2000–2400px | AVIF/WebP + JPG fallback |
| Gallery | 1600–2000px | WebP/AVIF + JPG |
| OG | 1200×630 | JPG |
| Portrait | ~1600px | WebP |
Budgets: LCP image ≤ 200KB (ceiling ~350) · initial JS ≤ ~180KB gz · homepage excl. below-fold images ≤ 1.5MB
5.2 Vite-native Img (replaces next/image)
Contract: src, alt (required), width/height, ratio (CLS lock), sizes, srcSet?, priority? (eager + fetchpriority=high), blurDataURL?.
Behaviors: aspect box · lazy by default · async decode · blur-up until load · TS-enforced alt.
v1 path: hand-export WebP into public/ + smart Img.
v1.1: Sharp script (npm run optimize-images) or vite-imagetools if volume hurts.
5.3 Video
Mute, playsInline, poster required, preload="none" (hero: metadata). Reduced motion → poster only.
5.4 Bundle hygiene
Route-level React.lazy · per-icon lucide imports · self-hosted variable woff2 with font-display: swap · no full lodash/moment · optional LazyMotion · watch singlefile inlining regressions.
5.5 Lighthouse targets
Performance ≥ 95 desktop / ≥ 90 mobile · a11y ≥ 95 · BP ≥ 95 · SEO ≥ 95
6. Development Workflow & DX
6.1 Add a project (≤ 30 min once assets exist)
public/assets/projects/{slug}/ — drop media
- Copy
_template.ts → {slug}.ts
- Fill schema (
status: "published", required alts)
- Register in
projects/index.ts
- Optional:
featuredProjectIds in home.ts
- Verify
/work/{slug} · keyboard · mobile crop · Lighthouse
6.2 Lint / format
- ESLint flat +
typescript-eslint + react-hooks + react-refresh + jsx-a11y
- Prettier +
prettier-plugin-tailwindcss
- Scripts:
dev · build (tsc -b && vite build) · preview · lint · format
- TS:
strict, noUncheckedIndexedAccess, path alias @/* → src/*
6.3 Mockup → code pipeline
Visual direction → tokens in index.css → ui/ atoms (kitchen-sink route)
→ layout shell → real content modules → sections/pages
→ motion pass → perf + a11y pass
Rules: tokens before components · screenshot at 375/768/1280 · real content by Milestone 3 · motion last · one accent, one type ramp.
7. Implementation Roadmap (Phase 2 Action Plan)
| Milestone | Focus | Exit criteria |
|---|
| M0 Bootstrap (0.5d) | Alias @/, install router/motion/helmet/lucide, folder skeleton | Placeholders route; Tailwind compiles |
| M1 Tokens (0.5–1d) | CSS variables, @theme, fonts, base, kitchen-sink | AA contrast; type scale intentional |
| M2 Shell + routes (1d) | AppShell, Header, Footer, SEO, 5 routes | Keyboard nav; responsive header |
| M3 UI atoms (1d) | Button/Tag/Link/Img/Video… | Kitchen-sink complete |
| M4 Content layer (1d) | Types, site/home/about/categories, 2–3 projects, selectors, template | Drafts excluded; featured order works |
| M5 Portfolio surfaces (1.5–2d) | Card, grid, filter+URL, Project page + core blocks, next/prev | Deep-link + filter production-ready |
| M6 Homepage (1–1.5d) | Hero → Featured → Capabilities → About teaser → Credibility → Contact | Full IA story on mobile + desktop |
| M7 About + contact (0.5–1d) | Experience, skills, resume, mailto/form | Recruiter path < 60s |
| M8 Motion (0.5–1d) | PageTransition, Reveal, filter layout, hovers | Reduced-motion clean |
| M9 Perf/SEO/QA (1d) | Image weights, OG, sitemap, Lighthouse, 404 | Meet §5.5 targets; build green |
| M10 Launch prep (0.5d) | Content freeze 8±2, host SPA fallback, CONTENT.md | Deployable main |
8. Cross-Cutting Standards
- No
any without justification; every image has alt; every route has a unique title
- WCAG 2.1 AA; skip-to-content link; focus order = visual order
- Naming:
PascalCase components, useCamel hooks, kebab-case content files matching slugs
- Import order: external → components → lib/hooks/config → content/types → relative
9. Package Install List (ready for next step)
Runtime: react-router · framer-motion · react-helmet-async · lucide-react
Optional: zod
Dev: ESLint stack + eslint-plugin-jsx-a11y · Prettier + Tailwind plugin · sharp (image script) · visualizer on demand
10. Final Recommendation
Ship a Vite + React 19 + TypeScript strict + Tailwind v4 SPA with React Router deep links, Framer Motion craft motion, and a CSS-variable token core via @theme. Keep content in typed TS modules (src/content), media in public/assets/projects/{slug}, and UI in layout / ui / content / blocks / motion. Use a disciplined Img primitive (aspect, lazy, blur, priority) instead of a server image optimizer. Build in 10 milestones: tokens → shell → atoms → content → portfolio → home → about → motion → perf/SEO → launch.
This is CMS-free, statically hostable, designer-grade, and maintainable as the gallery grows.
11. Next Step Input Checklist
Confirm before production UI code:
Immediate next engineering action: Milestone 0–1 — bootstrap packages, folder skeleton, token file, router placeholders.
Files built: docs/02-engineering-foundation.md