Skip to content
Installation
Start hereInstallation
On this page

Installation

Start with a small React app that runs locally on the Workers runtime.

Prerequisites

Use Node.js 22 or newer and pnpm. You only need a Cloudflare account when you are ready to deploy; local development and standalone builds work without a login.

Create an app

Terminal
pnpm create goribu@latest my-app
cd my-app
pnpm install
pnpm dev

Open the local URL printed in your terminal. The starter includes TypeScript, Tailwind, an interactive home page, and a request-time greeting at /hello.

Choose a new directory name: 1–50 lowercase letters, digits, or hyphens, starting with a letter and ending with a letter or digit. Pass a name, not a path. The scaffolder will not overwrite an existing directory or install dependencies for you.

For JavaScript, add --js:

Terminal
pnpm create goribu@latest my-app --js

Both variants use the same framework APIs. There is no --css flag; plain CSS also works in the default starter.

Find your way around

FilePurpose
src/routes/index.tsxThe home page. Use .jsx in the JavaScript starter.
src/routes/hello.tsxA page with a GET handler that reads the request.
src/routes/_document.tsxThe HTML document around your pages.
src/client-entry.jsBrowser bootstrap and global CSS imports.
src/styles.cssGlobal styles and the Tailwind import.
goribu.config.jsWorker name and optional Cloudflare resources.
vite.config.jsVite, Goribu, and Tailwind plugins.
AGENTS.mdProject instructions for coding agents.

Edit the home page, then try /hello?name=Nina. Pages and handlers live together; reusable components can go in src/components/.

Leave dist/, .goribu/, .wrangler/, goribu.wrangler.jsonc, and node_modules/ to the tools that generate them.

Start coding with your agent

Ask your agent to read the generated AGENTS.md before changing the app. Then describe a feature and its expected behavior. The AI coding guide explains how to provide useful context, and At a glance is a compact API introduction.

Commands

Run commands from your app directory.

CommandPurpose
pnpm devDevelop locally with hot updates.
pnpm typecheckCheck TypeScript without emitting files. TypeScript starter only.
pnpm buildBuild the Worker, browser assets, and static pages.
pnpm checkInspect the production target, resources, and migrations without changing them.
pnpm run deployBuild and deploy to Cloudflare.

Development and production builds compile TypeScript without type checking. Run pnpm typecheck separately in TypeScript projects.

Use pnpm run deploy, including run: bare pnpm deploy invokes pnpm's own command. See Deploys when you are ready to publish.

Type a route

Use type-only imports to describe your page props and request handlers:

src/routes/hello.tsx
import type { Handler } from "goribu/server";
import type { Meta } from "goribu";

type Props = { name: string };

// Read the query string and pass serializable props to the page.
export const GET: Handler<Props> = (req, res) => {
  const name = req.query.get("name")?.trim() || "friend";
  return res.render({ name });
};

export const meta: Meta<Props> = ({ props }) => ({
  title: `Hello, ${props.name}`,
});

// Render the same props on the server and in the browser.
export default function HelloPage({ name }: Props) {
  return <h1>Hello, {name}.</h1>;
}

Handler<Props, Env, Params> also accepts types for Worker bindings and dynamic parameters. Types describe your expectations; validate request input at runtime. The API reference lists the public types.