Full-Stack Cloud Platform Demo

Deploy · Pay · Monitor · Scale

Stripe subscription billing · Docker resource monitoring · Automated email alerts · Live auto-scaling — all built today.

● Stripe Payments ● Resource Monitor ● Auto-Scaling ● Email Alerts
nevtan-cloud — live logs
12:30:00 [DEPLOY] Cloning github.com/nic-afterdark/demo-app...
12:30:02 [BUILD] npm install (47 packages)...
12:30:09 [DOCKER] Building image... Done (18.3s)
12:30:27 [DEPLOY] Container started on port 3000 ✓
12:30:28 [NGINX] Routing demo-app.nevtan.app → :3000
12:30:29 [EMAIL] "Deployment Successful" sent to user ✓
12:31:00 [MONITOR] Poll #1 — CPU 12.4% | Mem 38.0%

Stripe Subscription Billing

Per-project subscriptions · Checkout sessions · Invoice history · Webhook handling

1
Choose Plan
2
Stripe Checkout
3
Webhook Fires
4
Project Active

Invoice History

DescriptionAmountStatusDate
Loading invoices...
📈

Live Resource Monitoring

Polling every 60s · Prometheus gauges · MongoDB snapshots · Alert thresholds at 70 / 90 / 100%

CPU Usage
of plan allocation
Memory Usage
Network In
cumulative received
Network Out
cumulative sent
📐
Prometheus Gauges

7 gauges registered per container: container_cpu_raw_percent, container_cpu_plan_percent, container_memory_percent, container_network_in_bytes, container_network_out_bytes, container_block_read_bytes, container_block_write_bytes

📊
MongoDB Snapshots

Every poll tick saves a ContainerMetricSnapshot document with a 7-day TTL index — powers the REST metrics API and historical graphs.

Automatic Plan Upgrade

Memory hits 80% → Stripe billing updated → Docker limits raised → Email sent · 24-hour cooldown

📈
Memory ≥ 80%
ResourceMonitorService detects threshold in its 60s polling loop
Guard Checks
autoScaling=true + autoPayEnabled=true + stripeItemId present + 24hr cooldown clear
Stripe Upgrade
SubscriptionItem.update() with new priceId + CREATE_PRORATIONS billing behaviour
🐨
Docker Update
docker update --memory 2g --cpus 4 <container> — live, no restart needed
💌
Email Sent
"Plan Auto-Upgraded" email with old/new plan, price diff, and memory % at upgrade time

Automated Email Notifications

HTML emails triggered by deployments, resource thresholds, plan upgrades, and invitations

🔗

Stripe Webhook Processing

HMAC-SHA256 signature verification · JSON parsing · DB sync · Container lifecycle

How it works

// StripeService.java — handleWebhook()
event = Webhook.constructEvent(payload, sigHeader, webhookSecret);

switch (event.getType()) {
  case "checkout.session.completed" → {
    // activate project subscription in DB
    project.setStripeSubscriptionId(subscriptionId);
    project.setSubscriptionStatus("active");
    project.setStripeItemId(sub.getItems().get(0).getId());
    projectRepository.save(project);
  }
  case "customer.subscription.deleted" → {
    // cancel sub, clear DB fields, stop container
    project.setSubscriptionStatus("canceled");
    deploymentService.stopProjectContainer(project.getId(), userId);
  }
}