http
started 2026-10
A template for backend HTTP servers: Bun, Elysia, Drizzle and Postgres, with one fully worked example resource to copy from.
Every backend I start begins the same way: a router, a database, validation, docs, error handling, and an afternoon spent wiring them together again. http is that afternoon done once.
It ships a single example resource, posts, done properly: create, list with pagination, get, update, delete, each with request and response schemas, OpenAPI docs at /docs, and a precise status for every failure. An empty title is a 400, a duplicate is a 409, a malformed id is a 422. Anything unexpected becomes a 500 with a generic message and a short reference, and the full error is logged on the server under that reference, so users never see a stack trace and I can still find it.
It succeeds my earlier Server template. Drizzle instead of Convex, so the data stays in a plain Postgres I control. The first real project built from it is the Pharmagarde backend.
Highlights
- One example resource with full CRUD, pagination and validation, made to be copied
- OpenAPI docs generated from the route schemas, served at /docs
- Every documented status per route; unknown failures get a reference id, not a stack trace
- db:push creates the database if it doesn't exist, then syncs the schema
- Optional path prefix for every route, docs included