Starter kits
The fastest way to start a new app on Cratebase isn’t an empty
cratebase dev and a blank frontend — it’s
create-cratebase,
a scaffolding CLI that gives you a small, production-shaped, typed-end-to-end
app with auth, a realtime dashboard, and a Cratebase server ready to run,
in one command.
bun create cratebase my-app# or: npm create cratebase@latest my-app# or: pnpm create cratebase my-appAnswer three prompts (template, package manager, whether to install
dependencies and run git init) — or skip all of them non-interactively:
bun create cratebase my-app --template nextjs --pm bun --yesThen:
cd my-appbun run devdev runs cratebase dev (the local server: superuser, schema, seed data,
generated types, hot-reloading hooks — see First run)
and the frontend’s own dev server side by side. Sign in with the seeded
demo account, or create a new one — either way you’re looking at real
auth, a realtime list, file upload, and search wired up to a real
Cratebase instance within a minute of running the first command.
Templates
Section titled “Templates”nextjs |
vite-react |
expo |
|
|---|---|---|---|
| Stack | Next.js (App Router), TypeScript, Tailwind | Vite, React, TypeScript, Tailwind | Expo Router, TypeScript |
| Auth | Password, email OTP, magic link, OAuth, TOTP | Password, email OTP, magic link, OAuth, TOTP | Password, email OTP |
| Realtime list | ✅ useRecords(..., { realtime: true }) |
✅ | ✅ |
| Create/update/delete | ✅ useMutation |
✅ | Add/delete |
| File upload | ✅ useUpload |
✅ | not included — same API, see the template’s README |
| Full-text search | ✅ | ✅ | not included — same API, see the template’s README |
| Notifications bell | ✅ useNotifications |
✅ | not included — same API, see the template’s README |
| Rendering | SSR-safe CratebaseProvider boundary |
Client-only SPA | Native + web (SPA export) |
nextjs and vite-react ship the full feature set: password/OTP/magic-link
sign-in with OAuth buttons (rendered only for providers you’ve actually
configured) and TOTP challenge handling, a protected dashboard with a
realtime list, create/update/delete, cover-image upload, a search box, and
a notifications bell. expo is kept deliberately lean — password and
email-code sign-in plus a realtime list — since OAuth, magic links, and
TOTP all need a bit of native wiring (deep linking, a QR-rendering
library) that doesn’t belong in a starter; its README shows exactly how
to add each one with the same @cratebase/client calls the web templates
use.
Every template ships with:
schema.json— a smallpostscollection (title + content, both searchable; an optionalcoverfile field; anownerrelation), scoped withowner = @request.auth.idrules — see Schema as code.pb_seed/— a demo user (demo@example.com/password123) and a couple of seeded notes, applied once on an empty database — see Seeding data.pb_hooks/welcome.pb.js— emails the built-inwelcomeemail template to every new signup via$mails.send..env.example, adevscript that runscratebase devand the frontend together (and prints the one-line install command if thecratebasebinary isn’t on yourPATHyet), and a README with its own 60-second quickstart and deploy notes.
The CLI itself
Section titled “The CLI itself”create-cratebase has no runtime dependency beyond
@clack/prompts — it copies a
template, substitutes your project name, and optionally installs
dependencies and runs git init. Every flag also works non-interactively,
which is what a CI job scaffolding a template for a build check (like
Cratebase’s own) uses:
Usage: bun create cratebase <project-directory> [options]
Options: -t, --template <name> nextjs, vite-react, expo --pm <name> bun, npm, pnpm, yarn -y, --yes Skip prompts, accept defaults for anything unset --no-install Skip installing dependencies --no-git Skip `git init`Works with Bun, npm, pnpm, or Yarn, and requires only Node ≥ 18.