This repo contains the code for my online web portfolio. It is built using Next.js (v16).
- Ensure you are running Node 26 (
v26.13.0, see.nvmrc). If you have NVM installed, you can simply runnvm use - Copy
.env.SAMPLEto.envand configure your environment variables
- Run
npm install
- Run
npm run devto start the dev server. - Make any required code changes. The dev server watches for changes and rebuilds in real-time.
The site uses the "Orbit" design (dark sci-fi glow with a light "daylight lab" theme) — see
docs/superpowers/specs/2026-09-24-orbit-redesign.md.
A single persistent WebGL canvas (three.js + React Three Fiber, components/World) sits behind every
page. Each route is a station in space; navigating flies the camera between them and page scroll moves
it within a station. The canvas is lazy-loaded after first paint, renders on demand for
prefers-reduced-motion, and is skipped entirely (2D station renders only) without WebGL, with
Save-Data, or when the visitor switches it off with the cube button in the header (remembered).
- Quality tiers — a
PerformanceMonitorsteps the world between high / medium / low (pixel ratio and post-processing) as the frame rate allows. Phones and touch devices start at medium. - Model prefetch — hovering or focusing a link starts downloading the next station's model.
- Projects — every project has its own page at
/projects/<slug>. From the grid, a card opens in a modal at that same URL (Back closes it; a refresh shows the full page), and the 3D helix turns that project's screen to the camera.
The station models (public/static/models/*.glb) were generated with Higgsfield (image → 3D).
To replace or re-optimise them, export raw GLBs with the same file names into a folder and run:
node scripts/optimize-models.mjs path/to/raw-glbsThis applies meshopt compression and 1024px WebP textures. A missing model degrades to a procedural hologram, so the site never breaks on a failed download.
node scripts/generate-iconify-bundle.mjs— offline icon bundle (run after adding icon names; dev builds warn in the console about any icon missing from it)node scripts/generate-globe-points.mjs— land dots for the contact-page globenode scripts/generate-og-renders.mjs— PNG copies of the station renders for the Open Graph images (app/_og); every route has anopengraph-image.tsxbuilt on the sharedapp/_og/OgImage.tsx
app/api/sendmail/route.ts validates the payload with the same rules as the form
(utils/contactValidation.ts), caps the body size, drops bots (hidden honeypot field + minimum fill
time) with a fake success, and rate limits each IP to 5 messages per 10 minutes. The limiter is
in-memory, so it is per server instance and resets on deploy — enough for a single Node server; use a
shared store (e.g. Redis) if the site ever runs on several instances. SMTP settings come from
SMTP_HOST, SMTP_PORT, SMTP_EMAIL and SMTP_PASS.
- Create a new branch from
developfollowing the Git Flow branching convention - Make any code changes following Next.js best practices.
- Add or update end-to-end tests in
tests/e2e - Run
npm run verifyandnpm run test:e2ebefore opening a pull request (CI runs both)
- Create a pull request from your branch back into
develop - Once the changes have been approved, merge the pull request
- The
developpipeline will trigger, deploying to the DigitalOcean projectportfolio-dev
- Create a new release branch from develop in the format
release/vx.x.x(Use semantic versioning for the new release version) - Bump the package.json version to the new release version
- Create a pull request from your release branch into
main - Once the changes have been approved, merge the pull request as a squash merge
- The
productionpipeline will trigger, deploying to the DigitalOcean projectportfolio - Lastly, create a pull request from
mainback intodevelopand merge.
dev– start Next.js dev serverbuild– production build (next build)start– serve the production build (next start; the site needs a Node server for the contact API)analyze– analyzes application bundle with @next/bundle-analyzerpurgecss– removes unused CSS from the.nextoutput
verify– full check suite: prettier:check + lint + typechecktest:e2e– Playwright end-to-end suite (accessibility, project routes, 3D fallbacks, contact API, SEO). Runs against a production build:npm run build && npm run test:e2estartsnext starton port 3100 for you. First runnpx playwright install chromium; setPLAYWRIGHT_BASE_URLto test an already running server, orPLAYWRIGHT_CHROMIUM_PATHto use an existing Chromiumtypecheck– checks TypeScript typeslint– runs ESLint + Stylelintprettier:check– checks files with Prettier
prettier:write– formats all files with Prettierlint:fix– auto-fix ESLint + Stylelint issues