How lewlew-glitch/qm_companion works
Quartermaster Companion is a self-hosted control panel and setup-transfer service for the Quartermaster phone app. The main workflow is owner sign-in, service discovery and review, then creation of a short-lived encrypted setup transfer; the panel also presents Docker and service status and can optionally manage Docker. Separate capabilities cover webhook alerts and certificate-pinned mobile access. The excerpts show selected routing and authentication calls; other capability links rely on the README and are omitted where implementation wiring is not evidenced.
Main entry points: server.js HTTP routes · intake.js Alert intake · index.js Application entry · auth.js Authentication
Components 25
Web panel
- Application entry
src/index.js - HTTP routes
src/server.js - Authentication
src/auth.js - Login transport
src/auth-plane.js - Encrypted state
src/store.js - Panel views
src/ui/views.js
Service setup
- Service discovery
src/detect.js - Pairing review
src/pair-form.js - Transfer creation
src/build.js
Docker operations
- Docker access
src/docker.js - Compose deployment
src/compose.js - Scheduled jobs
src/cron.js
Mobile access
- Device enrollment
src/mobile/owner-routes.js - Mobile API
src/mobile/routes.js - Mobile state
src/mobile/store.js
Alerts
- Alert settings
src/alerts/routes.js - Alert intake
src/alerts/intake.js - Alert delivery
src/alerts/delivery.js - Alert state
src/alerts/store.js
Other components
- Owner
- Browser
- Quartermaster app
- Service instances
- Docker engine
- Service webhooks
Connections 27
- Owner → Browser: uses
- Browser → Application entry: requests
- Application entry → HTTP routes: dispatches
- HTTP routes → Login transport: handles login
- Login transport → Authentication: authenticates
- Authentication → Encrypted state: reads/writes owner
- HTTP routes → Panel views: renders pages
- HTTP routes → Service discovery: discovers services
- HTTP routes → Pairing review: prepares review
- HTTP routes → Transfer creation: creates transfer
- Pairing review → Service discovery: uses service data
- Transfer creation → Service instances: packages setup details
- HTTP routes → Docker access: loads status / operates
- Docker access → Docker engine: inspects / controls
- HTTP routes → Compose deployment: deploys stacks
- HTTP routes → Scheduled jobs: manages schedules
- Quartermaster app → Service instances: connects directly
- Quartermaster app → Mobile API: optional HTTPS API
- HTTP routes → Device enrollment: routes device actions
- Device enrollment → Mobile state: reads/writes enrollment
- Mobile API → Mobile state: reads mobile state
- Service webhooks → Alert intake: submits events
- HTTP routes → Alert settings: routes alert settings
- Alert settings → Alert state: reads/writes settings
- Alert intake → Alert state: records events
- Alert intake → Alert delivery: dispatches alerts
- Alert delivery → Quartermaster app: sends notifications