Command Sovereignty
Command Sovereignty
B2B revenue forecasting SaaS for home improvement companies.
Stack
- Backend: Flask + SQLAlchemy + SQLite
- Frontend: React + Vite + TypeScript
- Port: 5003
- Service:
systemctl --user command-sovereignty.service(Gunicorn) - Domain: builtdomains.com via Cloudflare Tunnel
Status
Active — Live on buildomains.com, Phase 4 complete (pagination, detail pages).
Key Files
| What | Path | Notes |
|---|---|---|
| SQLite DB | instance/auth.db |
NOT auth.db at root |
| Env config | ~/.config/command-sovereignty/env |
DATABASE_URL pinned |
| Backups | backups/auth_YYYYMMDD_HHMMSS.db.gz |
Cron every 6h |
| Venv | .venv/ |
Python 3.11, Flask + SQLAlchemy |
| Frontend | frontend/ |
Vite 8 / React / TypeScript |
| Logs | logs/app.log |
Rotating file logger |
Database Rules
- NEVER run
db.create_all()without verifyinginstance/auth.dbhas data - NEVER run
db.drop_all()— no migration system to recover - Check:
sqlite3 instance/auth.db "SELECT count(*) FROM profiles;" - Auth model:
Usertable =profilesin SQLite
Common Pitfalls
- Two DB files trap: Old
auth.dbat project root was deleted July 2026 - SESSION_COOKIE_SECURE=true — cookies only work on HTTPS via Cloudflare
- Vite build quirk: Use
node node_modules/vite/bin/vite.js buildinstead ofnpx vite build - Login is cookie-based (Flask-Login sessions), NOT JWT tokens
- SyncLog bug — unfixed
Service Commands
systemctl --user restart command-sovereignty.service
tail -50 logs/app.log
bash scripts/backup_db.sh