Getting Started
Create your first Bosia project in under a minute.
Bosia is production-ready out of the box. Security (CSRF, XSS escaping, secure cookies, security headers), performance (response cache, gzip, prerendering), and reliability (graceful shutdown drain, request backpressure, crash backoff) are all built in — no plugins or config required.
Prerequisites
- Bun >= 1.x — Bosia runs entirely on Bun. No Node.js required.
Create a New Project
bun x bosia@latest 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 |
| todo | Todo app with PostgreSQL + Drizzle ORM |
To skip the prompt:
bun x bosia@latest create my-app --template todoDevelopment
cd my-app
bun 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
bun run build
bun run startbuild compiles client bundles, server entry, Tailwind CSS, and prerenders static routes. start runs the production server.
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
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
- Project Structure — understand the file layout
- Routing — dynamic routes, groups, layouts
- Server Loaders — load data, metadata, parent threading
- API Routes — build REST endpoints
- Components — add UI components from the registry