Task Tracker starter
Build a small route tree with a page route, shared layout, loader, action, and middleware.
app/routes/tasks.tsx
app/routes/tasks.server.ts
app/routes/_layout.tsx
app/routes/_middleware.server.tsOpen Quick StartFramework examples
These examples are compact entry points into the docs. Use them to understand how route files, loaders, actions, streaming, API handlers, and Bun deployment fit together.
Use cases
Build a small route tree with a page route, shared layout, loader, action, and middleware.
app/routes/tasks.tsx
app/routes/tasks.server.ts
app/routes/_layout.tsx
app/routes/_middleware.server.tsOpen Quick StartFetch server-owned data, return deferred values, and hydrate the same route payload on the client.
export const loader: Loader = async () => {
return defer({
tasks: await getTasks(),
activity: getActivity(),
});
};Read loader docsUse React useActionState with a client action stub and a server companion action.
export const action = createRouteAction<FormState>();
const [state, formAction] = useActionState(action, initialState);Read action docsStream the full document while slower loader keys resolve behind Suspense boundaries.
<Suspense fallback={<p>Loading activity...</p>}>
<ActivityFeed data={activityPromise} />
</Suspense>Read streaming docsReturn JSON from API routes that share the same route tree and middleware model as pages.
export function GET() {
return json({ ok: true });
}Read routing docsBuild client/server artifacts and start the generated Bun server without a Node adapter layer.
bun run build
bun run startRead deployment docsNext step
Examples show what the framework feels like in code. Benchmarks and comparisons explain when this smaller Bun-native stack is the right tradeoff.