# P5G Marvis — Full Setup Guide This document describes the complete architecture and deployment procedure for the **P5G Marvis** sidebar extension that injects custom pages into the Athonet NCM UI. --- ## Deployment Model The target environment for this project is a host where services are started by `systemd`, including Docker-backed services. Marvis is intended to run the same way: - the FastAPI app runs in a container with host networking on `127.0.0.1:8100` - Traefik exposes it at `/core/marvis/*` - `patch-ncm.py` injects the sidebar entries and iframe routes into the NCM UI - the injected entries should only be added for services that are actually reachable on the host when the patch is applied For a containerised deployment without Compose, this repo includes an example unit file at `config/p5g-marvis.service`. ### Build the image ```bash docker build -t p5g-marvis:latest . ``` ### Install the systemd unit ```bash cp config/p5g-marvis.service /usr/lib/systemd/system/p5g-marvis.service mkdir -p /etc/p5g-marvis cp config/marvis.env.example /etc/p5g-marvis/marvis.env systemctl daemon-reload systemctl enable --now p5g-marvis ``` Marvis will then be reachable on: ```text http://127.0.0.1:8100 http://127.0.0.1:8100/api/docs ``` Edit `/etc/p5g-marvis/marvis.env` per host instead of hardcoding addresses in the unit file. In particular: - set `MARVIS_PROMETHEUS_URL` and `MARVIS_ALERTMANAGER_URL` to the correct host endpoints for that appliance - keep the defaults if Prometheus and Alertmanager are already available on host loopback from the appliance network namespace --- ## Architecture Overview ``` Browser → Traefik (HTTPS :443) ├── /core/marvis/* → strip prefix → http://127.0.0.1:8100 (p5g-marvis FastAPI) └── /core/radio/* → strip prefix → http://127.0.0.1:4000 (rm-ui, if present) NCM UI (React SPA) └── index-Cw8Irsq8.js (patched by patch-ncm.py) ├── Sidebar: P5G Marvis (Insights, Actions, Minis, AI) + P5G Radio ├── Router: /marvis/* and /radio/* →