Skip to content

Commit 6457b06

Browse files
authored
Merge pull request #121 from moollaza/feature/sveltekit-redesign
Migrate to SveltKit with updated design
2 parents ec98f04 + 99d648b commit 6457b06

File tree

278 files changed

+10212
-65555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+10212
-65555
lines changed

.claude/settings.local.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(npx:*)",
5+
"Bash(npm install:*)",
6+
"Bash(npm run dev:*)",
7+
"Bash(npm run check:*)",
8+
"Bash(npm run build:*)",
9+
"Bash(npm run test:unit:*)",
10+
"WebFetch(domain:www.joshwcomeau.com)",
11+
"WebFetch(domain:www.figma.com)",
12+
"Bash(git add:*)",
13+
"Bash(npm run lint)",
14+
"Bash(npm run format:*)",
15+
"Bash(npm run test:smoke:*)",
16+
"Bash(curl:*)"
17+
],
18+
"deny": [],
19+
"ask": []
20+
}
21+
}

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["**"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
quality-checks:
15+
name: Quality Checks
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version-file: ".node-version"
23+
cache: "npm"
24+
cache-dependency-path: "package-lock.json"
25+
- run: npm ci
26+
- run: npm run lint
27+
- run: npm run check
28+
29+
build-and-test:
30+
name: Build & E2E Tests
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 15
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-node@v4
36+
with:
37+
node-version-file: ".node-version"
38+
cache: "npm"
39+
cache-dependency-path: "package-lock.json"
40+
- run: npm ci
41+
- name: Get installed Playwright version
42+
id: playwright-version
43+
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['node_modules/@playwright/test'].version)")" >> $GITHUB_OUTPUT
44+
- name: Cache playwright binaries
45+
uses: actions/cache@v4
46+
id: playwright-cache
47+
with:
48+
path: |
49+
~/.cache/ms-playwright
50+
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
51+
- name: Install Playwright browsers
52+
run: npx playwright install chromium
53+
if: steps.playwright-cache.outputs.cache-hit != 'true'
54+
- name: Install system dependencies
55+
run: npx playwright install-deps chromium
56+
if: steps.playwright-cache.outputs.cache-hit != 'true'
57+
- run: npm test
58+
- name: Upload test results
59+
if: failure()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: playwright-report
63+
path: |
64+
playwright-report/
65+
test-results/
66+
retention-days: 7

.gitignore

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
test-results
2+
playwright-report
3+
e2e/test-results
4+
node_modules
5+
6+
# Output
7+
.output
8+
.vercel
9+
.netlify
10+
.wrangler
11+
/.svelte-kit
12+
/build
13+
14+
# OS
115
.DS_Store
2-
/node_modules/
3-
/src/node_modules/@sapper/
4-
yarn-error.log
5-
/cypress/screenshots/
6-
/__sapper__/
7-
static/global.css
16+
Thumbs.db
17+
18+
# Env
19+
.env
20+
.env.*
21+
!.env.example
22+
!.env.test
23+
24+
# Vite
25+
vite.config.js.timestamp-*
26+
vite.config.ts.timestamp-*

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb
7+
8+
# Miscellaneous
9+
/static/

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"printWidth": 120,
3+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
4+
"overrides": [
5+
{
6+
"files": "*.svelte",
7+
"options": {
8+
"parser": "svelte"
9+
}
10+
}
11+
],
12+
"tailwindStylesheet": "./src/app.css"
13+
}

