# Axiom Zero Dev Control Center - Setup & Quickstart Guide

This document outlines the prerequisites, installation instructions, configuration, and execution procedures for the Axiom Zero Bot Detection Dev Control Center.

---

## 1. Prerequisites

Before installing the Dev Control Center, ensure your system meets the following software requirements:

* **Python**: Python 3.10 or higher (`python3 --version`)
* **Package Manager**: `pip` (Python package installer)
* **GTK3 Development Libraries**: `libgirepository1.0-dev`, `gir1.2-gtk-3.0`, `libcairo2-dev`, `pkg-config` (required for `PyGObject` / GTK3 UI execution)
  - Ubuntu/Debian installation:
    ```bash
    sudo apt update
    sudo apt install -y python3-dev libgirepository1.0-dev gir1.2-gtk-3.0 libcairo2-dev
    ```

---

## 2. Installation Steps

1. **Install Python Dependencies**:
   Install all required dependencies using `requirements.txt`:
   ```bash
   pip install -r requirements.txt
   ```
   *(Or for user-level installation on systems enforcing PEP 668: `pip install --user --break-system-packages -r requirements.txt`)*

2. **Install Playwright Browsers**:
   Install the Chromium browser binaries needed for the red team automation suite:
   ```bash
   playwright install chromium
   ```

3. **Install Package (Optional)**:
   You can install the package in editable mode to expose executable commands:
   ```bash
   pip install -e .
   ```

---

## 3. Environment Variables & Secret Configuration

### Environment Variables
The Dev Control Center relies on the following environment variables for security and authorization:

* `AXIOM_MASTER_KEY`: Master license key for authentication (e.g., `key_c1234567`).
* `AXIOM_SECRET_SALT`: Hex-encoded 32-byte secret salt used for HMAC credential hashing.

To set them in your active session or `.env` file:
```bash
export AXIOM_MASTER_KEY="your_master_key_here"
export AXIOM_SECRET_SALT="$(python3 -c 'import os; print(os.urandom(32).hex())')"
```

### Generating `.axiom_secret` Manually
The system automatically creates or loads `dev_control_center/.axiom_secret` on startup if it does not exist. 

To pre-generate or customize `.axiom_secret` manually, create a JSON file at `dev_control_center/.axiom_secret` with the following structure:

```json
{
  "secret_salt": "<64-character hex string>",
  "master_key": "<your_master_key>"
}
```

Example command to generate `.axiom_secret`:
```bash
python3 -c "import json, os; print(json.dumps({'secret_salt': os.urandom(32).hex(), 'master_key': 'key_c1234567'}, indent=2))" > dev_control_center/.axiom_secret
```

---

## 4. How to Run

### Step 1: Start the Axiom Daemon
Start the daemon first to initialize customer database connections, cryptographic salt handlers, and swarm communication channels:
```bash
# Using installed script entry point:
axiom-daemon

# Or running the python module directly:
python3 -m dev_control_center.axiom_daemon
```

### Step 2: Launch the GTK Dev Control Center Application
Once the daemon is running, launch the GTK3 GUI application to monitor bot detection metrics, run red team tests, and manage clients:
```bash
# Using installed script entry point:
axiom-gtk

# Or running the python module directly:
python3 dev_control_center/axiom_dev_control_gtk.py
```
