Skip to content

Aakash0440/PreDeploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PreDeploy

Know if your model breaks before it goes live.

Built on Frameworm + MiroFish. Friendly SaaS — Stripe payments, Payoneer payouts, full PDF reports.


What's included

Frontend (/frontend)

File Purpose
index.html Landing page with live MiroFish swarm demo
signin.html Sign in page
signup.html Sign up + plan selection
dashboard.html Main app dashboard
simulate.html Run a simulation + see results
reports.html All simulation reports
account.html Profile, billing, alerts
pricing.html Pricing page
success.html Post-payment confirmation
css/style.css Full design system
js/main.js Auth, API calls, swarm engine

Backend (/backend)

File Purpose
main.py FastAPI app entry point
database.py SQLite setup — users, models, simulations, payments
config.py All environment variables
routes/auth.py Register, login, JWT tokens
routes/models.py CRUD for user models + file upload
routes/simulations.py Run simulations, check status, download reports
routes/payments.py Stripe checkout sessions + billing portal
routes/webhooks.py Stripe webhook handler
services/simulator.py Core Frameworm + MiroFish pipeline
services/pdf_generator.py Professional PDF report generation
services/alerts.py Slack + email notifications

Quick start

1. Set up environment

cd backend
cp .env.example .env
# Edit .env and fill in your keys (see below)

2. Install dependencies

pip install -r requirements.txt

3. Run the server

uvicorn main:app --reload --port 8000

Open http://localhost:8000 — you'll see the landing page.


Configuration

Edit backend/.env:

Required

SECRET_KEY=your-random-string        # Generate: python -c "import secrets; print(secrets.token_hex(32))"
STRIPE_SECRET_KEY=sk_test_...        # From https://dashboard.stripe.com/apikeys
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...      # From Stripe CLI or dashboard
FRONTEND_URL=http://localhost:8000

Stripe setup

  1. Go to https://dashboard.stripe.com/products
  2. Create two products:
    • PreDeploy Pro — $19/mo recurring → copy price ID to STRIPE_PRICE_PRO_MONTHLY
    • PreDeploy Team — $79/mo recurring → copy price ID to STRIPE_PRICE_TEAM_MONTHLY
  3. For webhooks: run stripe listen --forward-to localhost:8000/api/webhooks/stripe during development
  4. Copy the webhook secret to STRIPE_WEBHOOK_SECRET

Optional (alerts)

SMTP_USER=your@gmail.com
SMTP_PASS=your-app-password          # Gmail app password from https://myaccount.google.com/apppasswords
SLACK_WEBHOOK_URL=https://hooks...   # From Slack incoming webhooks app

Stripe → Payoneer (Pakistan)

  1. In Stripe Dashboard → Settings → Payouts → Add bank account
  2. Use your Payoneer USD virtual account routing/account numbers
  3. Set payout schedule to monthly to minimize fees
  4. Net take-home after fees: ~93% of revenue (Stripe 2.9% + Payoneer ~4%)

At $1,332 MRR (month 12 realistic): ≈ Rs 3.4 lakh/month net after fees.


Deploy to production

Frontend → Vercel (free)

cd frontend
npx vercel --prod
# Set FRONTEND_URL in backend .env to your Vercel URL

Backend → Railway (recommended, ~$5/mo)

# In Railway dashboard: New project → Deploy from GitHub
# Add environment variables from .env
# Railway auto-detects Python and runs uvicorn

Or use Render (free tier available):

# render.yaml already configured — connect your GitHub repo

Connecting real Frameworm

In backend/services/simulator.py, replace the mock section with:

from frameworm.agent import FramewormAgent
from frameworm.shift import ShiftMonitor
from frameworm.cost import CostTracker

agent = FramewormAgent(model_path)
results = agent.analyze(swarm_size=swarm_size)
failure_rate = results.failure_rate
drift_score = results.drift_score

Pricing tiers

Plan Price Agents Reports Models
Free $0 1,000 1/month 1
Pro $19/mo 10,000 Unlimited 5
Team $79/mo 100,000 Unlimited 10
One-time $49 10,000 1 report

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors