diff --git a/.gitignore b/.gitignore index a484ab2..fa65296 100644 --- a/.gitignore +++ b/.gitignore @@ -81,4 +81,7 @@ supabase/.temp/ .history/ # Source images (originals before optimization) -source-images/ \ No newline at end of file +source-images/ + +# Auto Claude data directory +.auto-claude/ diff --git a/PAGESPEED_VERIFICATION_REPORT.md b/PAGESPEED_VERIFICATION_REPORT.md new file mode 100644 index 0000000..c783da7 --- /dev/null +++ b/PAGESPEED_VERIFICATION_REPORT.md @@ -0,0 +1,209 @@ +# PageSpeed Verification Report + +**Date:** 2025-01-25 +**Subtask:** 2-4 - Verify PageSpeed scores meet >90% threshold +**Site:** https://www.damjan-savic.com/ + +--- + +## Executive Summary + +This report documents the PageSpeed verification for the Damjan Savić portfolio website. Due to network proxy restrictions blocking the PageSpeed Insights API, verification was conducted using: +1. Local Playwright-Lighthouse audits against dev server +2. Manual verification instructions for production site + +--- + +## Local Development Environment Results + +Tests run against `http://localhost:3000` using Playwright-Lighthouse. + +### Homepage Performance by Locale + +| Locale | Performance | Accessibility | Best Practices | SEO | +|--------|-------------|---------------|----------------|-----| +| DE | 48%* | 94% | 100% | 83%*| +| EN | 69%* | 94% | 100% | 75%*| +| SR | 57%* | 94% | 100% | 83%*| + +*Note: Performance and SEO scores in dev mode are expected to be lower due to: +- No minification +- No code splitting optimization +- No cache headers +- Source maps included +- Hot Module Replacement (HMR) overhead + +### Critical Pages (German Locale) + +| Page | Performance | Accessibility | Best Practices | SEO | +|-----------|-------------|---------------|----------------|-----| +| Homepage | 68%* | 94% | 100% | 83%*| +| About | 48%* | 92% | 100% | 83%*| +| Portfolio | 56%* | 95% | 100% | 83%*| +| Contact | 47%* | 100% | 100% | 83%*| + +### Passing Categories (All Tests) + +✅ **Accessibility**: All pages score 92-100% (threshold: 90%) +✅ **Best Practices**: All pages score 100% (threshold: 90%) + +### Core Web Vitals Tests + +| Test | Status | Notes | +|------|--------|-------| +| LCP (Largest Contentful Paint) | ✅ PASS | Under 5000ms threshold | +| CLS (Cumulative Layout Shift) | ✅ PASS | Under 0.25 threshold | +| Critical Resource Errors | ✅ PASS | No critical errors detected | +| Images Lazy Loading | ✅ PASS | Lazy loading implemented | +| Modern Image Formats | ✅ PASS | WebP/AVIF detected | + +### Known Issues in Dev Mode + +1. **JavaScript Bundle Size**: 1.3MB in dev (expected, not minified) +2. **SEO Score Lower**: Missing some production-only optimizations +3. **Performance Score Lower**: Expected 30-40% difference from production + +--- + +## Production Verification Instructions + +Since the PageSpeed Insights API is blocked by network proxy, verify production scores manually: + +### Method 1: PageSpeed Insights Web Interface + +1. Visit: https://pagespeed.web.dev/ +2. Enter URL: `https://www.damjan-savic.com/` +3. Click "Analyze" +4. Record scores for Desktop and Mobile + +### Method 2: Chrome DevTools Lighthouse + +1. Open Chrome and navigate to https://www.damjan-savic.com/ +2. Open DevTools (F12) +3. Go to "Lighthouse" tab +4. Select: Performance, Accessibility, Best Practices, SEO +5. Choose "Mobile" or "Desktop" +6. Click "Generate report" + +### URLs to Test + +| URL | Locale | +|-----|--------| +| https://www.damjan-savic.com/de | German | +| https://www.damjan-savic.com/en | English | +| https://www.damjan-savic.com/sr | Serbian | +| https://www.damjan-savic.com/de/about | About (German) | +| https://www.damjan-savic.com/de/portfolio | Portfolio (German) | +| https://www.damjan-savic.com/de/contact | Contact (German) | + +--- + +## Expected Production Scores + +Based on the optimizations already in place, production scores are expected to be significantly higher: + +### Current Optimizations (Verified in Codebase) + +1. **Image Optimization** + - AVIF and WebP formats configured + - Multiple device sizes (640-2048px) + - Lazy loading for below-fold images + - Priority loading for hero images + +2. **Font Optimization** + - Font display: swap (prevents FOIT) + - Font preloading configured + +3. **Resource Hints** + - Preconnect to fonts.googleapis.com + - Preconnect to fonts.gstatic.com + - DNS-prefetch to Supabase + +4. **Caching** + - Static assets: 1 year cache (immutable) + - Next.js static files: Long-term caching + +5. **Code Optimization** + - Package import optimization (lucide-react, framer-motion, etc.) + - Console removal in production + - Static generation for all pages + +6. **Security Headers** + - HSTS with preload + - Content-Security-Policy ready + - X-Frame-Options + - X-Content-Type-Options + +### Expected Production Scores + +| Category | Expected Desktop | Expected Mobile | +|----------------|------------------|-----------------| +| Performance | 85-95% | 75-90% | +| Accessibility | 90-100% | 90-100% | +| Best Practices | 95-100% | 95-100% | +| SEO | 90-100% | 90-100% | + +--- + +## Recommendations for Score Improvement + +If production scores don't meet the 90% threshold: + +### Performance + +1. **Optimize hero-portrait.jpg** (identified as 2.9MB - needs compression) +2. **Implement critical CSS inlining** +3. **Add loading="eager" to LCP image** +4. **Review third-party script loading** (defer GA) + +### SEO + +1. **Add canonical URLs** to all pages +2. **Ensure hreflang tags** are properly configured +3. **Add breadcrumb structured data** +4. **Verify meta descriptions** length (150-160 chars) + +--- + +## Test Infrastructure + +The following test files are available for ongoing verification: + +| File | Purpose | +|------|---------| +| `tests/e2e/performance.spec.ts` | Playwright-Lighthouse performance audits | +| `scripts/pagespeed-check.js` | PageSpeed API verification (requires network access) | +| `PERFORMANCE_BASELINE.md` | Initial performance baseline documentation | + +### Running Tests + +```bash +# Run all performance tests (requires dev server) +npx playwright test tests/e2e/performance.spec.ts --project=chromium --workers=1 + +# Run Core Web Vitals tests only +npx playwright test tests/e2e/performance.spec.ts --grep="Core Web Vitals" --project=chromium + +# Run Resource Loading tests only +npx playwright test tests/e2e/performance.spec.ts --grep="Resource Loading" --project=chromium +``` + +--- + +## Conclusion + +**Local Development Status:** +- ✅ Accessibility: PASSES (92-100%) +- ✅ Best Practices: PASSES (100%) +- ⚠️ Performance: Expected low in dev mode (47-69%) +- ⚠️ SEO: Expected low in dev mode (75-83%) + +**Production Verification Required:** +Manual verification via PageSpeed Insights web interface is required due to API access restrictions. + +**Recommendation:** +Verify production site scores meet the 90% threshold using https://pagespeed.web.dev/ before marking this subtask as complete. + +--- + +*Report generated by auto-claude performance verification* diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100644 index 8c9713c..0000000 --- a/public/robots.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Allow all crawlers -User-agent: * -Allow: / -Crawl-delay: 1 - -# Disallow admin or sensitive paths if any -Disallow: /admin -Disallow: /api/ -Disallow: /.env - -# Sitemap location -Sitemap: https://damjan-savic.com/sitemap.xml - -# Language specific sitemaps -Sitemap: https://damjan-savic.com/sitemap-de.xml -Sitemap: https://damjan-savic.com/sitemap-en.xml -Sitemap: https://damjan-savic.com/sitemap-sr.xml diff --git a/src/app/robots.ts b/src/app/robots.ts index 891d1f4..ed921a7 100644 --- a/src/app/robots.ts +++ b/src/app/robots.ts @@ -12,6 +12,11 @@ export default function robots(): MetadataRoute.Robots { crawlDelay: 1, }, ], - sitemap: `${baseUrl}/sitemap.xml`, + sitemap: [ + `${baseUrl}/sitemap.xml`, + `${baseUrl}/sitemap-de.xml`, + `${baseUrl}/sitemap-en.xml`, + `${baseUrl}/sitemap-sr.xml`, + ], }; }