---
title: Quickstart
description: Build your first type-safe Hono API with Nooh in under five minutes.
---

This guide takes you from an empty directory to a running Hono server with a file-based route and a dependency-injected service.

1. **Create the project**

    Start from the official template — it handles the scaffolding for you:

    ```bash
    pnpm create @nooh-ts/template my-api
    cd my-api
    pnpm install
    ```

    Or follow the [manual installation](/docs/introduction/installation) if you're adding Nooh to an existing project.

2. **Write a route**

    Create `src/routes/index.get.ts`. The filename encodes both the HTTP method (`get`) and the path (`/`):

    ```ts
    // src/routes/index.get.ts
    import { get } from "@router/index";

    export default get((c) => c.text("Hello, Nooh!"));
    ```

    The `@router/index` import is generated by Nooh. It exports a typed `get` factory that matches this exact route.

3. **Build**

    Run the compiler to generate the Hono application:

    ```bash
    npx nooh build
    ```

    Nooh reads `src/routes/index.get.ts`, generates `.nooh/router/index.ts` with a fully typed `get` factory, and assembles a `.nooh/app.ts` that wires everything into a Hono instance.

4. **Start the server**

    Create your entry point and start the server. This example uses Bun, but any Hono-compatible runtime works:

    ```ts
    // src/index.ts
    import app from "../.nooh/app";

    export default app;
    ```

    ```bash
    bun src/index.ts
    ```

    Visit `http://localhost:3000` — you should see `Hello, Nooh!`.

5. **Add a dynamic route**

    Add `src/routes/users/[id].get.ts` — square brackets create a URL parameter:

    ```ts
    // src/routes/users/[id].get.ts
    import { get } from "@router/users/[id]";

    export default get((c) => {
      const id = c.req.param("id");
      return c.json({ id });
    });
    ```

    Rebuild and the new route is live at `GET /users/:id`. The `id` parameter is typed through Hono's `c.req.param`.

## What's next?

**[Project structure](/docs/introduction/project-structure)**

Understand how a Nooh project is laid out.

**[Routing](/docs/routing)**

Learn all the routing conventions — dynamic segments, groups, splats, and more.

**[Dependency Injection](/docs/dependency-injection)**

Inject services into your handlers at compile time.

**[Validation](/docs/validation)**

Add request and response validation with any Standard Schema library.
