Browse documentation
Lesson 02 · Run the app

Create your first Start app

Use the official CLI to create a minimal app and locate the route tree, root document, and development server.

TanStack StartFoundation12 minREV 02Markdown .md
After this lesson

Run the project and explain the two core files in src/routes.

01

Generate the project

The official CLI creates a TanStack Start project by default. Use the blank option while learning to reduce starter-code noise.

terminalbash
npx @tanstack/cli@latest create my-app --blank -y
cd my-app
pnpm dev
02

Find two files first

__root.tsx defines the HTML document and global layout; index.tsx is the root page. routeTree.gen.ts is generated and should not be edited by hand.

PRACTICE

Turn this lesson into a verifiable skill

Completion checkpoint

The development server starts and the generated route tree recognizes both the root and index routes.

Exercise

Add an `/about` file route, show the app name, and navigate to it from the index using a type-safe Link.

Verification

Run typecheck and directly load both `/` and `/about`; both URLs should survive refresh with no type errors.

Common pitfalls
  • Editing the generated routeTree file by hand.
  • Putting the root document structure in a normal child route.
SOURCE REFERENCES · CHECKED 2026-08-03https://tanstack.com/cli/latest/docs/quick-start
TanStack Atlas

Original bilingual knowledge · verified against primary sources

Friend linksGitHub