---
created: 2026-03-14
tags: [infrastructure, cost-savings, fly-io, shutdown, operations]
related: ["[[Email-Deliverability-Fix]]"]
---

# Kill Fly.io Plan -- Shut Down the Legacy Flask App

**Status:** Ready to Execute
**Owner:** Michael / CC VPS
**Priority:** HIGH -- $189/month savings, zero revenue contribution
**Risk:** LOW -- domain already migrated, app is legacy dead weight

---

## 1. What Is the Fly.io App?

| Property | Detail |
|----------|--------|
| **App name** | `rateright-au` |
| **URL** | https://rateright-au.fly.dev |
| **Custom domain** | Was rateright.com.au (migrated away Feb 23, 2026) |
| **Stack** | Python Flask + Gunicorn + PostgreSQL |
| **Hosting** | Fly.io, Sydney (syd) region |
| **Current cost** | **$189/month ($2,268/year)** |
| **Config** | `min_machines_running = 1`, `auto_stop_machines = false` (always-on) |
| **Deployment** | GitHub Actions on push to `main` (`.github/workflows/fly-deploy.yml`) |
| **Local source** | `C:\Users\mclou\RateRight-Dev\` |

### What the App Does (Did)

RateRight v1 -- a full-stack Flask construction marketplace app with:

- **User auth** (Flask-Login, JWT, registration, login)
- **Job marketplace** (post jobs, browse, apply)
- **Contract management** (digital signatures, PDF generation)
- **Messaging system** (Flask-SocketIO)
- **Stripe payments** (webhook at `/api/legal/stripe/webhook`)
- **Notifications** (in-app, email via Resend, SMS via Twilio)
- **Gamification** (leaderboards, achievements, XP)
- **Analytics dashboard**
- **Admin panel**
- **Cloudinary** image uploads
- **PostgreSQL** database on Fly.io (47 tables)

This was the original RateRight platform before the v2 Next.js rewrite.

---

## 2. Current State -- Why It Can Be Killed

### Domain Already Migrated

As of **Feb 23, 2026**, `rateright.com.au` points to the **VPS (DigitalOcean)** running the Next.js v2 app on port 3000. The Fly.io app is no longer serving public traffic through the custom domain.

Evidence:
- Infrastructure report (2026-03-12): "rateright.com.au" listed as VPS nginx -> port 3000
- The Flask app on Fly.io is listed as "LEGACY (may consolidate)"
- Harper (Finance agent) flagged Fly.io as "potential savings if we can migrate to DigitalOcean" on Feb 20

### v2 Replacement Is Live

The Next.js v2 app ("The $50 App") handles all the functions v1 did:
- Supabase Auth replaces Flask-Login
- Supabase PostgreSQL replaces Fly.io Postgres
- Stripe is integrated in v2 (webhook at `/api/webhooks/stripe` on VPS)
- The domain, SSL, and all DNS are already on the VPS

### Nothing Currently Depends on It

| Potential Dependency | Status |
|---------------------|--------|
| **rateright.com.au domain** | Points to VPS, NOT Fly.io |
| **Stripe webhooks** | Configured for `rivet.rateright.com.au` / `rateright.com.au` on VPS |
| **Email (Resend)** | Operates independently of hosting provider |
| **Twilio SMS** | Operates independently of hosting provider |
| **Slack webhooks** | Environment variables, not hardcoded to Fly.io URL |
| **GitHub Actions deploy** | Will fail silently (good -- stops accidental deploys) |
| **Test/smoke scripts** | ~30+ scripts in `ROOT_INVESTIGATION_ARCHIVE_20250910_211213/` reference `rateright-au.fly.dev` but these are archived diagnostic scripts, not production dependencies |
| **Active smoke tests** | `scripts/` directory has 4 scripts pointing to `rateright-au.fly.dev` -- these will need updating or deleting |
| **Growth Engine** | No references to Fly.io found |
| **RateRight-HQ vault** | No references to Fly.io found |
| **Agent fleet** | References are informational only (TOOLS.md, SYSTEM-BASELINE.md) |

---

## 3. Annual Savings Calculation

### Current Fly.io Cost: $189/month

Based on Harper's financial records (confirmed Feb 20, 2026):

| Component | Est. Monthly Cost |
|-----------|------------------|
| Fly Machine (shared-cpu, always-on, syd region) | ~$7-15 |
| Fly Managed PostgreSQL (or attached Postgres) | ~$38-150 |
| Dedicated IPv4 address | $2 |
| Storage (volumes) | ~$5-15 |
| Bandwidth | ~$5-15 |
| **Total (Harper-reported)** | **$189/month** |

### Projected Savings

| Period | Savings |
|--------|---------|
| Monthly | $189 |
| Quarterly | $567 |
| Annual | **$2,268** |

### Impact on Burn Rate

| Metric | Before | After |
|--------|--------|-------|
| Monthly burn | ~$700-800 | ~$511-611 |
| Runway (from ~$24,408) | ~31-35 months | ~40-48 months |
| Breakeven hires needed | 15/month | **11/month** |

Killing Fly.io reduces breakeven from 15 hires/month to approximately 11 hires/month -- a meaningful improvement for a pre-revenue startup.

---

## 4. Pre-Shutdown Checklist

Complete these BEFORE destroying the app:

### 4.1 Verify Domain Is Not Pointing to Fly.io

```bash
# From any machine:
nslookup rateright.com.au
# Should resolve to 134.199.153.159 (DigitalOcean VPS), NOT Fly.io IPs

