# Project Structure

> How a React API Stack repository is laid out, directory by directory.

A React API Stack project keeps a clean separation between what you author (TypeScript resources and tokens) and what is generated (the manifest, the OpenAPI contract, and the typed client).

```text title="repository layout"
resources/      TypeScript resource definitions — the single source of truth
tools/          the rastack package — compiler, codegen, CLI, and the React runtime
tokens/         the design system — DTCG design tokens (.json + .ts)
rust/           Cargo workspace — the manifest-driven API, Iceberg storage, admin
data/           the local database — a committed directory of Iceberg/Parquet files
web/            the marketing site and docs (this site)
docs/           architecture & design docs
examples/       runnable references — serverless/ = Lambda + S3 deployment
```

## Authored vs. generated

| You author | The compiler emits |
| --- | --- |
| `resources/*.ts` | `schema.rastack.json` — the canonical manifest |
| TypeScript interfaces | `openapi.json` — the API contract |
| `tokens/*.ts` / `.json` | `tokens.css`, `tokens.ts`, `tokens.rastack.json` |

> **Note:** The generated manifest drives the Rust API, the admin site, and the codegen — there is no per-resource server code to write. Add a resource, recompile, and every surface updates.

## The Rust workspace

The `rust/` directory is a Cargo workspace whose crates are entirely manifest-driven:

- `rastack-manifest` — a serde model of the schema.
- `rastack-store` — the Iceberg engine over a swappable object backend and codec.
- `rastack-api-core` — the framework-free request brain (CRUD, FK validation, access control).
- `rastack-api` — the axum HTTP adapter, plus the admin module and JWT verification.
- `rastack-wasm` — the same engine compiled for the browser.
- `rastack-server` — the binary that `rastack serve` and `rastack admin` exec.

---

_Source: [https://reactapistack.com/docs/project-structure](https://reactapistack.com/docs/project-structure) · Full docs as one file: [llms-full.txt](https://reactapistack.com/llms-full.txt)_
