# Installation

> Add rastack to your project and compile your first resource in under a minute.

React API Stack ships as a single npm package, `rastack`, with subpath exports for the DSL, the CLI, the React runtime, and the design-token framework. The fastest way in is the one-line installer — no clone, no config.

## Install the CLI

Install the `rastack` CLI with a single command, the way you'd install [Poetry](https://python-poetry.org) or [rustup](https://rustup.rs). It drops a self-contained copy under `~/.rastack` — no `sudo`, nothing outside your home directory — and wires it onto your `PATH`.

```bash title="terminal"
# macOS / Linux
curl -fsSL https://reactapistack.com/setup.sh | sh

# Windows (PowerShell) — from cmd, prefix with: powershell -c "…"
irm https://reactapistack.com/setup.ps1 | iex
```

> **Note:** `rastack` is a Node package, so **Node.js 18+** is the one prerequisite — the way Python is for Poetry. Pin a version with `RASTACK_VERSION=x.y.z` before the command, relocate with `RASTACK_HOME`, or skip the PATH edit with `RASTACK_NO_MODIFY_PATH=1`.

## Add it to a project

Prefer a package manager, or want rastack pinned as a project dependency in `package.json`? Both work:

```bash title="terminal"
npm install -g rastack     # the global CLI, via npm
npm install -D rastack     # or as a dev dependency in one project
```

> **Note:** This is alpha software you can install and test today. Expect rough edges and breaking changes between releases.

## Requirements

- **Node.js 18+** and a package manager (npm, pnpm, or yarn).
- **A TypeScript project.** Resources are authored in `.ts` and the compiler builds a real `ts.Program` to read your types.
- **React 18+** for the generated hooks (built on [TanStack Query](https://tanstack.com/query)).
- **Optional: Rust + the** `wasm32-unknown-unknown` **target** if you want to run the engine locally in the browser.

## Verify the install

Compile the resource graph and inspect it — no server or database required:

```bash title="terminal"
# TypeScript resources → schema.rastack.json + openapi.json
npx rastack compile

# introspect the resource graph and its relations
npx rastack list
npx rastack urls
```

## Package subpaths

Everything lives under the one `rastack` package so versions never drift:

| Import | What it provides |
| --- | --- |
| `rastack/define` | The `resource()` DSL and the `s.*` field builders. |
| `rastack/hooks` | The generated, typed React Query hooks and runtime. |
| `rastack/provider` | `<RAStackProvider>` — the runtime mode switch (local / s3 / remote). |
| `rastack/tokens` · `rastack/theme` | The design-token DSL and the `<ThemeProvider>` runtime. |
| `rastack/sync` · `rastack/cache` | The local-first sync store and the local Iceberg file cache. |

> **Tip:** Continue to the [Quick Start](https://reactapistack.com/docs/quickstart.md) to define a resource, generate the client, and read data end-to-end.

---

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