This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PostOwl is a personal blogging/sharing platform built with SvelteKit. It supports public posts (blog), private posts (journal), and sharing posts via secret links with email notifications.
npm run dev # Start dev server at localhost:5173
npm run build # Production build
npm run start # Run production build (node build)
npm run lint # Check formatting and lint (prettier --check . && eslint .)
npm run format # Auto-format all filesnpm install- Rename
.env.exampleto.env - Create database:
sqlite3 data/db.sqlite3 < scripts/schema.sql npm run dev- Login with ADMIN_PASSWORD from .env
For email testing, use mailpit - view sent emails at localhost:8025.
- Framework: SvelteKit with adapter-node
- Database: SQLite (better-sqlite3) - synchronous, no ORM
- Styling: Tailwind CSS with Forms and Typography plugins
- Rich Text: ProseMirror
- Email: Nodemailer
- Deployment: Fly.io with Docker
src/lib/- Shared utilities and componentssrc/lib/api.js- All database operations (posts, friends, auth, assets)src/lib/prosemirror*.js- Editor schema, keymaps, pluginssrc/lib/components/- Reusable Svelte componentssrc/routes/- SvelteKit file-based routingsrc/routes/api/- JSON API endpointsscripts/schema.sql- Database schemadata/- SQLite database files
+page.svelte- Page component+page.server.js- Server-side data loading+server.js- API endpoints (JSON)hooks.server.js- Request handling, auth injection into locals
- Single admin user, password from ADMIN_PASSWORD env var
- Cookie-based sessions stored in
sessionstable currentUseravailable inlocalsafter auth check in hooks- Secret-based access for shared posts via
?secret=query param
SQLite with WAL mode. Key tables: posts, friends, recipients (post sharing), sessions, pages (bio/settings), assets (file uploads), counters (view tracking).
- Svelte stores in
src/lib/stores.jsfor client state - Server-side data via SvelteKit load functions
- Form actions for mutations
REST-style endpoints in /api/ routes. Client uses fetchJSON(method, url, payload) utility from src/lib/util.js.