Getting started
Protobase is a config-driven admin panel framework for existing Postgres databases. Data config lives in data.ts, UI config in ui.ts; a Hono server serves the API and a React app renders the admin.
Requires Node >= 22.12 (.nvmrc) and pnpm 10.12.1.
pnpm installRun the ERP example
Section titled “Run the ERP example”examples/erp is a sample ERP on a real Postgres database, seeded with three years of history. It needs Docker for the database.
pnpm --filter erp db:up && pnpm --filter erp db:migrate && pnpm --filter erp db:seed --scale smallpnpm --filter erp auth:migrate # Better Auth's tables, in the auth schemapnpm --filter erp protobase users create you@example.com --generate-passwordpnpm --filter erp dev # http://localhost:5173BETTER_AUTH_SECRET in .env signs the session cookies; see Login with Better Auth. protobase dev serves the admin app and the API on one port and reloads both on every change (CLI).
Commands
Section titled “Commands”| Command | Purpose |
|---|---|
pnpm test |
Vitest, single run |
pnpm test:watch |
Vitest, watch mode |
pnpm typecheck |
tsc --noEmit |
pnpm check:boundaries |
dependency-cruiser folder rules |
pnpm check |
typecheck + test + check:boundaries |
pnpm storybook |
Storybook on port 6006 |
pnpm build-storybook |
static Storybook build |
pnpm build:serve |
the serve runtime, dist/protobase-serve.js (see Deploy) |
pnpm docs:dev |
this site on port 4321 |
pnpm docs:build |
this site, built into website/dist/; fails on broken links |
pnpm docs:check |
opens every page of the built site in Chromium and fails on console errors and failed requests; BASE=https://docs.protobase.net checks the live site |
Source folders match the public imports (protobase/schema, query, ui, server). See Architecture for the layout and import rules.