# Tech Stack — arcrun

## Runtime & Deployment
- **Cloudflare Workers** — all backend services deploy as Workers via Wrangler
- **Cloudflare KV** — workflow definitions, credentials (encrypted), recipes, sessions
- **Cloudflare R2** — WASM binary storage (`WASM_BUCKET`)
- **Cloudflare Pages** — frontend deployment (arcrun.dev landing page)

## Languages & Frameworks
- **TypeScript** — Workers (HTTP routing/orchestration only), CLI, SDKs
- **TinyGo / AssemblyScript** — all component logic, compiled to WASM (WASI preview1)
- **Hono** — HTTP framework for all Workers (routing, middleware, OpenAPI)
- **Zod** — schema validation and OpenAPI spec generation (`@hono/zod-openapi`)
- **React 19** + **Vite** — frontend (landing page)
- **Tailwind CSS v4** — styling

## Testing
- **Vitest** — test runner
- **@cloudflare/vitest-pool-workers** — Workers-specific test pool for cypher-executor

## Package Management
- **pnpm** — used in most packages (some use npm)

---

## Common Commands

### Per-service (run from the service directory)

```bash
# Start local dev server
pnpm dev          # or: npm run dev

# Deploy to Cloudflare
pnpm deploy

# Run tests (single pass)
pnpm test         # runs: vitest run
```

### WASM Components (TinyGo)

```bash
# Build a component
cd registry/components/{name}/
tinygo build -target=wasi -o main.wasm main.go
```

### CLI

```bash
cd cli/
npm run build
acr --help
```

## API Documentation
Each Worker exposes OpenAPI docs at runtime:
- `/doc` — OpenAPI JSON spec
- `/ui` — Swagger UI

Dev base URLs: Cypher Executor → `http://localhost:8788`
