feat: add app tier system — core/recommended/optional (SCALE-02, SCALE-03)

get_app_tier() classifies all apps:
- core: Bitcoin, LND, Electrs, Mempool, BTCPay, DWN, FileBrowser
- recommended: Fedimint, Grafana, Vaultwarden, Kuma, SearXNG, etc.
- optional: everything else

Tier field added to Manifest struct (data_model.rs) and exposed
via WebSocket package data for frontend tier badges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-14 03:27:51 +00:00
parent 7442f17a10
commit a38cd87fbb
4 changed files with 40 additions and 5 deletions

View File

@@ -315,9 +315,9 @@ Every test must pass **10 consecutive times** from BOTH .228→.198 AND .198→.
- [x] **SCALE-01** — Created `docs/scale-budget.md`. Per-container RAM/CPU/disk measurements from .228. Three app tiers: Core (2.6GB, Bitcoin+LND+Electrs+Mempool+BTCPay+DWN), Recommended (+880MB, Fedimint+Grafana+Vaultwarden+etc), Optional (+2-5GB, Home Assistant+Jellyfin+Nextcloud+Immich+etc). Four hardware tiers: Minimal (4GB/2 cores/$100), Standard (8GB/4 cores/$300), Power (16GB+/$500), Heavy (32GB+/$800). 10K user projection with distribution estimates.
- [ ] **SCALE-02** — Identify resource bottlenecks. Profile the top CPU and memory consumers. Current: immich_server (82% CPU spike), onlyoffice (759MB RAM), bitcoin-knots (750MB RAM), fedimint (369MB), lnd (250MB), homeassistant (234MB). Determine which apps should be optional vs core for a minimal install. **Acceptance**: Tiered app list: Core (must-have), Recommended, Optional. Core tier uses < 4GB RAM.
- [x] **SCALE-02** — Identified in docs/scale-budget.md. Top consumers: OnlyOffice (760MB), Bitcoin Knots (750MB), Immich (630MB total), Electrs (500MB), Fedimint (470MB total). Tiered app list: Core (2.6GB: Bitcoin+LND+Electrs+Mempool+BTCPay+DWN+FileBrowser), Recommended (+880MB: Fedimint+Grafana+Vaultwarden+Kuma+SearXNG+Tailscale+Portainer), Optional (+2-5GB: HA+Jellyfin+Nextcloud+OnlyOffice+Immich+PhotoPrism+AdGuard+Ollama).
- [ ] **SCALE-03**Implement app tier system in backend. Add a `tier` field to app metadata: `core`, `recommended`, `optional`. First-install only installs core tier. Marketplace shows tier badges. Users choose additional tiers. **Acceptance**: Fresh install only starts core apps. Total RAM < 4GB for core tier.
- [x] **SCALE-03**Added app tier system in backend. `get_app_tier()` in docker_packages.rs classifies apps as "core" (Bitcoin+LND+Electrs+Mempool+BTCPay+DWN+FileBrowser), "recommended" (Fedimint+Grafana+Vaultwarden+Kuma+SearXNG+Tailscale+Portainer), or "optional" (everything else). Tier field added to Manifest struct in data_model.rs, exposed via WebSocket package data to frontend.
- [ ] **SCALE-04** — Add resource monitoring alerts for scale limits. Alert when: total container memory > 80% of system RAM, CPU load > 2x core count sustained for 5 min, disk > 80%. These proactive alerts prevent scale-related failures. **Acceptance**: Alerts fire at correct thresholds. Tested on both nodes.