Files
Latte 77b5eb86c8 Add CLAUDE guide and publish blog posts
Add CLAUDE.md with repo guidance and architecture notes
Add new post "The Haircut Nobody Mentioned"
Adjust pubDate for Clearing the Queue and Knowing Your Worth
Remove draft flag from Knowing Your Worth
Fix frontmatter in Building as Avoidance
2026-05-06 20:58:38 +02:00

2.4 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

npm run dev      # Start dev server (http://localhost:4321)
npm run build    # Type-check (astro check) + production build
npm run preview  # Preview the production build locally

There are no test or lint commands beyond astro check (run as part of build).

Architecture

Cozy Den is the personal site for hiddenden.cafe. It's an Astro 4 project in hybrid output mode with a Node.js standalone adapter, which means most pages are statically generated at build time but API routes under src/pages/api/ run as server-side handlers at runtime.

Key directories

  • src/content/ — Astro Content Collections (blog, coffee, links, guestbook). Schemas and Zod validation live in src/content/config.ts. Blog posts support frontmatter fields for tags, categories, series, audio URLs, and featured-essay flags.
  • src/pages/api/ — SSR API endpoints. api/guestbook/submit.ts handles guestbook POST submissions; api/admin/ handles admin session auth.
  • src/lib/ — All shared TypeScript utilities: db.ts (SQLite setup/schema), auth.ts (admin sessions), guestbook.ts (submission logic), spam.ts (honeypot + keyword pattern detection + input sanitization), blog.ts, readingTime.ts.
  • src/layouts/BaseLayout.astro — Root layout; defines all global CSS custom properties (Catppuccin Mocha palette, typography, spacing).
  • src/components/ — Reusable .astro components (Card, Nav, Section, ServiceItem, SupportItem).

Database

SQLite via better-sqlite3. Tables: guestbook_entries (moderated submissions), admin_sessions (expiring tokens), rate_limit (per-IP), audit_log. The schema is initialized in src/lib/db.ts on first run — no separate migration step.

Styling

Vanilla CSS only — no Tailwind. All colour tokens are CSS variables on :root using the Catppuccin Mocha palette, with prefers-color-scheme overrides for light mode. Animations respect prefers-reduced-motion. Fonts are monospace (JetBrains Mono / Fira Code / SF Mono).

Deployment

The site runs as a Docker container (standalone Node on port 3000) behind Nginx. The image is pushed to git.hiddenden.cafe. Copy .env.example to .env for TTS API keys (Google / Mistral / OpenAI) used by scripts/tts_generate.py when generating audio versions of blog posts.