CLAUDE.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Development Commands
6+
7+
- **Start development server**: `npm run dev` - Starts Vite dev server with hot reloading
8+
- **Build for production**: `npm run build` - Builds optimized production bundle
9+
- **Preview production build**: `npm run preview` - Preview production build locally
10+
- **Type checking & Accessibility**: `npm run check` - Run Svelte type checking and accessibility linting
11+
- **Linting**: `npm run lint` - Run ESLint and Prettier checks
12+
- **Formatting**: `npm run format` - Format code with Prettier
13+
- **E2E tests**: `npm test` - Run Playwright end-to-end tests (24 comprehensive tests)
14+
15+
## Architecture Overview
16+
17+
This is a personal portfolio website built with **SvelteKit** (using **Svelte 5**) and styled with **Tailwind CSS v4**, featuring comprehensive visual regression testing with **Argos**.
18+
19+
### Important Documentation Links
20+
21+
- **Svelte 5**: https://svelte.dev/docs/svelte/overview
22+
- **Svelte 5 Migration Guide**: https://svelte.dev/docs/svelte/v5-migration-guide
23+
- **SvelteKit**: https://svelte.dev/docs/kit/
24+
- **Tailwind CSS**: https://tailwindcss.com/docs/
25+
26+
### Project Structure
27+
28+
- **src/routes/**: SvelteKit file-based routing
29+
- `+layout.svelte`: Main layout with Nav and theme initialization
30+
- `+page.svelte`: Homepage with hero section and animations
31+
- `about/+page.svelte`: About page with interests and bio
32+
- `projects/+page.svelte`: Project showcase with optimized images
33+
- `photos/+page.svelte`: Photo gallery with modal viewer
34+
- `contact/+page.svelte`: Contact methods and social links
35+
36+
- **src/lib/**: Shared library code ($lib alias)
37+
- `components/`: Reusable Svelte 5 components
38+
- `Nav.svelte`: Navigation with active states and theme toggle
39+
- `ThemeToggle.svelte`: Dark/light mode toggle
40+
- `PhotoModal.svelte`: Modal for photo gallery viewing
41+
- `SEO.svelte`: Reusable SEO component for Open Graph and Twitter Cards
42+
- `assets/images/`: Optimized images processed by Vite
43+
- `photos/`: Photo gallery images (AVIF/WebP/JPEG)
44+
- `projects/`: Project screenshot images (AVIF/WebP/PNG)
45+
- `stores/`: Svelte stores
46+
- `theme.ts`: Theme management with localStorage persistence
47+
- `types.ts`: TypeScript type definitions
48+
49+
- **static/**: Static files served as-is (no processing)
50+
- `robots.txt`: SEO configuration with sitemap reference
51+
- `sitemap.xml`: XML sitemap for search engines
52+
- `favicon.ico`, `social.png`: Site metadata assets
53+
54+
### Modern Tech Stack
55+
56+
- **Svelte 5**: Latest version with new reactivity model ($state, $effect)
57+
- **SvelteKit**: Full-stack framework with Vite
58+
- **TypeScript**: Full type safety throughout
59+
- **Tailwind CSS v4**: Latest version with CSS-first configuration
60+
- **Vite**: Build tool for fast development and optimized builds
61+
- **@sveltejs/enhanced-img**: Automatic image optimization (AVIF/WebP generation)
62+
- **Fathom Analytics**: Privacy-focused analytics with custom event tracking
63+
- **Playwright**: End-to-end testing framework with visual regression testing
64+
65+
### Theme System
66+
67+
- **CSS Custom Properties**: Theme variables defined in `app.css`
68+
- **Dark Mode**: Automatic system preference detection with manual toggle
69+
- **Color Palette**: Orange primary (#f97316) with dark red accents (#dc2626)
70+
- **Persistence**: Theme preference saved to localStorage
71+
72+
### Build System
73+
74+
- **Vite**: Modern build tool replacing Rollup/Webpack
75+
- **SvelteKit Adapter**: Vercel adapter for deployment
76+
- **TypeScript**: Compile-time type checking
77+
- **ESLint + Prettier**: Code quality and formatting
78+
79+
### Styling Approach
80+
81+
- **Tailwind CSS v4**: Utility-first with new @theme syntax
82+
- **System Fonts**: Using system UI font stack
83+
- **CSS Custom Properties**: For theme variables and smooth transitions
84+
- **Responsive Design**: Mobile-first approach with Tailwind breakpoints
85+
86+
### Image Optimization
87+
88+
- **@sveltejs/enhanced-img**: Automatically generates AVIF, WebP, and original formats
89+
- **Asset Organization**: Images in `src/lib/assets/images/` for Vite processing
90+
- **Static Files**: Only truly static files (robots.txt, favicon, etc.) in `static/`
91+
- **Usage**: Import with `?enhanced` query and use `<enhanced:img>` component
92+
- **Performance**: Dramatic file size reductions (619kB → 6.61kB AVIF)
93+
94+
### Analytics
95+
96+
- **Fathom Analytics**: Privacy-focused analytics with site ID `NKUUIGYT`
97+
- **Custom Events**: Counting user interactions instead of "tracking"
98+
- Nav clicks: `nav_about_click`, `nav_projects_click`, etc.
99+
- Project interactions: `project_demo_repo_remover`, `project_github_personal_website`
100+
- Photo views: `photo_view_faraglioni_islets`, etc.
101+
- **Implementation**: Functions like `countNavClick()`, `countProjectClick()`
102+
103+
### SEO & Performance
104+
105+
- **SEO Component**: Reusable `SEO.svelte` component for consistent meta tags
106+
- **Open Graph**: Complete social media preview support (Facebook, Twitter, etc.)
107+
- **Sitemap**: XML sitemap at `/sitemap.xml` for search engine discovery
108+
- **Robots.txt**: Proper search engine crawler configuration
109+
- **Performance**: Image optimization with AVIF/WebP formats
110+
111+
### Testing & Quality
112+
113+
- **E2E Testing**: 24 comprehensive Playwright tests with DRY utilities
114+
- **Visual Regression**: Argos integration for cross-platform visual testing
115+
- **Test Coverage**: Desktop, mobile, tablet, and dark theme screenshots
116+
- **Smart Waiting**: Content-aware waits instead of networkidle for faster, more reliable tests
117+
- **Pre-commit Hooks**: Automatic formatting (Prettier) and linting (ESLint) on every commit
118+
- **CI/CD**: GitHub Actions with Argos reporter for visual diff reviews
119+
120+
### Development Tools
121+
122+
- **Node Version**: Managed with `.node-version` file (Node 22.12+)
123+
- **Quality Checks**: `npm run check` catches TypeScript and accessibility issues
124+
- **Accessibility**: All buttons/links have proper `aria-label` attributes
125+
- **Hot Reloading**: Fast development with Vite HMR
126+
- **Git Hooks**: Husky + lint-staged for automatic code quality on commit
127+
- **Test Utils**: DRY utilities in `e2e/test-utils.ts` for maintainable test code
128+
129+
### Visual Testing with Argos
130+
131+
- **Cross-platform Consistency**: Argos handles Linux CI vs macOS local differences
132+
- **Comprehensive Coverage**: All pages tested on desktop, mobile, and dark theme
133+
- **Smart Screenshots**: Content-aware waiting with font and image loading detection
134+
- **CI Integration**: Automatic screenshot uploads and PR status checks
135+
- **Review Process**: Visual diffs available in Argos dashboard for easy review
136+
137+
### Deployment
138+
139+
- **Vercel**: Deployed via @sveltejs/adapter-vercel
140+
- **Static Generation**: Pre-rendered for optimal performance

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
# Zaahir Moolla - Personal Website
1+
# Zaahir's Personal Website
22

3-
This is my personal website. You can check it out here: https://zaahir.ca
3+
My little corner of the internet. Check it out [here](https://zaahir.ca).
44

5-
The design was mostly borrowed from https://wrapbootstrap.com/theme/articulate-resume-portfolio-WB0N5LC7P.
5+
## Tech Stack
66

7-
## Built with:
8-
- [Sapper](https://sapper.svelte.dev/)
9-
- [Tailwind.css](https://tailwindcss.com)
10-
- [Hover.css](https://ianlunn.github.io/Hover/)
11-
- [icons8](https://icons8.com)
12-
- [Vercel](https://vercel.com/home)
13-
- [Fathom Analytics](https://usefathom.com/)
7+
- **SvelteKit** (Svelte 5) - Full-stack framework
8+
- **Tailwind CSS** - Styles
9+
- **Vite** - Build tool
10+
- **Vercel** - Deployment
11+
12+
## Development
13+
14+
```bash
15+
# Install dependencies
16+
npm install
17+
18+
# Start dev server
19+
npm run dev
20+
21+
# Build for production
22+
npm run build
23+
24+
# Run type checking
25+
npm run check
26+
27+
# Run tests
28+
npm test
29+
```

0 commit comments

Comments
 (0)