This is the source code for my personal website, jmrp.io, built with Astro 5. It features a high-performance static architecture, robust security headers (including a strict CSP), and a focus on accessibility and modern web standards.
- Features
- Tech Stack
- Project Structure
- Getting Started
- Quality Assurance
- Deployment
- Security & Nginx
- LaTeX CV Compilation
- Performance:
- 100/100 Google PageSpeed (Desktop & Mobile).
- Core Web Vitals: LCP < 0.8s, CLS < 0.031, FCP < 0.3s.
- SSG (Static Site Generation): All pages pre-rendered at build time.
- Islands Architecture: Minimal JavaScript with Preact islands.
- Image Optimization: WebP format with responsive sizing.
- Font Loading: Optimized with fallback fonts and metric overrides.
- CSS Inlining: Critical CSS inlined, async loading for non-critical.
- Accessibility:
- Axe-core Testing: Automated WCAG 2.1 AA validation via Playwright for all pages.
- HTML5 Compliance: Strict HTML validation (
html-validate). - Lighthouse CI: Accessibility auditing on every commit.
- Inclusive Design: Keyboard navigation, focus indicators, and unique
aria-labels. - Motion Sensitivity: Respects
prefers-reduced-motionsettings.
- Content:
- Blog: Technical articles with MDX support.
- RSS Feed: Automatic generation of
rss.xmlfor blog posts. - CV Generation: Automated LaTeX compilation for PDF resumes.
- Themeable: Light/Dark mode with system preference detection.
- Configurable: Centralized configuration via YAML files (
site.yml,socials.yml,cv.yml). - SEO Optimized: Dynamic Schema.org (JSON-LD), Open Graph, and Twitter Cards.
- Framework: Astro
- UI Components: Preact
- Styling: Native CSS (Variables, Nesting) & Astro Scoped Styles
- Icons: Iconify
- Testing: Playwright & Lighthouse
- CI/CD: GitHub Actions
Click to expand folder structure
/
βββ src/
β βββ components/ # Reusable Astro & Preact components
β βββ content/ # Content Collections (Blog posts)
β βββ data/ # YAML Data files (Site config, CV, Socials)
β βββ layouts/ # Page layouts (Base, etc.)
β βββ pages/ # File-based routing
β βββ styles/ # Global CSS & Fonts
β βββ utils/ # Helper functions
βββ public/ # Static assets (images, fonts, robots.txt)
βββ scripts/ # Build & Maintenance scripts
βββ tests/ # Playwright E2E & Accessibility tests
βββ cv_latex/ # LaTeX source files for CV
βββ astro.config.mjs # Astro configuration
βββ package.json # Dependencies & Scripts
- Node.js (v18+)
- pnpm
# Clone the repository
git clone https://github.com/jmrplens/jmrp.io.git
# Install dependencies
pnpm install
# Start development server
pnpm run devpnpm run buildThis command will:
- Fetch latest avatars.
- Build the Astro site.
- Index content for search.
- Process inline styles and extract assets.
- Generate SRI and CSP hashes.
This project employs a rigorous testing pipeline to ensure quality and compliance.
graph TD
Trigger[Push / PR] --> Phase1[Analysis & Build]
Phase1 --> Phase2[Deep Testing]
Phase2 --> Phase3[Reporting]
Static analysis tools run in parallel with the production build to provide fast feedback.
graph TD
Trigger[Push / PR] --> SA[Static Analysis]
Trigger --> Build[Build Artifact]
subgraph SA [Static Analysis]
direction LR
Lint[Lint & Type Check]
Links[Link Checker]
Spell[Spell Checker]
CodeQL
Sonar[SonarCloud]
Snyk[Snyk Security]
end
Once the build is ready, we execute comprehensive testing matrices and generate unified reports.
graph LR
Build[Build Artifact] --> TM
Build --> CV
subgraph TM [Testing Matrices]
direction TB
A11y[Accessibility Tests]
LH[Lighthouse Audit]
Func[Functional Tests]
end
subgraph CV [Content Validations]
direction LR
HTML[HTML5]
RSS
Schema
Img[Images]
end
subgraph Rep [Reporting Pipelines]
direction TB
A11yAgg[A11y Dashboard] --> A11yCom[PR Comment]
LHAgg[LH Dashboard] --> LHCom[PR Comment]
end
A11y --> A11yAgg
LH --> LHAgg
We perform comprehensive accessibility checks:
- Axe-core (via Playwright): Scans every page against WCAG 2.1/2.2 AA and Best Practice rules.
- Dual-Theme Matrix: Tests run in parallel for both Light and Dark modes to ensure contrast compliance in all contexts.
- Unified Dashboard: Aggregates results into an interactive HTML dashboard deployed to Surge, providing a single point of review for both themes.
- Global SVG Exclusion: Prevents false positives in diagrams (Mermaid, etc.).
- Fails the build on any violation.
- Lighthouse CI: Runs Lighthouse audits on all pages, enforcing high scores for Accessibility, Performance, and SEO.
- Parallel Matrix Execution: Runs 4 parallel jobs covering Mobile & Desktop form factors across both Light & Dark themes.
- Unified Dashboard: Aggregates all results into a single, interactive HTML dashboard deployed to Surge for easy review.
- Manual Checks: The pipeline flags "incomplete" checks (e.g., complex color contrast) for manual review.
- HTML Validation:
html-validatechecks generated HTML for standard compliance and semantic correctness. - RSS Validation:
validate-rss.mjsensures the generatedrss.xmlstrictly follows RSS 2.0 specifications. - Schema.org:
validate-schema.mjsverifies the structure of JSON-LD data for SEO.
The site is built as a static folder (dist/) and can be deployed to any static host. I use Docker with Nginx.
docker build -t jmrp-io .
docker run -p 8080:80 jmrp-ioThe project includes advanced Nginx configuration for security headers and asset delivery.
- Reverse Proxy: Nginx reverse proxy handles requests to external services (Mastodon, Matrix, Meshtastic), hiding upstreams and preventing CORS issues.
- SRI (Subresource Integrity): Comprehensive protection for all local resources. A post-build script calculates hashes for:
- All
<script>and<link rel="stylesheet">tags. <link rel="preload">and<link rel="modulepreload">(including fonts and Astro dynamic components).- PWA Metadatas (Favicons, Icons, and Web Manifest).
- Multimedia assets (
<img>,<video>,<audio>,<source>).
- All
- CSP (Content Security Policy): Uses a combined strategy of request-specific
nonce(injected via Nginxsub_filter) and SHA-512 hashes for all scripts and styles.- Features:
- SHA-512 Hashing: Upgraded from SHA-384 for stronger security.
- Automatic Splitting: Splits long CSP header strings into multiple Nginx variables to avoid "too long parameter" errors.
- Nginx Reload: Automatically reloads Nginx after updating the configuration.
- Features:
- Incident Reporting: Real-time monitoring of security violations:
- CSP Violations: Natively reported by the browser.
- SRI Failures: Tracked via a custom event listener (
SRIEventListener.astro) that captures integrity validation errors. - Telegram Integration: A dedicated backend (
csp-reporter.mjs) receives these reports and sends instant notifications to Telegram.
- HSTS: Enforces HTTPS.
The project includes LaTeX source files to generate professional PDF CVs.
Prerequisites:
- TeX Live (Full distribution)
latexmklualatex
Compilation:
cd cv_latex
latexmk -lualatex -interaction=nonstopmode CV_RequenaPlensJoseManuel_ENG.tex CV_RequenaPlensJoseManuel_SPA.tex