Readiness: Implemented
Build an app
Build an app
Routes, Server Components, server actions, data, forms and UI: one guide per thing an application does. Unlike Start, this is not a sequence to read front to back. Read Routing first, then the page for what you are doing today.
Most read
- Start hereRoutingFiles become routes, layouts nest, and Server Components fetch their own data.
- Server ComponentsThe boundary a directive draws, the graph that resolves it, and a split at the route, not the module.
- Server actionsA function the browser calls by id: what may cross, what is refused, and why it authorizes itself.
- Data in the browserA query cache for what the browser fetches after the page has arrived, with requests that fail honestly and answers checked where they enter.
- FormsUncontrolled inputs, narrow subscriptions, and no Proxy.
What you need first
A project that runs — Your first project makes one. The tutorial builds one application out of most of the pages below, and is the quickest way to see how they fit before reading any of them in detail.
The pages, in order
- RoutingFiles become routes, layouts nest, and Server Components fetch their own data.
- Server ComponentsThe boundary a directive draws, the graph that resolves it, and a split at the route, not the module.
- Server actionsA function the browser calls by id: what may cross, what is refused, and why it authorizes itself.
- Testing Server Components and actionsA server action through its real endpoint, a component calling one over the wire, and a production build answering in the test's own process.
- Data in the browserA query cache for what the browser fetches after the page has arrived, with requests that fail honestly and answers checked where they enter.
- Languages and messagesRoute by locale and format MessageFormat 2 messages with checked arguments.
- Validating inputSchemas that parse untrusted input into typed values, with issue paths, inferred Flow types and a JSON Schema export.
- FormsUncontrolled inputs, narrow subscriptions, and no Proxy.
- StateAtoms, a store, and where this parts company with Jotai.
- Immutable updatesChange a draft with produce, keep unchanged branches, and record patches when needed.
- Styling and contentCSS, StyleX, tokens, dark mode, Markdown and MDX.
- UI componentsStyleX components you own, from uf ui add, on headless parts that own the keyboard and ARIA.
- Rendering modesWhere a document comes from, and what the browser does once it has one.
- Answering requestsMiddleware, route handlers, draft mode, QUERY, and streams, sockets and work that outlives the request.
- Async ReactSuspense, transitions and optimistic UI: what waits, what stays visible, and what is only temporary.
- Images, fonts, icons and cardsResized, self-hosted, subsetted and drawn at build time, remote images on request — and what that stops short of.
- Web componentsUse the browser-facing package for media, time, document regions, cookies and vitals.
- Dates and timeRepresent an instant without a host time zone, then choose a zone when displaying it.
- CachingRoute, function, and fetch caches with explicit lifetimes and pluggable storage.
- Signing inA contract rather than a provider: PKCE, a single-use state, and a session store you can replace.
- EffectsFailures in the type, and what Flow costs against Effect-TS.
- GraphQL and RelayRelay artifacts, typed components, request-scoped RSC preloads, and an independent backend.
- SQL with sqlcWrite SQL, and get Flow row types and query functions checked against SQLite, PostgreSQL and MySQL.
- LoggingA structured logger, and a request id readable from inside a render.
- Web vitalsFive numbers the browser already has, and nothing that leaves the machine unless you ask.
The order is what most applications need first. Routing leads because a route is what the rest attaches to: a loader, a layout, a Suspense boundary, a form that posts to an action. Then the server boundary — Server Components and Server actions — and the data, input, forms and state that cross it; then what the interface looks like and how its controls behave. After those come the pages you reach for once the core works: Rendering modes and Answering requests for what each route becomes and what answers it, Suspense and transitions, assets and caching, signing in, typed effects, GraphQL, and last what a deployed application needs around it — logs and measurements. The syntax every example is written in is Flow, the modern parts, in Start.
Which page answers which question
| You want to | Read |
|---|---|
| add a page, a layout or a loader | Routing |
| add middleware or a route handler | Answering requests |
| choose between prerendering, rendering per request and a client-side application | Rendering modes |
| decide what runs on the server and what ships to the browser | Server Components |
| show something while data loads or a change is in flight | Async React |
| call the server from the browser | Server actions |
| share state between components | State |
| take input and validate it | Forms |
| put failure in a type | Effects |
| build a tab list, a dialog or a menu that works with a keyboard and a screen reader | UI components |
| style it, or write pages in Markdown and MDX | Styling and content |
| resize images, self-host fonts, draw a share card | Images, fonts, icons and cards |
cache a route or a fetch | Caching |
| sign somebody in with OAuth | Signing in |
| log what a request did | Logging |
| measure LCP, CLS and INP | Web vitals |
| test any of it | Testing, in The toolchain |
| look up a component's parts, or which package exports something | Components and Packages |
write components and hooks with component and hook | Flow, the modern parts, in Start |
When you are done
Targets is where an application goes once it builds: a server or a static host, a single executable file, a phone, a terminal. Testing is in The toolchain, with the other commands you run against what you built.
Edit this pagedocs/app/guide/build-an-app/$page.mdx