# {{ lab_name | replace("_", " ") | title }}

{{ lab_description }}

Generated by MADSci template: `lab/distributed` v{{ template_version }}

## Overview

This is a distributed MADSci lab designed for multi-host deployments where
managers and nodes may run on different machines.

### Architecture

```
Host 1 (Manager Server):
  - All MADSci managers (ports 8000-8006)
  - PostgreSQL, MongoDB, Redis

Host 2+ (Node Hosts):
  - Instrument nodes
  - Connect to managers via network
```

### Services

| Service | Port | Description |
|---------|------|-------------|
| Lab Manager (Squid) | 8000 | Central lab configuration and dashboard |
| Event Manager | 8001 | Distributed event logging and querying |
| Experiment Manager | 8002 | Experiment tracking and management |
| Resource Manager | 8003 | Resource and inventory tracking |
| Data Manager | 8004 | Data capture and storage |
| Workcell Manager | 8005 | Workflow coordination and scheduling |
| Location Manager | 8006 | Location and spatial management |

## Quick Start

### On the Manager Host

```bash
# Start manager services
docker compose up -d
```

### On Node Hosts

```bash
# Start node services (point to manager host)
MANAGER_HOST=<manager-ip> docker compose -f compose.nodes.yaml up -d
```

## Configuration

Default settings live in `settings.yaml` (safe to commit to git).
Secrets and credentials go in `.env` (gitignored).
Environment variables override both files.

Edit `settings.yaml` to customize ports, database names, and other non-secret settings.
Edit `.env` to set:
- `MANAGER_HOST` for distributed deployments
- Database credentials
- Other secrets and environment-specific overrides

## Documentation

For more information, see the [MADSci documentation](https://ad-sdl.github.io/MADSci/).
