Getting Started
Prerequisites
Section titled “Prerequisites”- Bun >= 1.x — Bosia runs entirely on Bun. No Node.js required.
Create a New Project
Section titled “Create a New Project”bunx bosia create my-appYou’ll be prompted to pick a template:
| Template | Description |
|---|---|
| default | Minimal starter — home page, about page, one loader |
| demo | Full-featured — blog, API routes, form actions, hooks |
To skip the prompt:
bunx bosia create my-app --template demoDevelopment
Section titled “Development”cd my-appbun run devOpen http://localhost:9000. The dev server watches for file changes and reloads the browser automatically via SSE — no full-page blink.
Production Build
Section titled “Production Build”bun run buildbun run startbuild compiles client bundles, server entry, Tailwind CSS, and prerenders static routes. start runs the production server.
Your First Page
Section titled “Your First Page”Create a new file at src/routes/hello/+page.svelte:
<h1>Hello!</h1><p>This is my first Bosia page.</p>Visit http://localhost:9000/hello — that’s it. No config, no imports, no registration. The file-based router picks it up automatically.
Add a Server Loader
Section titled “Add a Server Loader”Create src/routes/hello/+page.server.ts alongside the page:
import type { LoadEvent } from "bosia";
export async function load({ url }: LoadEvent) { return { greeting: `Hello from the server!`, timestamp: Date.now(), };}Access the data in your page:
<script lang="ts"> let { data } = $props();</script>
<h1>{data.greeting}</h1><p>Rendered at {new Date(data.timestamp).toLocaleString()}</p>Next Steps
Section titled “Next Steps”- Project Structure — understand the file layout
- Routing — dynamic routes, groups, layouts
- Server Loaders — load data, metadata, parent threading
- API Routes — build REST endpoints