orlybot
orlybot docsSelf-hosting

Architecture

Understand the boundaries between HTTP, data access, and background work.

Architecture

src/index.ts starts the Hono/Bun HTTP server. src/worker.ts starts BullMQ workers and the scheduled reconciler. The React client lives in src/client.

HTTP and client boundary

Hono routes live in src/server/routes. New API resources are mounted from src/server/routes/api/index.ts. The client uses src/client/lib/rpc.ts rather than importing server modules.

Data access

Drizzle is server-only. Schemas live in src/server/db/schema, queries live in src/server/repos, and route handlers return validated DTOs instead of raw database rows.

Durable tasks

Durable work is recorded in Postgres background_tasks. BullMQ transports only a small task ID, while processors load the durable payload through the repository.

On this page