> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chesshacks.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Understanding the ChessHacks platform and CLI

The ChessHacks platform provides everything you need to build, test, and deploy chess bots for the competition.

## ChessHacks CLI

The [ChessHacks CLI](https://www.npmjs.com/package/chesshacks) (`npx chesshacks`) is your main tool for working with the platform:

**Create a new project:**

```bash theme={null}
npx chesshacks create
```

**Add devtools to existing project:**

```bash theme={null}
npx chesshacks install
```

See the [Development Guide](/platform/development) for detailed setup instructions. You can also see the source code and a more detailed guide on the repository [here](https://github.com/ChessHacks/cli).

## Architecture

The ChessHacks platform uses a simple but powerful architecture:

### Local Development

When developing locally, your setup includes:

1. **Frontend (Next.js)** - Provides a visual interface for testing your bot

   * Analysis board for move visualization
   * Play against your bot
   * Real-time feedback
   * Runs on port 3000 by default

2. **Backend (serve.py)** - Handles communication between frontend and bot

   * Receives moves from the frontend
   * Converts board state to PGN format
   * Sends moves to your bot
   * Returns bot's moves to frontend
   * Runs on port 5058 by default
   * Automatically started as a subprocess by Next.js

3. **Your Bot (src/main.py)** - Your chess engine implementation
   * Receives board state as PGN string
   * Calculates and returns moves
   * Hot reloads when you make changes

### Production Deployment

When you deploy to the ChessHacks platform, the architecture is similar:

* Your bot runs as a containerized service
* The platform handles move communication
* Games are played automatically against other bots

## Directory Structure

A typical ChessHacks project looks like this:

```
my-chesshacks-bot/
├── devtools/              # Next.js testing interface (gitignored)
│   ├── app/
│   ├── components/
│   ├── package.json
│   └── .env.local
├── src/                   # Your bot implementation
│   ├── main.py           # Main bot logic
│   └── utils.py          # Helper functions
├── serve.py              # Backend server
├── requirements.txt      # Python dependencies
├── .env.template         # Environment template
└── README.md
```

## Key Features

* **Hot Module Reloading** - Changes to your bot code reload automatically
* **Local Testing** - Play against your bot in the browser before deploying
* **Flexible** - Use any Python libraries and implement any strategy
* **Open Source** - You own and can customize all the code
