Skip to content

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 dev

Then verify checks pass:

bash
npm run check    # TypeScript + Svelte checks
npm test         # Tests

See Quickstart if you haven't set up the project yet.

Section overview

PageWhat you'll learn
ArchitectureRequest lifecycle, multi-tenancy implementation, runtime abstraction, module boundaries
Auth SystemEmail OTP flow, rate limiting, session management, access control layers
DatabaseSchema families, Drizzle ORM patterns, migration workflow
Local DevelopmentNode runtime, dev bypass, testing locally, debugging
Code PatternsSvelte 5 runes, server patterns, Cloudflare constraints, naming conventions
Monorepo LayoutWorkspace structure, package boundaries, import rules

Key files to know

FilePurpose
apps/event-site/src/hooks.server.tsRoute guards, session parsing, hostname-to-event resolution
apps/event-site/src/lib/server/auth.tsEmail OTP generation, verification, session management
apps/event-site/src/lib/server/db/schema.tsComplete Drizzle schema (30+ tables)
apps/event-site/src/lib/server/runtime/Runtime abstraction (Cloudflare vs Node)
apps/event-site/src/lib/server/settings.tsEvent config merging from database
apps/event-site/src/lib/server/platform/Platform management (events, orgs, operators)
apps/event-site/src/lib/types.tsShared TypeScript interfaces

Contribution workflow

  1. Create a feature branch from dev
  2. Make your changes
  3. Run checks: npm run check && npm test
  4. Check import boundaries: npm run check:boundaries
  5. If you changed the schema: npm run db:generate && npm run db:migrate:local
  6. If you changed docs: npm run docs:check
  7. Push and open a PR against dev

Released under the MIT License.