Developer Guide
This section covers everything you need to contribute code to tripplan.ing — from understanding the architecture to writing production-safe code for Cloudflare Workers.
Before you start
Make sure you can run the app locally:
bash
npm install
npm run db:migrate:local
make devThen verify checks pass:
bash
npm run check # TypeScript + Svelte checks
npm test # TestsSee Quickstart if you haven't set up the project yet.
Section overview
| Page | What you'll learn |
|---|---|
| Architecture | Request lifecycle, multi-tenancy implementation, runtime abstraction, module boundaries |
| Auth System | Email OTP flow, rate limiting, session management, access control layers |
| Database | Schema families, Drizzle ORM patterns, migration workflow |
| Local Development | Node runtime, dev bypass, testing locally, debugging |
| Code Patterns | Svelte 5 runes, server patterns, Cloudflare constraints, naming conventions |
| Monorepo Layout | Workspace structure, package boundaries, import rules |
Key files to know
| File | Purpose |
|---|---|
apps/event-site/src/hooks.server.ts | Route guards, session parsing, hostname-to-event resolution |
apps/event-site/src/lib/server/auth.ts | Email OTP generation, verification, session management |
apps/event-site/src/lib/server/db/schema.ts | Complete Drizzle schema (30+ tables) |
apps/event-site/src/lib/server/runtime/ | Runtime abstraction (Cloudflare vs Node) |
apps/event-site/src/lib/server/settings.ts | Event config merging from database |
apps/event-site/src/lib/server/platform/ | Platform management (events, orgs, operators) |
apps/event-site/src/lib/types.ts | Shared TypeScript interfaces |
Contribution workflow
- Create a feature branch from
dev - Make your changes
- Run checks:
npm run check && npm test - Check import boundaries:
npm run check:boundaries - If you changed the schema:
npm run db:generate && npm run db:migrate:local - If you changed docs:
npm run docs:check - Push and open a PR against
dev