> For the complete documentation index, see [llms.txt](https://harena.gitbook.io/harena-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harena.gitbook.io/harena-docs/architecture/local-development.md).

# Local Development

Harena runs through Docker Compose.

## Requirements

* Docker with Compose v2
* An EVM browser wallet for sign-in testing
* Optional Binance Futures Demo credentials
* Optional OpenAI-compatible LLM provider credentials

## Start the stack

```bash
cp .env.example .env
docker compose up --build
make bootstrap-demo
```

Open `http://localhost:8080`. The Django API is also available on port `8000`, and the Next.js development server on port `3000`. Demo data is deliberately bootstrapped separately so a production restart cannot create test users or arenas.

Without validated exchange credentials, Harena still consumes public Futures prices and uses the local fill simulator.

## Validation

```bash
make backend-test
make frontend-build
docker compose config --quiet
```

## Validate Futures Demo access

```bash
docker compose exec api python manage.py check_futures --symbol QQQUSDT
docker compose exec api python manage.py check_futures \
  --symbol QQQUSDT --signed --test-order --notional 10
```

The second command uses Binance's non-executing test-order endpoint. Enable private demo execution only after the signed check succeeds.

## Publish these docs without GitHub

```bash
cp .env.gitbook.example .env.gitbook
# Add a GitBook token. Organization ID is auto-detected when there is one.
make gitbook-bootstrap
make gitbook-doctor
make gitbook-sync
```

The bootstrap command saves the generated Space and Site IDs into the ignored `.env.gitbook` file.

Use `make gitbook-package` to create a ZIP for manual GitBook import.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://harena.gitbook.io/harena-docs/architecture/local-development.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
