Installation

Get started with Bunbox in minutes

Prerequisites

Before you begin, make sure you have Bun installed:

curl -fsSL https://bun.sh/install | bash

Create a New Project

Create a new project with bun create:

bun create bunbox my-app cd my-app bun install

This will create a new Bunbox project with all the necessary dependencies.

Start Development Server

Start the development server:

bun dev

Your app will be available at http://localhost:3000.

Project Structure

A typical Bunbox project looks like this:

my-app/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ page.tsx          # Home page (/)
│   ā”œā”€ā”€ layout.tsx        # Root layout
│   ā”œā”€ā”€ index.css         # Global styles
│   ā”œā”€ā”€ about/
│   │   └── page.tsx      # About page (/about)
│   └── api/
│       └── users/
│           └── route.ts  # API route (/api/users)
ā”œā”€ā”€ public/
│   └── robots.txt        # Static files
ā”œā”€ā”€ bunbox.config.ts      # Configuration
ā”œā”€ā”€ package.json
└── tsconfig.json

Configuration

Bunbox works with zero configuration, but you can customize it using bunbox.config.ts:

import { defineConfig } from "@ademattos/bunbox"; export default defineConfig({ port: 3000, appDir: "./app", publicDir: "./public", });

What's Next?