A modular, high-performance curriculum vitae platform built with React 19, TypeScript, and Vite, featuring a dual vector rendering pipeline that pairs deterministic Rust-powered Typst PDF precompilation with browser-native print stylesheets.
Inception (First Commit): 2024-12-23 β’ Batch / Horizon: Batch 2024β2025 β’ Architecture Domain: Frontend Engineering / Deterministic Typst & Vector Print Engine
Note on Repository Taxonomy: Under the portfolio standardization framework, this repository is mapped to the canonical identifier
showcase-react-vector-cv, reflecting its core role as an architectural reference implementation for vector document generation, data isolation adapters, and modern JavaScript runtime tooling.
react-vector-cv is engineered as a zero-compromise, data-driven curriculum vitae and digital portfolio platform. Departing from traditional approaches that couple structured resume data with hardcoded JSX or rely on client-side rasterizers (such as html2canvas or jsPDF), the project implements a decoupled, dual-target vector generation architecture.
The architecture serves two complementary delivery channels from a unified domain schema:
- Interactive Web Application: An accessible, responsive React 19 single-page application featuring dynamic system/light/dark theming, zero-dependency bilingual localization (
ItalianoβEnglish), and native browser print styles calibrated with CSS Paged Media rules (@media print). - Deterministic Typst Precompilation Engine (ADR-0004): A headless document generation pipeline powered by Typst's native Rust compiler (
@myriaddreamin/typst-ts-node-compilervia Node.js N-API). The pipeline precompiles four pixel-perfect, ATS-compliant A4 PDF variants (cv-italiano-photo.pdf,cv-italiano-nophoto.pdf,cv-english-photo.pdf,cv-english-nophoto.pdf) directly during the Vite build lifecycle or on-demand via dedicated CLI commands.
+-----------------------------------------------------------------------------------------+
| Domain Schema |
| src/types/cv.ts (CvDataSchema) |
+-----------------------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------------------+
| Runtime Validation Engine |
| src/utils/validateCvData.ts (~395 LOC) |
+-----------------------------------------------------------------------------------------+
|
+----------------------+----------------------+
| |
v v
+--------------------------------------+ +-------------------------------------------+
| Public Profile Adapter | | Private Profile Adapter |
| src/adapters/cvProfile.public | | src/adapters/cvProfile.private |
| (Redacted data & public assets) | | (Extended data, private assets, PII) |
+--------------------------------------+ +-------------------------------------------+
| |
+----------------------+----------------------+
|
Vite Module Alias Resolution Hook
(`cv-profile-adapter` Plugin)
|
+----------------------+----------------------+
| |
v v
+--------------------------------------+ +-------------------------------------------+
| Interactive Web Runtime | | Typst PDF Precompiler |
| - React 19 Component Tree | | - scripts/pdfGenerator.ts |
| - Zero-dependency i18n Switcher | | - @myriaddreamin/typst-ts-node-compiler |
| - useTheme (Dark/Light/System) | | - typst/cv.typ + typst/flags.typ |
| - Browser @media print Engine | | - Emits 4 Deterministic A4 PDFs |
+--------------------------------------+ +-------------------------------------------+
| |
v v
Browser & DOM View public/pdf/ & dist/pdf/
- Data-Driven Decoupling: Complete separation between raw content schema dictionaries (
cvData.json/cvData.revised.json) and presentation layers. All domain objects pass through exhaustive runtime type guards before mounting. - Dual Vector Output Engine:
- Native Browser Print (ADR-0002): Leverages standard CSS print stylesheets (
@media print,break-inside: avoid-page,print-color-adjust: exact) for zero-overhead client printing (window.print()). - Deterministic Typst Engine (ADR-0004): Eliminates client-side PDF renderer bloat and cross-browser print engine discrepancies (Chromium vs WebKit vs Gecko) by embedding Typst's Rust-based layout compiler into the build system.
- Native Browser Print (ADR-0002): Leverages standard CSS print stylesheets (
- Compile-Time Profile Adapter Pattern: Implements compile-time data and asset isolation via a custom Vite plugin (
cv-profile-adapter). Public production builds cleanly omit sensitive contact details, private company icons, and unredacted assets, preventing PII leaks in open-source deployments. - Modern High-Throughput Toolchain: Configured for high-velocity development with Node.js 26 (
>= 26.13.1), pnpm 11, Oxlint (replacing legacy ESLint with native Rust linting), and Oxfmt for instantaneous code formatting. - Edge Delivery Optimization: Bundles static assets with dual Gzip and Brotli pre-compression (
vite-plugin-compression) and deploys with hardened security headers via Netlify (netlify.toml).
react-vector-cv/
βββ .oxfmtrc.json # Oxfmt configuration
βββ .oxlintrc.json # Oxlint rules and overrides
βββ docs/
β βββ adr/ # Architecture Decision Records
β β βββ 0001-react-19-migration.md
β β βββ 0002-native-print-vs-client-pdf-generators.md
β β βββ 0003-manual-spacers-technical-debt.md
β β βββ 0004-typst-deterministic-pdf.md
β βββ ANALYSIS_AND_AUDIT.md # Deep codebase audit notes
β βββ RECAP_AND_CHANGELOG.md # Comprehensive release history
βββ netlify.toml # Netlify edge deployment & header configuration
βββ public/
β βββ favicon.svg # Brand favicon
β βββ pdf/ # Precompiled PDF artifacts (gitignored)
βββ scripts/
β βββ pdfGenerator.ts # Headless Typst N-API compiler orchestration
βββ src/
β βββ adapters/
β β βββ cvProfile.public.ts # Public profile adapter (redacted assets/data)
β β βββ cvProfile.private.ts # Private profile adapter (extended assets/data)
β β βββ cvProfile.types.ts # Adapter contracts & module resolution types
β βββ assets/
β β βββ data/
β β β βββ cvData.json # Public CV JSON data
β β β βββ cvData.revised.json # Private/unredacted CV JSON data (gitignored)
β β βββ icons/ # Modular SVG/PNG icon sets (header, work, school)
β β βββ img/ # Profile photos & vector signatures
β βββ components/
β β βββ Header.tsx # Biographical header & interactive contact chips
β β βββ WorkExperience.tsx # Timeline cards with achievements and badges
β β βββ Education.tsx # Academic degrees, honors, and certificates
β β βββ Skills.tsx # Categorized skills matrix (hard/soft)
β β βββ Language.tsx # Spoken languages & proficiency chips
β β βββ LegalNotes.tsx # GDPR and regulatory compliance statements
β βββ constants/
β β βββ cv.ts # Supported languages, URL validators, asset categories
β βββ hooks/
β β βββ useTheme.ts # Reactive dark/light/system theme state machine
β βββ styles/ # Modular CSS with variables & @media print rules
β βββ types/
β β βββ cv.ts # Strict TypeScript domain interfaces
β βββ utils/
β β βββ formatters.ts # Date and localization formatting utilities
β β βββ validateCvData.ts # Invariant and runtime schema validation engine
β βββ App.tsx # Root layout, theme toggles, and PDF download triggers
β βββ main.tsx # React 19 Concurrent Root bootstrap
βββ typst/
β βββ cv.typ # Typst A4 CV layout template (Rust layout DSL)
β βββ flags.typ # Vector SVG flag components and fallback badges
β βββ fonts/ # Embedded Liberation Sans font family
βββ package.json # Node 26 + pnpm 11 package manifest
βββ tsconfig.json # TypeScript compiler configuration
βββ vite.config.ts # Vite build config with PDF generator & adapter plugins
- Runtime & Package Manager: Node.js
>= 26.13.1(tested against Node 26), pnpm>= 11.21.0 - Frontend Framework: React
19.3.1, React DOM19.3.1, TypeScript~7.0.2 - Build Tooling & Bundler: Vite
8.3.8,@vitejs/plugin-react6.3.0 - Document Compilation Engine:
@myriaddreamin/typst-ts-node-compiler0.7.0(Native Rust N-API binding) - Code Quality & Formatting: Oxlint
1.93.0(Rust linter), Oxfmt0.78.0(Rust formatter) - Optimization & Edge Hosting:
vite-plugin-compression0.5.1(Dual Gzip & Brotli), Netlify CLI & Edge runtime - Typography & Assets: Liberation Sans font family, inline vector SVG flag definitions
- Dual-Engine Vector Document Export:
- Interactive Browser Print: Instant client vector printing formatted via
@media printwith zero external dependencies. - Headless Typst Precompilation: Pre-builds four calibrated 2-page A4 PDF documents with sub-100ms compilation times, guaranteed zero font-metric drift, ATS readability, and embedded vector flag graphics.
- Interactive Browser Print: Instant client vector printing formatted via
- Dynamic Direct PDF Downloads: The web interface dynamically maps the "Download PDF" action to the exact precompiled variant corresponding to active user state (
Italiano/Englishandphoto/nophoto). - Profile Isolation & Anti-Leakage: Segregates public open-source profiles from private contact information via the
cvProfileadapter pattern, controlled throughVITE_CV_PROFILE=privateandVITE_CV_DATA_FILE. - Runtime Invariant Validation: Deeply inspects imported JSON data before execution, validating URL schemes, non-empty text invariants, and contact arrays with descriptive runtime error traces.
- Ternary Theme State Machine: The
useThemehook provides persistent theme selection (light,dark,system) with liveprefers-color-schememedia query listeners and zero layout flash. - Zero-Dependency i18n: Implements deterministic bilingual switches (
ItalianovsEnglish) directly through typed dictionary projection without runtime bundle penalties.
| Command | Target / Mode | Description |
|---|---|---|
pnpm dev |
Development Server | Starts Vite dev server and precompiles public PDF variants to public/pdf/. |
pnpm dev:public |
Dev Server (Public) | Forces public profile isolation in development mode. |
pnpm build |
Production Build | Runs TypeScript typecheck (tsc -b), compiles Typst public PDFs, and bundles Vite web app. |
pnpm build:private |
Private Build | Bundles production distribution using private unredacted profile adapter and assets. |
pnpm generate:pdf |
Standalone CLI | Compiles 4 public Typst PDF variants directly using the headless NodeCompiler. |
pnpm generate:pdf:private |
Standalone CLI | Compiles 4 private Typst PDF variants using unredacted private data. |
pnpm lint |
Code Quality | Executes Oxlint for ultra-fast Rust-based static analysis. |
pnpm format:check |
Code Quality | Validates code formatting compliance using Oxfmt. |
pnpm preview |
Production Preview | Locally serves the optimized production build (dist/). |
- Node.js:
>= 26.13.1(Node.js 26 runtime recommended) - pnpm:
>= 11.21.0 - Operating System: Linux, macOS, or Windows with support for Node.js N-API native bindings.
# Clone the repository
git clone https://github.com/fabogit/showcase-react-vector-cv.git
cd showcase-react-vector-cv
# Install dependencies using pnpm
pnpm installCreate a local environment file based on .env.example:
cp .env.example .env.localConfigure target build profile variables:
# Profile selector: "public" (default) or "private"
VITE_CV_PROFILE=public
# Optional custom JSON data file for private profile (located in src/assets/data/)
VITE_CV_DATA_FILE=cvData.revised.json# Start development server with live reload and automatic PDF precompilation
pnpm dev
# Generate standalone PDF variants without starting dev server
pnpm generate:pdf
# Run production build
pnpm build
# Preview production build locally
pnpm preview# Run ultra-fast Oxlint checks
pnpm lint
# Verify formatting with Oxfmt
pnpm format:checkDeveloped by @fabogit. Released under the MIT License.