Documentation

Everything you need to build with Oven

เน€เธญเธเธชเธฒเธฃเธเธฒเธฃเนƒเธŠเน‰เธ‡เธฒเธ™ Oven Framework

01. Installation

Create a new Oven project with a single command:

# Using npx
npx create-oven my-app
# Or using bunx
bunx create-oven my-app

02. Quick Start

Get up and running in seconds:

# Create project
npx create-oven my-app

# Navigate to project
cd my-app

# Install dependencies
bun install

# Start development server
bun run dev

# Open http://localhost:3000

03. Project Structure

Oven uses a file-based routing system similar to Next.js:

my-app/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ layout.tsx          # Root layout
โ”‚   โ”œโ”€โ”€ page.tsx            # Home page (/)
โ”‚   โ”œโ”€โ”€ loading.tsx         # Loading UI
โ”‚   โ”œโ”€โ”€ error.tsx           # Error boundary
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ about/
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx        # /about
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ blog/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx        # /blog
โ”‚   โ”‚   โ””โ”€โ”€ [slug]/
โ”‚   โ”‚       โ””โ”€โ”€ page.tsx    # /blog/:slug
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ””โ”€โ”€ users/
โ”‚   โ”‚       โ””โ”€โ”€ route.ts    # /api/users
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ (dashboard)/        # Route group
โ”‚       โ””โ”€โ”€ dashboard/
โ”‚           โ””โ”€โ”€ page.tsx    # /dashboard
โ”‚
โ”œโ”€โ”€ public/                 # Static files
โ””โ”€โ”€ oven.config.ts          # Configuration

File Conventions:

page.tsx Page component for a route
layout.tsx Shared wrapper for pages
route.ts API endpoint handler
loading.tsx Loading UI
error.tsx Error boundary

04. Routing

Static Routes

app/about/page.tsx โ†’ /about

Dynamic Routes

app/blog/[slug]/page.tsx โ†’ /blog/:slug

Catch-All Routes

app/docs/[...path]/page.tsx โ†’ /docs/*

Route Groups

app/(dashboard)/settings/page.tsx โ†’ /settings

Parentheses are excluded from URL

05. Pages

Create pages by adding page.tsx files:

// app/page.tsx
import type { PageProps, Metadata } from './types';

export const metadata: Metadata = {
  title: 'Home',
  description: 'Welcome to my app',
};

export default function HomePage({ searchParams }: PageProps) {
  return `
    <div>
      <h1>Hello, Oven! ๐Ÿ”ฅ</h1>
      <p>Build amazing apps with Bun</p>
    </div>
  `;
}

06. Layouts

Layouts wrap pages and persist across navigations:

// app/layout.tsx
import type { LayoutProps } from './types';

export default function RootLayout({ children }: LayoutProps) {
  return `
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8">
        <title>My App</title>
      </head>
      <body>
        <nav>...</nav>
        <main>${children}</main>
        <footer>...</footer>
      </body>
    </html>
  `;
}

07. API Routes

Create RESTful APIs with route.ts files:

// app/api/users/route.ts
// GET /api/users
export async function GET(request: Request) {
  const users = [
    { id: 1, name: 'John' },
    { id: 2, name: 'Jane' },
  ];
  return Response.json(users);
}

// POST /api/users
export async function POST(request: Request) {
  const body = await request.json();
  return Response.json(body, { status: 201 });
}

// DELETE, PUT, PATCH also supported

08. Docker Deployment

Deploy with Docker in production:

# docker-compose.yml
version: '3.8'
services:
  oven:
    build: .
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
docker-compose up -d

09. Vercel Deployment

Deploy to Vercel with one command:

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel --prod

Ready to Build?

Start building with Oven today