# Also check:
curl -I https://rateright.com.au
# Should show the Next.js app, not Flask
```

### 4.2 Export Database (If Any Data Worth Keeping)

The Fly.io Postgres has 47 tables. Most data is test/dev data from the v1 era, but verify:

```bash
# SSH into Fly.io app
fly ssh console -a rateright-au

# Inside the container, check for real user data:
python -c "
from app import create_app
from app.extensions import db
app = create_app()
with app.app_context():
    result = db.engine.execute('SELECT COUNT(*) FROM users')
    print(f'Users: {result.fetchone()[0]}')
"
```

If there are real users/data, dump the database first:

```bash
# From local machine with flyctl:
fly proxy 15432:5432 -a rateright-au-db
# Then in another terminal:
pg_dump -h localhost -p 15432 -U rateright -d rateright > rateright-v1-final-dump.sql
```

### 4.3 Grab Fly.io Secrets (For Reference)

```bash
fly secrets list -a rateright-au
# Document what was set (not the values themselves) in case any keys
# need to be rotated or cancelled
```

### 4.4 Check for Any Fly.io Postgres Separate App

```bash
fly apps list
# Look for any "rateright-au-db" or similar Postgres app
# These also cost money and need to be destroyed separately
```

### 4.5 Disable GitHub Actions Deploy

Before destroying, disable the CI/CD pipeline so it doesn't error on every push:

Option A: Delete the workflow file:
```bash
# In the RateRight-Dev repo:
rm .github/workflows/fly-deploy.yml
git add -A && git commit -m "chore: remove Fly.io deploy workflow (app decommissioned)"
git push
```

Option B: Remove the `FLY_API_TOKEN` secret from GitHub repo settings.

---

## 5. Shutdown Steps

### Step 1: Scale Down (Optional Safety Step)

If you want to stop billing immediately but keep the option to reverse:

```bash
fly scale count 0 -a rateright-au
```

This stops all machines (and billing for compute) but keeps the app definition.

### Step 2: Destroy the App (Permanent)

```bash
fly apps destroy rateright-au
```

This permanently deletes:
- All Fly Machines
- All Fly Volumes (and volume snapshots)
- All IP addresses
- All secrets
- All Docker images
- The app definition itself

**There is no undo.** Ensure the database dump (step 4.2) is saved if needed.

### Step 3: Destroy Postgres App (If Separate)

If Fly.io Postgres was provisioned as a separate app:

```bash
fly apps destroy rateright-au-db
```

### Step 4: Clean Up DNS (If Any Fly.io Records Remain)

Log into GoDaddy DNS and remove any records pointing to Fly.io:
- Delete any CNAME pointing to `rateright-au.fly.dev`
- Delete any A/AAAA records with Fly.io IP addresses
- Verify only VPS records remain (134.199.153.159)

### Step 5: Update Documentation

Files that reference Fly.io and should be updated:

**Agent fleet docs (informational -- update to remove stale references):**
- `rateright-growth-deploy/rivet/TOOLS.md` (line 106)
- `rateright-growth-deploy/memory/plans/quick-reference-guide-2026-02-12.md` (line 36)
- `rateright-growth-deploy/vault/09-Agent-Archive/Shared/SYSTEM-BASELINE.md` (line 183)
- `rateright-growth-deploy/infrastructure-report.md` (line 18, 82-86)

**Active test scripts to delete or update:**
- `RateRight-Dev/scripts/fly_smoke_test.py`
- `RateRight-Dev/scripts/comprehensive_smoke_test.py`
- `RateRight-Dev/scripts/production_smoke_test.py`
- `RateRight-Dev/scripts/test_payouts_fix.py`
- `RateRight-Dev/scripts/verify_production_database.py`

**Harper's financial docs (update burn rate):**
- `rateright-growth-deploy/harper/MEMORY.md` (burn rate line)
- `rateright-growth-deploy/harper/TOOLS.md` (burn rate line)

### Step 6: Revoke/Rotate Keys

After shutdown, consider rotating these if they were set as Fly.io secrets:
- `SECRET_KEY` (Flask session key)
- `DATABASE_URL` (Postgres connection string)
- `STRIPE_SECRET_KEY` / `STRIPE_WEBHOOK_SECRET` (if v1 had its own Stripe keys)
- `RESEND_API_KEY`
- `TWILIO_AUTH_TOKEN`
- `CLOUDINARY_API_SECRET`
- `FLY_API_TOKEN` (in GitHub repo secrets)

---

## 6. Post-Shutdown Verification

```bash
# Confirm app is gone:
fly apps list
# rateright-au should NOT appear

