Skip to content

Quickstart

pnpm dlx @rebasepro/cli init my-app

This scaffolds a project with three packages:

FolderDescription
frontend/React SPA — Vite + TypeScript with the Rebase admin UI
backend/Node.js server — Hono, PostgreSQL via Drizzle ORM, WebSocket
config/Config files and collection definitions shared by both sides
  • Node.js 18+
  • PostgreSQL — local install, Docker, or any managed database (Neon, Supabase, etc.)
  • pnpm (recommended) or npm

After scaffolding, edit the .env file at the project root:

# PostgreSQL connection string
DATABASE_URL=postgresql://username:password@localhost:5432/your_database
# JWT secret for authentication (auto-generated in development if omitted)
JWT_SECRET=change-me-to-a-random-secret
# Frontend URL for CORS
VITE_API_URL=http://localhost:3001
# Optional: Google OAuth client ID
# VITE_GOOGLE_CLIENT_ID=your-google-client-id

Introspect an Existing Database (Optional)

Section titled “Introspect an Existing Database (Optional)”

If you are connecting to an existing database with pre-existing tables, you can introspect it to automatically generate your TypeScript collection files:

pnpm rebase schema introspect

This will analyze your database tables and generate corresponding TypeScript files in config/collections/ so you don’t have to write them manually.

pnpm dev

This starts:

  • Backend at http://localhost:3001 — REST API, auth, storage, WebSocket
  • Frontend at http://localhost:5173 — Rebase admin panel
  • Hot reload for both — changes take effect instantly

You can also start them individually:

pnpm dev:backend # Backend only
pnpm dev:frontend # Frontend only

When you open http://localhost:5173, you’ll see the login screen. The first user to register automatically becomes an admin — this is the bootstrap flow.

  1. Click Sign Up
  2. Enter your email and password
  3. You’re in — with full admin access

Open config/collections/ and create a new file:

import { EntityCollection } from "@rebasepro/types";
export const productsCollection: EntityCollection = {
slug: "products",
name: "Products",
singularName: "Product",
table: "products",
properties: {
name: {
type: "string",
name: "Name",
validation: { required: true }
},
price: {
type: "number",
name: "Price",
validation: { required: true, min: 0 }
},
description: {
type: "string",
name: "Description",
multiline: true
},
active: {
type: "boolean",
name: "Active",
defaultValue: true
},
created_at: {
type: "date",
name: "Created At",
autoValue: "on_create"
}
}
};
rebase schema generate # Generate Drizzle schema from your collections
rebase db push # Push the schema to your database

Restart the dev servers and your new Products collection appears in the navigation.

CommandDescription
rebase schema generateGenerate Drizzle schema from your TypeScript collections
rebase schema introspectGenerate TypeScript collections from an existing database
rebase db pushPush schema changes directly to the database (dev only)
rebase db generateGenerate SQL migration files
rebase db migrateRun pending migrations