# §53 — The open API

No accounts, no sessions, no reset emails. Requests come in, rows go out, and the only thing you have to be careful about is how many of them one caller can make.

This is the smallest complete Atlas server, and more services should stop here than do. Add identity the day a caller needs to be told apart from another caller — not before.

## What you are carrying

- `@atlas/config` — Typed environment variables, read once at boot.
- `@atlas/db` — Schemas, a query builder, Postgres or SQLite.
- `@atlas/migrate` — Timestamped SQL, generated from the schema you already wrote.
- `@atlas/server` — Pipe-based routes over Bun.serve.
- `@atlas/security` — Rate limiting, because public means public.

## Start it

```bash
atlas init -n myapi --template api
```

## What it looks like

`src/server.ts`

```ts
import { connect, from } from "@atlas/db"
import { migrate } from "@atlas/migrate"
import { serve, get, json } from "@atlas/server"
import { posts } from "./schema"

const db = connect({ driver: "sqlite", path: "./app.db" })
await migrate.up(db, "./migrations")

serve({
  port: 3000,
  routes: [
    get("/posts", async (c) =>
      json(c, 200, await db.all(from(posts).select("id", "title").limit(50)))),
  ],
})
```

## Where now

- Put it online — turn to §100 (Appendix A)
- Hand it to an agent — turn to §102 (Appendix C)
- Walk it again from the start — turn to §1
