Skip to content

Opinionated Elysia + Bun + Drizzle boilerplate for building type‑safe, observable REST APIs on PostgreSQL, with OpenAPI docs and real integration tests.

Notifications You must be signed in to change notification settings

DanielSuhett/typesafe-api-boilerplate

Repository files navigation

Elysia with Bun runtime

image

Development

To start the development server run:

bun run dev

Open http://localhost:3000/ with your browser to see the result.

Testing (Integration)

This project uses Bun's built-in test runner to execute real integration tests (no mocks) against a Postgres database.

  1. Start a local Postgres for tests (example via Docker):
docker run --rm \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=carts_test \
  -p 54329:5432 \
  -d postgres:16
  1. Run tests with the provided env file:
bun test --env-file=.env.test

The test runner will:

  • Ensure the required enums and carts table exist
  • Truncate data between tests for isolation
  • Exercise HTTP routes via app.handle(new Request(...))

About

Opinionated Elysia + Bun + Drizzle boilerplate for building type‑safe, observable REST APIs on PostgreSQL, with OpenAPI docs and real integration tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published