Operations Intelligence Platform for Nomad Internet - Phase 1
The Nomad Command Center is a real-time financial and billing automation system designed to:
- Detect free riders - Lines active without payment
- Block unauthorized credits - >$500 requires approval
- Auto-suspend overdue accounts - >3 days overdue
- Provide same-day revenue visibility - No manual KPIs
├── backend/ # FastAPI Python backend
│ ├── api/routes/ # REST API endpoints
│ ├── models/ # SQLAlchemy database models
│ ├── services/ # External API clients (Chargebee, Stripe, ThingSpace)
│ └── jobs/ # Background jobs (scanner, watchdog, alerts)
│
├── frontend/ # Next.js React frontend
│ ├── app/ # Pages (dashboard, billing, credits, etc.)
│ ├── components/ # Reusable UI components
│ └── lib/ # API client and utilities
│
└── docker-compose.yml # Local development setup
- Docker and Docker Compose
- Node.js 20+ (for frontend development)
- Python 3.11+ (for backend development)
- Clone and setup environment:
cp .env.example .env
# Edit .env with your API credentials- Start all services:
docker-compose up -d- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Backend:
cd backend
pip install -r requirements.txt
uvicorn main:app --reloadFrontend:
cd frontend
npm install
npm run devGET /api/revenue/daily- Yesterday's revenueGET /api/revenue/monthly- MRR and subscription metricsGET /api/revenue/trend?days=7- Revenue trendGET /api/revenue/summary- Dashboard summary
GET /api/billing/overdue- Overdue invoicesGET /api/billing/free-riders- Free rider listGET /api/billing/health- Billing health metricsPOST /api/billing/suspend/{customer_id}- Suspend line
POST /api/credits/request- Create credit requestPUT /api/credits/{id}/approve- Approve creditPUT /api/credits/{id}/reject- Reject creditGET /api/credits/pending- Pending approvalsGET /api/credits/analytics/summary- Credit analytics
GET /api/alerts/active- Active alertsGET /api/alerts/critical- Critical alerts onlyPUT /api/alerts/{id}/acknowledge- Acknowledge alertPUT /api/alerts/{id}/resolve- Resolve alert
GET /api/customers- List customersGET /api/customers/{id}- Customer detailPOST /api/customers/sync- Sync from Chargebee
| Job | Frequency | Description |
|---|---|---|
| Free Rider Scanner | Hourly | Detects unpaid active lines |
| Suspension Watchdog | Hourly | Auto-suspends overdue accounts |
| Alert Engine | 15 minutes | Checks alert conditions |
| Amount | Required Approval |
|---|---|
| < $50 | Agent |
| $50 - $199 | Supervisor |
| $200 - $499 | Manager |
| >= $500 | Director |
- Install Fly CLI:
curl -L https://fly.io/install.sh | sh
fly auth login- Create app and database:
fly launch --name nomad-command-center --region den
fly postgres create --name nomad-db --region den
fly postgres attach nomad-db- Set secrets:
fly secrets set \
CHARGEBEE_API_KEY="your_key" \
STRIPE_SECRET_KEY="your_key" \
THINGSPACE_USERNAME="your_username" \
THINGSPACE_PASSWORD="your_password" \
SLACK_WEBHOOK_URL="your_webhook" \
SECRET_KEY="your_secret"- Deploy:
fly deploy| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
REDIS_URL |
Redis connection string | No |
CHARGEBEE_API_KEY |
Chargebee API key | Yes |
CHARGEBEE_SITE |
Chargebee site name | Yes |
STRIPE_SECRET_KEY |
Stripe secret key | Yes |
THINGSPACE_USERNAME |
Verizon ThingSpace username | Yes |
THINGSPACE_PASSWORD |
Verizon ThingSpace password | Yes |
SLACK_WEBHOOK_URL |
Slack webhook for alerts | No |
SECRET_KEY |
Application secret key | Yes |
- Financial Command Center (Revenue Dashboard)
- Free Rider Detection & Reporting
- Auto-Suspension for Overdue Accounts
- Credit Approval Workflow
- Alert System with Slack Integration
- Customer Management Interface
- Backend: Python, FastAPI, SQLAlchemy, APScheduler
- Frontend: Next.js 14, React, Tailwind CSS, Recharts
- Database: PostgreSQL
- Cache: Redis (optional)
- Deployment: Docker, Fly.io
Proprietary - Nomad Internet