Skip to main content
BunShip Hero

What is BunShip?

BunShip is a production-ready SaaS API boilerplate built with Bun and Elysia. It provides everything you need to launch your SaaS product quickly without sacrificing quality or performance.

Blazing Fast

Built on Bun runtime, BunShip delivers 3-4x better performance than Node.js

Type-Safe

End-to-end TypeScript with Eden client for complete type inference

Production Ready

Battle-tested patterns for authentication, billing, and multi-tenancy

Developer Friendly

Clean codebase, comprehensive docs, and auto-generated API documentation

Why BunShip?

Building a SaaS from scratch means implementing the same features over and over:
  • User authentication with sessions and 2FA
  • Team management with roles and permissions
  • Stripe subscriptions with usage limits
  • Webhook systems for integrations
  • API key management
  • Audit logging
BunShip gives you all of this out of the box, so you can focus on what makes your product unique.

Features

Authentication

  • Email and password with secure hashing - Magic link passwordless login - Google OAuth - GitHub OAuth - TOTP-based two-factor authentication
  • JWT access and refresh token rotation - Account lockout after failed attempts - Session management (view and revoke) - Email verification - Password reset flow

Multi-Tenancy

BunShip includes a complete multi-tenant architecture:
  • Organizations - Isolated workspaces for teams
  • Team invitations - Email-based invite flow
  • Role-based access - Owner, Admin, Member, Viewer roles
  • Granular permissions - Fine-grained permission system

Billing

Integrated Stripe billing with:
  • Subscription management - Create, update, cancel subscriptions
  • Usage tracking - Monitor API requests, storage, members
  • Pricing tiers - Free, Pro, Enterprise plans included
  • Customer portal - Self-service billing management
  • Webhook handling - Automatic subscription status sync

Developer Experience

  • Type-safe API client - Eden client with full autocomplete
  • OpenAPI documentation - Auto-generated from route definitions
  • Structured errors - Consistent error responses
  • Background jobs - BullMQ for async processing

Tech Stack

ComponentTechnology
RuntimeBun
FrameworkElysia
DatabaseTurso / SQLite
ORMDrizzle
PaymentsStripe
EmailResend
QueueBullMQ
CacheRedis

Quick Start

Get up and running in under 5 minutes:
1

Clone the repository

bash git clone https://github.com/bunship/bunship.git my-saas cd my-saas
2

Install dependencies

bash bun install
3

Configure environment

bash cp .env.example .env # Edit .env with your configuration
4

Setup database

bash bun run db:migrate bun run db:seed # Optional: adds demo data
5

Start development server

bash bun dev
Your API is now running at http://localhost:3000 with documentation at http://localhost:3000/docs.

Project Structure

bunship/
├── apps/
│   ├── api/                 # Main Elysia API
│   │   ├── src/
│   │   │   ├── routes/      # API endpoints
│   │   │   ├── middleware/  # Auth, permissions
│   │   │   ├── services/    # Business logic
│   │   │   └── jobs/        # Background workers
│   └── docs/                # This documentation
├── packages/
│   ├── config/              # Shared configuration
│   ├── database/            # Drizzle schema
│   ├── emails/              # Email templates
│   ├── eden/                # Type-safe client
│   └── utils/               # Shared utilities

Using the Eden Client

BunShip exports a type-safe API client for your frontend:
import { createClient } from "@bunship/eden";

const api = createClient("http://localhost:3000");

// Full type inference and autocomplete
const { data, error } = await api.api.v1.auth.login.post({
  email: "[email protected]",
  password: "password123",
});

if (data) {
  console.log("Logged in:", data.user.email);
  // Store tokens for authenticated requests
}

Next Steps

Support