Installation
Requirements
- Node.js 22 or later
- pnpm 10 or later (recommended)
Create a New App
bash
npx create-rebasejs@latest my-app
cd my-app
pnpm install
pnpm devOpen http://localhost:3000. Your app is running.
No config files to touch. Tailwind is ready. TypeScript is ready. The Rust compiler is active.
Available Templates
create-rebasejs ships three templates:
| Template | Command | Best for |
|---|---|---|
basic | create-rebasejs my-app | Starting from scratch |
blog | create-rebasejs my-app --template blog | Content-heavy sites with SSR |
dashboard | create-rebasejs my-app --template dashboard | Admin UIs with server functions |
Project Structure
my-app/
├── app/
│ ├── models/ ← RebaseDB local data schemas
│ │ └── index.ts
│ ├── sync/ ← Webhook sync rules
│ │ └── index.ts
│ ├── layout.tsx ← root layout (wraps all pages)
│ ├── not-found.tsx ← custom 404 page
│ ├── page.tsx ← home route /
│ ├── page.server.ts ← server functions for home
│ ├── about/
│ │ └── page.tsx ← /about
│ └── posts/
│ ├── layout.tsx ← layout for /posts/*
│ ├── page.tsx ← /posts
│ ├── page.server.ts
│ └── [id]/
│ ├── page.tsx ← /posts/:id
│ ├── page.server.ts
│ ├── loading.tsx ← shown while data loads
│ └── error.tsx ← shown on render error
├── middleware.ts ← runs before every request
├── public/ ← static files served as-is
├── app/globals.css ← Tailwind entry point
└── package.jsonCLI Commands
bash
rebase dev # Dev server with HMR
rebase build # Production build (Vite 8 + Rolldown)
rebase build --mode spa # Client-only SPA build
rebase build --analyze # Build + open bundle treemap
rebase start # Start production H3 server
rebase ssg # Pre-render static routes to HTML
rebase test # Run tests with Vitest
rebase test --watch # Watch mode
rebase test --ui # Vitest UI
rebase info # Print route manifest and compiler info