# App Integration Guide — HNF Stack This document is the reference for porting existing apps into the HNF Proxmox stack. Each app gets its own porting session — read this first before starting any port. --- ## Multi-Site Design Principle This stack is designed to deploy identically across multiple hotel Proxmox hosts. The internal container network (`10.10.10.0/24`) is the same at every site — it is isolated inside each Proxmox host and has no conflict with the hotel's own LAN subnet. **All docker-compose files, DATABASE_URLs, and internal service references use `10.10.10.x` addresses and are therefore identical across all sites.** Only these values differ per site, set via env vars at provision time: | Env var | Example (HNF) | Notes | |---------|--------------|-------| | `DOMAIN` | `manage.hotelnumberfour.com` | Per-site domain for NPM + auth cookie | | `OFFICE_PUBLIC_IP` | `x.x.x.x` | Site WAN IP for offsite access restriction | | `LAN_SUBNET` | `10.4.0.0/22` | Used when assigning NPM LXC's LAN IP | **Forgejo deploy webhooks**: each hotel's management container registers its own webhook in the shared Forgejo repo. A push to `main` fires to all registered hotels simultaneously — all sites update in parallel. To stage a rollout, temporarily disable a site's webhook. --- ## Stack Overview ``` Hotel LAN (any subnet — e.g. 10.4.0.0/22 at HNF, 192.168.x.x elsewhere) │ └── LXC: NPM ← only container with a LAN IP │ — single SSL cert │ └── Internal network (vmbr1: 10.10.10.0/24) — SAME at every site ├── 10.10.10.100 PostgreSQL :5432 (internal only) ├── 10.10.10.101 Auth service :3001 ├── 10.10.10.102 Portal :3000 ├── 10.10.10.105 Management :3002 (Uptime Kuma → /monitor/) │ :9000 (Forgejo webhook, internal only) ├── 10.10.10.110 Kitchen Flash :3080 ├── 10.10.10.114 Housekeeping :3014 └── 10.10.10.1xx (future apps — same IPs at all sites) ``` **NPM LXC** is the only container with a LAN IP. All others are on the internal `vmbr1` bridge — invisible from the hotel LAN. NPM proxies paths to internal LXC IPs. **External Forgejo** (on developer's own server) is the source of truth for all app repos. The management container's update service receives webhooks from it and deploys to app LXCs. - All apps share a single PostgreSQL instance (LXC .100) — each app gets its own database. - Auth is enforced on each app independently via a shared httpOnly cookie (`hnf_session`). - The portal shell loads app UIs in `