A personal site: a bilingual blog, a projects section, a /now page, a
/health page fed by an Apple Watch, and a comment system with voting, admin
replies, IP bans and rate limiting.
Stack: SvelteKit · Convex (database, functions, realtime) · Tailwind · deployed on Vercel.
npm install
npx convex dev # provisions a deployment and writes PUBLIC_CONVEX_URL
npm run devnpx convex dev needs to stay running alongside npm run dev — it watches
convex/ and pushes schema and function changes.
| Command | Does |
|---|---|
npm run dev |
Dev server |
npm run build |
Production build |
npm run preview |
Serve the production build locally |
npm test |
Vitest, then the editor extension's tests |
npm run test:watch |
Vitest, watching |
npm run test:extension |
node:test over tools/vscode-extension |
npm run check |
svelte-check against tsconfig.json |
npm run lint |
Prettier check + ESLint |
npm run format |
Prettier write |
npm run optimize-images |
Re-encode tracked images through the turbo cache |
| Variable | Where |
|---|---|
PUBLIC_CONVEX_URL |
Convex client, browser and server. Set by npx convex dev. |
ADMIN_SECRET |
Admin auth. Must match the same variable in the Convex env. |
IP_HASH_SECRET |
HMAC key for hashing visitor IPs. |
CONVEX_DEPLOY_KEY |
Build-time only, on Vercel. |
HEALTH_API_KEY |
Convex-side only — the bearer token the Health Shortcut posts with. |
LAST_FM_PUBLIC_API_KEY |
Convex-side only — read by the home-page feed cron. |
Convex-side variables are set with npx convex env set, not in .env.
src/lib/ Components, plus health/, comments/, og/ and dev/ (DialKit)
src/routes/ Pages and the JSON API routes under api/
convex/ Schema, queries, mutations, actions, crons, HTTP actions
shortcuts/ The iOS Health Shortcut, its payload fixtures and a smoke script
tools/ The VS Code / Cursor authoring extension
tools/vscode-extension is a VS Code / Cursor
extension for the content tree: drop an image onto a post and it is filed under
static/images/{uploads,projects}/<slug>/ and linked, several at once become a
gallery, and the frontmatter, media paths and cross-links autocomplete against
what is actually in the repo. Press F5 to run it from source.
Architecture notes, the Convex schema, and the reasoning behind the parts that
look odd live in CLAUDE.md.