|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Personal portfolio website for Thomas J Butler — a React 19 + TypeScript SPA with a Matrix-themed aesthetic (green terminal effects, CRT overlays, particle backgrounds). Deployed to GitHub Pages at thomasjbutler.github.io. |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +| Command | Purpose | |
| 12 | +|---------|---------| |
| 13 | +| `npm run dev` | Dev server on port 3000 (opens /react.html) | |
| 14 | +| `npm run build` | Production build to dist/ | |
| 15 | +| `npm run preview` | Preview production build | |
| 16 | +| `npm run lint` | ESLint on src/**/*.{js,ts} | |
| 17 | +| `npm run format` | Prettier on src/**/*.{js,ts,css,html} | |
| 18 | +| `npm run type-check` | TypeScript check (no emit) | |
| 19 | +| `npm run test` | Vitest | |
| 20 | +| `npm run test:ui` | Vitest with UI | |
| 21 | +| `npm run test:coverage` | Vitest with coverage | |
| 22 | +| `npm run deploy` | Build + deploy to GitHub Pages via gh-pages | |
| 23 | + |
| 24 | +## Architecture |
| 25 | + |
| 26 | +**Stack:** React 19, TypeScript (strict), Vite 7, React Router v7 (BrowserRouter) |
| 27 | + |
| 28 | +**Entry flow:** `index.html` redirects to `react.html`, which loads `src/main.tsx` -> `App.tsx`. A third entry `blog.html` exists for legacy blog URL compatibility. |
| 29 | + |
| 30 | +**Routing:** All pages are lazy-loaded via `React.lazy()` + `Suspense` in `App.tsx`. Blog routes are currently commented out. Legacy `.html` routes redirect to clean paths. The `/skills` route redirects to `/services`. |
| 31 | + |
| 32 | +**CSS architecture:** `src/css/main.css` is the master import file. Styles are organized into `base/`, `components/`, `pages/`, and `utilities/` subdirectories using partial files (prefixed with `_`). Theme variables live in `themes.css` with light/dark mode via CSS custom properties and React Context (`ThemeContext`). |
| 33 | + |
| 34 | +**Animation libraries:** GSAP, Anime.js (v4), Framer Motion, AOS (Animate On Scroll), ScrollMagic. Matrix rain, CRT effects, and particle backgrounds are custom implementations. |
| 35 | + |
| 36 | +**Path aliases:** `@/` -> `src/`, plus `@components/`, `@pages/`, `@hooks/`, `@utils/`, `@css/`, `@js/`, `@images/` (configured in both tsconfig.json and vite.config.mjs). |
| 37 | + |
| 38 | +**Key directories:** |
| 39 | +- `src/pages/` — Route-level page components |
| 40 | +- `src/components/` — Reusable UI components |
| 41 | +- `src/hooks/` — Custom hooks (scroll animation, lazy loading, SEO, performance) |
| 42 | +- `src/utils/` — Utilities (keyboard nav, performance optimizer, animations) |
| 43 | +- `src/contexts/` — React Context (ThemeContext for light/dark mode) |
| 44 | +- `src/css/` — Organized stylesheet modules |
| 45 | +- `src/content/blog/` — Markdown blog posts (copied to dist on build) |
| 46 | + |
| 47 | +## Code Style |
| 48 | + |
| 49 | +- Prettier: single quotes, semicolons, 100 char width, trailing commas (es5) |
| 50 | +- ESLint: TypeScript strict, React hooks rules, no-var, no-require |
| 51 | +- Components use named exports (not default), except where lazy loading requires `.then(m => ({ default: m.ComponentName }))` |
| 52 | +- Global animation libs (anime, gsap, ScrollMagic, AOS) are declared as ESLint globals |
| 53 | + |
| 54 | +## Deployment |
| 55 | + |
| 56 | +GitHub Actions workflow (`.github/workflows/deploy.yml`) auto-deploys on push to main. Manual deploys via `npm run deploy` use the `gh-pages` package to push `dist/` to the gh-pages branch. |
0 commit comments