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

# Architecture

> System design and component overview

# Architecture

Reincarnatiopedia runs as a monorepo with 7 components deployed on a single dedicated server.

```
reincarnatiopedia/
├── bot/           # Telegram bot + Lighthouse audits
├── consilium/     # AI Council (5-model debate system)
├── mcp-server/    # Infrastructure API (20 tools)
├── wordpress/     # mu-plugins (token system, SEO)
├── frontend/      # Consilium web UI
├── nginx/         # Server configs (wildcard routing)
└── docs/          # Internal documentation
```

## Request Flow

```mermaid theme={null}
graph LR
    User -->|HTTPS| Cloudflare
    Cloudflare -->|Proxy| Nginx
    Nginx -->|*.reincarnatiopedia.com| WordPress
    Nginx -->|internal| Consilium
    Nginx -->|internal| MCP[MCP Server]
    WordPress -->|Cache| Redis
    WordPress -->|Data| MariaDB
    Consilium -->|Debate| LLMs[5 AI Models]
```

## Components

| Component           | Tech              | Port     | Purpose                          |
| ------------------- | ----------------- | -------- | -------------------------------- |
| WordPress Multisite | PHP 8.4 + Nginx   | 443      | Content platform, 200 subdomains |
| Consilium           | Node.js + Express | internal | Multi-model AI debate system     |
| MCP Server          | Python + FastMCP  | internal | Infrastructure management API    |
| Telegram Bot        | Python            | —        | Monitoring, audits, alerts       |
| Redis               | Redis 8.0         | 6379     | Object cache + token balances    |
| MariaDB             | MariaDB           | 3306     | WordPress + token economy data   |

## Deployment Model

* **Monorepo**: All code in one GitHub repository
* **Branch protection**: PRs required, CI checks (ruff, eslint, php lint)
* **Deploy**: Manual `git pull` on server (symlinks to live paths)
* **No containers**: Bare metal for maximum performance on dedicated hardware
