⚠️ AlabJS is under active development and not yet production-ready. APIs may change before v1.0. Feel free to explore, contribute, or star the repo.
Skip to content

Installation

Requirements

  • Node.js 22 or later
  • pnpm 10 or later (recommended)

Create a New App

bash
npx create-alabjs@latest my-app
cd my-app
pnpm install
pnpm dev

Open 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-alabjs ships three templates:

TemplateCommandBest for
basiccreate-alabjs my-appStarting from scratch
blogcreate-alabjs my-app --template blogContent-heavy sites with SSR
dashboardcreate-alabjs my-app --template dashboardAdmin UIs with server functions

Project Structure

my-app/
├── app/
│   ├── 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.json

CLI Commands

bash
alab dev                    # Dev server with HMR
alab build                  # Production build (Vite 8 + Rolldown)
alab build --mode spa       # Client-only SPA build
alab build --analyze        # Build + open bundle treemap
alab start                  # Start production H3 server
alab ssg                    # Pre-render static routes to HTML
alab test                   # Run tests with Vitest
alab test --watch           # Watch mode
alab test --ui              # Vitest UI
alab info                   # Print route manifest and compiler info

Released under the MIT License.