Run Lighthouse Audit Locally¶
Archived record
This page describes the Firebase-era platform or a migration step that has completed. It is kept as history and is not a current runbook. The current platform is described from the home page.
Quick Start (2 minutes)¶
Step 1: Install Tools¶
Step 2: Build the App¶
Step 3: Start Preview Server¶
Step 4: Run Lighthouse Audit (in another terminal)¶
Option A: Using LHCI (Multi-page with our config)
Option B: Single page audit (Chrome DevTools)
- Open Chrome
- Go to
http://localhost:5173/aws/frameworks - Press
F12(DevTools) - Click Lighthouse tab
- Configure: Desktop, All categories selected
- Click Analyze page load
- Wait 60-90 seconds
Option C: CLI single page
Expected Results¶
Target Scores (All Pages):
- Accessibility: ≥95/100 ✅
- Performance: ≥85/100 ✅
- Best Practices: ≥90/100 ✅
- SEO: ≥90/100 ✅
Our .lighthouserc.json Tests These 5 Pages:¶
- ✅ http://localhost:5173/aws/frameworks
- ✅ http://localhost:5173/aws/blog
- ✅ http://localhost:5173/aws/architecture-designs
- ✅ http://localhost:5173/aws/audio-architecture
- ✅ http://localhost:5173/aws/education
Each page is tested 3 times for statistical reliability.
What to Look For¶
Accessibility (≥95)¶
- ✅ All buttons keyboard accessible (Tab, Space, Enter)
- ✅ Focus rings visible on all interactive elements
- ✅ Proper heading hierarchy
- ✅ Images have alt text
- ✅ Color contrast adequate (4.5:1 minimum)
Performance (≥85)¶
- ✅ Images lazy-loaded
- ✅ Code splitting working
- ✅ No render-blocking resources
- ✅ Fast First Contentful Paint (FCP)
Best Practices (≥90)¶
- ✅ HTTPS only
- ✅ No deprecated APIs
- ✅ Proper CSP headers (if applicable)
- ✅ No console errors
SEO (≥90)¶
- ✅ Proper meta descriptions
- ✅ Mobile viewport configured
- ✅ Structured data (schema.org)
- ✅ Readable font sizes
Troubleshooting¶
Port 5173 already in use?
LHCI can't find config?
# Make sure you're in the project root
cd <your local checkout of Personal-Site_HCW>
lhci autorun --config=.lighthouserc.json
Chrome DevTools Lighthouse tab missing?
- Make sure you're using Chrome (not Edge, Firefox, Safari)
- Press F12 to open DevTools
- Look for "Lighthouse" in the tabs (may be under
>>menu)
Next: GitHub Actions Automation¶
Once you verify locally:
- Lighthouse audit runs automatically on every PR
- Results posted to PR comments
- Builds blocked if accessibility score < 95%
- Full workflow runs on merge to main
See .github/workflows/lighthouse-audit.yml for the automated setup.
Keyboard Validation Script (Alternative)
Before running Lighthouse audits, you can quickly validate keyboard accessibility:
This runs 17 automated tests and confirms:
- ✅ All pages have AccessibleButton imports
- ✅ 30 AccessibleButton components found
- ✅ Focus ring styles correct
- ✅ Zero hardcoded buttons
Both should be green before deployment!