# Set up the monorepo

> Clone the Azmara Platform repository, build every package and run the docs site locally. For contributors; to use @azmr/ui in your own app, see Installation.

Source: https://platform.azmara.io/docs/guide/monorepo-setup

This page is for working on the packages themselves. To use `@azmr/ui` in an app, follow [Installation](https://platform.azmara.io/docs/guide/installation.md) instead.

## Prerequisites

- Node.js >= 20.0.0
- pnpm >= 9.0.0
- **For `@azmr/ai`**: Visual Studio 2022 with "Desktop development with C++" workload

## Clone & install

```bash
git clone https://github.com/azmara-labs/platform.git
cd platform
pnpm install
```

## Environment setup

```bash
cp .env.example .env
```

Fill in the required values:

```bash
# Generate an encryption key
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
```

## Build all packages

```bash
pnpm build
```

## Try the playground

```bash
pnpm --filter @azmr/site dev
```

Then open `/playground` — a live, interactive demo of `@azmr/core`, `@azmr/query`, and `@azmr/ui`
working together, no separate app to run. See the [Playground](https://platform.azmara.io/docs/guide/playground.md) guide for
what it demonstrates.

## Native module note

`@azmr/ai` uses `isolated-vm` which requires native compilation.

**Windows:**

1. Install **Visual Studio 2022** with "Desktop development with C++" workload
2. Run `pnpm rebuild isolated-vm`

**macOS:** Xcode Command Line Tools (`xcode-select --install`)

**Linux:** `sudo apt install build-essential python3`
