Hono · Drizzle · PostgreSQL

Backend & APIs

A production-ready API server over your Postgres: REST, WebSocket realtime, JWT auth, and auto-generated OpenAPI docs. Point it at an existing database and every protected table is served automatically — no config files — or define collections in TypeScript when you want full control.

rebase-introspect

Connect to Your Postgres Database

Point Rebase at your connection string. Everything runs on your infrastructure.

DATABASE_URL
Status: Connected
v3.1.2

One definition, three APIs

Every collection you define automatically generates REST, WebSocket, and OpenAPI endpoints. Zero config.

REST API

Full CRUD endpoints with pagination, filtering, sorting, and relation loading.

Realtime Engine

Data subscriptions, broadcast channels, and presence tracking — with auth, RLS, and auto-reconnect built in.

OpenAPI/Swagger

Auto-generated OpenAPI 3.0 spec with a built-in Swagger UI for testing.

Powered by Hono

Built on Hono

The Rebase backend is a composable Hono application. Mount it standalone or embed it into your existing app. Add custom middleware, routes, and business logic.

  • Composable middleware (CORS, secure headers, auth)
  • Mount as a sub-app on your existing Hono server
  • Deploy on Node.js, Docker, Railway, Fly.io, or bare metal
  • SPA static serving built in
import { initializeRebaseBackend } from "@rebasepro/server";
import { createPostgresBootstrapper } from "@rebasepro/server-postgres";

const backend = await initializeRebaseBackend({
  server,
  app,
  bootstrappers: [
    createPostgresBootstrapper({
      connection: db,
      schema: { tables, enums, relations },
    })
  ],
  auth: {
    jwtSecret: process.env.JWT_SECRET,
  },
  storage: { type: "local", basePath: "./uploads" },
});
// ✅ REST, WebSocket, Auth, Storage — all ready
// Data:    /api/data/:collection
// Auth:    /api/auth/*
// Storage: /api/storage/*
Zero N+1 Queries

Drizzle Relational Queries

Collections generate Drizzle ORM schemas with full relation support. The query engine uses db.query.findMany with nested includes — zero N+1 queries, maximum performance.

  • Auto-generated Drizzle schema from collections
  • One-to-one, one-to-many, many-to-many relations
  • Field-level selection (only fetch what you need)
  • Cursor and offset pagination
// Your collection definition:
const postsCollection = {
  slug: "posts",
  properties: { title: { type: "string" } },
  relations: [{
    relationName: "author",
    target: () => usersCollection,
    cardinality: "one-to-one"
  }]
};

// Generates Drizzle schema + REST API:
GET /api/posts?include=author
// → Single query, no N+1

Batteries Included

Storage, email, and auth — everything you need for production, built in.

File Storage

Local, S3-compatible, and GCS/Firebase Storage with multi-backend support. Route different fields to different storage backends.

Email Service

Built-in SMTP integration for password reset, email verification, and custom transactional emails.

JWT Authentication

Custom JWT auth with access/refresh tokens, Google OAuth, role-based access control, and session management.

Database Branching

Create instant, isolated copies of your entire database for dev, staging, or testing. Like git branches, but for your data.

Custom Functions

Drop a Hono route file in functions/ and it auto-mounts at /api/functions/<name>. Zero config.

Entity History

Full audit trail for every data change. Track who changed what, when, and restore previous versions.

Deploy your backend in minutes