# Confirm rateright.com.au still works:
curl -I https://rateright.com.au
# Should return 200 from the Next.js app

# Confirm rateright-au.fly.dev is dead:
curl -I https://rateright-au.fly.dev
# Should return error/404
```

---

## 7. Risk Assessment

| Risk | Likelihood | Impact | Mitigation |
|------|-----------|--------|------------|
| rateright.com.au goes down | **Very Low** | High | Domain already points to VPS. Verify DNS before destroying. |
| Lose important user data | **Low** | Medium | Dump database first. Most data is test data from 2025. |
| Break Stripe payments | **Very Low** | High | Stripe webhooks already point to VPS, not Fly.io. |
| Break email sending | **None** | N/A | Resend is independent of hosting. |
| Accidental CI/CD deploy errors | **Medium** | Low | Remove workflow file or GitHub secret first. |
| Need to roll back | **Very Low** | Medium | Source code is in `C:\Users\mclou\RateRight-Dev\`. Can redeploy to any platform. |

**Overall risk: LOW.** The domain migration was the hard part, and that's already done.

---

## 8. Summary

| Item | Detail |
|------|--------|
| **Action** | Destroy Fly.io app `rateright-au` and associated Postgres |
| **Savings** | $189/month = $2,268/year |
| **Risk** | Low -- domain already migrated, v2 is live |
| **Dependencies** | None active. All references are informational or archived. |
| **Time to execute** | ~30 minutes (including verification) |
| **Recommendation** | **Execute immediately.** This is dead cost on a legacy app with zero traffic. |

---

*Sources: Local filesystem analysis of `C:\Users\mclou\RateRight-Dev\` and `C:\Users\mclou\rateright-growth-deploy\`. Cost data from Harper's financial records (Feb 20, 2026). Fly.io pricing from [Fly.io Pricing](https://fly.io/pricing/) and [Fly.io Resource Pricing](https://fly.io/docs/about/pricing/). Shutdown procedure from [Fly.io Delete App Docs](https://fly.io/docs/apps/delete/).*
