Quick start
Automatic installation
Copy this prompt and paste it into your coding agent. It will guide you through setting up a Fondu app, in a new project or an existing one, and answer your questions along the way.
Read https://fondu.dev/docs/quick-start.md, then help me create a Fondu app (or add Fondu to this project). Ask me where it will run (Bun, Cloudflare Workers or Node), set it up as the guide says, and explain each file you create.Create an app
npm create fondu@latest my-apppnpm create fondu@latest my-appyarn create fondu my-appbun create fondu@latest my-appIt asks where the app runs: Bun, Cloudflare Workers or Node (or pass --target bun, --target cloudflare or
--target node), and whether to add code checks (or pass --checks): oxfmt and oxlint, and VS Code settings that
format on save; and whether to make a git
repository (--git), unless the folder is in one. Then it writes a small app: one page, a layout, the error page,
Tailwind CSS, editor snippets and an AGENTS.md for coding agents, and installs the dependencies with the package
manager you ran it with (--no-install leaves that to you). --yes takes the defaults for what the options don't say, without
asking, except for the target, which has none and must be given:
bun create fondu@latest my-app --target cloudflare --checks --yesRun it
cd my-app
npm run devcd my-app
pnpm devcd my-app
yarn devcd my-app
bun devThe app is at http://localhost:5173. Edit the page in app/routes/index.tsx and it updates in place; edit its
loader and the page gets the new props, without a reload.
Add a page
A page is a route file: its loader, and the page component. Add app/routes/about.tsx:
import { defineHandler, render } from 'fondu'
// GET /about: runs on the server
export const loader = defineHandler((c) => render(c, About, { team: ['Ada', 'Grace'] }))
// the page: the part of the file the browser gets
export default function About({ team }: { team: string[] }) {
return (
<>
<title>About</title>
<h1>About</h1>
<ul>
{team.map((name) => (
<li key={name}>{name}</li>
))}
</ul>
</>
)
}render(c, About, …) is checked against the page: a missing prop or one of the wrong type is a type error. Link to it with a plain <a> and a URL from href(), typed after your routes:
import { href } from 'fondu/client'
export const AboutLink = () => <a href={href('/about')}>About</a>Build
npm run buildpnpm buildyarn buildbun run buildThen start on Bun or Node, or deploy on Cloudflare: Deploying has the details.
Next
- Agent skills: give your coding agent Fondu's rules and keep your app's own conventions in
AGENTS.md. - Project structure: the files of the app you just created.
- Routes, Pages and props and Navigation: what you will write most.
- Every page of these docs is also Markdown: add
.mdto its URL. llms.txt lists them all.