Getting Started

Start building with Bklar in seconds.

Getting Started

Bklar is designed to be up and running instantly. The best way to start a new project is using our official CLI tool.

Automatic Installation

We recommend using bun create to scaffold your project. It provides interactive templates for different use cases.

Run the CLI

Open your terminal and run:

bun create bklar my-app

Choose a Template

The interactive wizard will ask you to choose a template:

  • Minimal: A single file setup. Great for microservices.
  • Modular: A structured setup with folders for routes and controllers.
  • Custom: Select specific plugins (CORS, JWT, Swagger, etc.) manually.

Start Development

Navigate to your new project and start the server:

cd my-app
bun run dev

Your server will be listening at http://localhost:3000.

Manual Installation

If you prefer to build from scratch, you can install the core package manually.

bun add bklar zod
npm install bklar zod
pnpm add bklar zod

Note: zod is a required peer dependency for validation.

Hello World

Create an index.ts file:

import { Bklar } from "bklar";

const app = Bklar();

app.get("/", (ctx) => {
  return ctx.text("Hello from Bklar! 🐰");
});

app.listen(3000);

On this page