Current score: 78/100 (as of 2026-05-01)
Live at: https://alphastream-iota.vercel.app Repo: https://github.com/JasonTeixeira/AlphaStream
- ML pipeline: 45 features, zero data leakage, walk-forward validation
- 28 trained models (7 symbols x 4 model types)
- FastAPI with JWT auth + rate limiting (slowapi)
- Supabase signal persistence (write on generate, load on startup)
- Async I/O (run_in_threadpool for all sync operations)
- yfinance retry with exponential backoff
- Server-side API key generation (CSPRNG)
- GDPR export + deletion endpoints
- Backtest in-sample data warning
- Final-fold model selection (no selection bias)
- Docker with pinned deps, Railway config (120s healthcheck)
- Real Supabase Auth (signup, login, password reset)
- TypeScript strict mode (0 errors, ignoreBuildErrors removed)
- Dashboard wired to real API (signals, models, backtester, analytics)
- Honest marketing (no fake testimonials, stats, or inflated claims)
- Consistent pricing (Free/Starter/Pro/Premium)
- OG/Twitter meta tags
- Image optimization enabled
- 34 pages building clean
- 21 tests: features, trainer, predictor, API auth
- 15 passing consistently
- Supabase: 8 tables, RLS policies, auto-profile trigger
- Stripe: 3 products + 3 monthly prices created
- Vercel: frontend deployed, env vars configured
- GitHub: repo at JasonTeixeira/AlphaStream
- Go to https://railway.app/new
- Click "Deploy from GitHub repo" -> select JasonTeixeira/AlphaStream
- Set root directory to
backend - Add env vars:
SUPABASE_URL=https://skppbaparsikzfxvltsz.supabase.coSUPABASE_KEY=<anon key from Supabase dashboard>SUPABASE_JWT_SECRET=<JWT secret from Supabase Settings -> API>
- Railway auto-detects Dockerfile and deploys
- Update Vercel env var
NEXT_PUBLIC_API_URLto the Railway URL
Files to modify:
frontend/app/checkout/page.tsx— replace fake checkout with real Stripe- Create
frontend/app/api/stripe/checkout/route.ts— server action that creates Stripe Checkout Session - Create
backend/alphastream/api/stripe_webhooks.py— webhook handler for:checkout.session.completed→ create subscription in Supabasecustomer.subscription.updated→ update plan in profiles tablecustomer.subscription.deleted→ downgrade to freeinvoice.payment_failed→ send alert email
Stripe Price IDs to use:
- Starter $49/mo:
price_1TS87LEDeyGfkojJQ7nafYU2 - Pro $149/mo:
price_1TS87fEDeyGfkojJ7Srqzrha - Premium $299/mo:
price_1TS887EDeyGfkojJxIXT7RNV
Implementation:
// frontend/app/api/stripe/checkout/route.ts
import Stripe from 'stripe'
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)
export async function POST(req: Request) {
const { priceId, userId } = await req.json()
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
payment_method_types: ['card'],
line_items: [{ price: priceId, quantity: 1 }],
success_url: `${process.env.NEXT_PUBLIC_APP_URL}/dashboard?checkout=success`,
cancel_url: `${process.env.NEXT_PUBLIC_APP_URL}/checkout?canceled=true`,
client_reference_id: userId,
})
return Response.json({ url: session.url })
}Backend:
pip install sentry-sdk[fastapi]# In api/server.py, before app creation:
import sentry_sdk
sentry_sdk.init(dsn=settings.SENTRY_DSN, traces_sample_rate=0.1)Frontend:
npm install @sentry/nextjs
npx @sentry/wizard@latest -i nextjs- In
verify_auth(), after JWT decode, look up user's plan from Supabase profiles - Attach plan to request state:
request.state.plan = profile.plan - In rate limiter, use plan-based limits:
- Free: 50 requests/day
- Starter: 500/day
- Pro: 5000/day
- Premium: 50000/day
- In
/v1/signals, limit symbols by plan:- Free: 2 symbols
- Starter: 5 symbols
- Pro: 25 symbols
- Premium: unlimited
pip install resend # backendEmails to implement:
- Welcome email on signup (triggered by Supabase auth webhook)
- Signal alert email (when high-confidence signal generated)
- Weekly performance digest (cron job, summarizes week's signals)
- Password reset email (already works via Supabase, just needs custom template)
Files to create:
backend/alphastream/email/sender.py— Resend client wrapperbackend/alphastream/email/templates.py— HTML email templates
Implementation:
- Create
backend/alphastream/delivery/discord.py - Use Discord webhook URL (user provides in settings)
- After signal generation in
generator.py, call discord webhook:
import httpx
async def send_discord_signal(webhook_url: str, signal: dict):
embed = {
"title": f"{signal['symbol']} — {signal['direction']}",
"description": f"Confidence: {signal['confidence']}%",
"fields": [
{"name": "Entry", "value": str(signal['entry_price']), "inline": True},
{"name": "Stop Loss", "value": str(signal['stop_loss']), "inline": True},
{"name": "Take Profit", "value": str(signal['take_profit']), "inline": True},
],
"color": 0x10B981 if signal['direction'] == 'LONG' else 0xEF4444,
}
await httpx.AsyncClient().post(webhook_url, json={"embeds": [embed]})- Create
POST /v1/webhooks— register a webhook URL - Create
DELETE /v1/webhooks/{id}— remove webhook - Store in Supabase
webhookstable - After signal generation, POST to all registered webhooks
- Include HMAC signature header for verification
Bring test count to 40+:
- Integration test: train a model, generate signal, verify end-to-end
- API test: authenticated requests with mock JWT
- Backtest test: verify in-sample warning triggers
- GDPR test: verify export and delete endpoints
- Rate limit test: verify 429 after exceeding limit
- Use
pyotplibrary for server-side TOTP POST /v1/account/2fa/setup— generate per-user secret, return QR code URIPOST /v1/account/2fa/verify— validate TOTP code against user's secret- Store encrypted TOTP secret in profiles table
- Frontend: replace hardcoded TOTP secret with API-generated one
- Create
backend/retrain.py— weekly cron script - Fetches latest data, retrains all models, saves new artifacts
- Compares new model performance vs current (A/B shadow mode)
- Only promotes new model if performance >= current
- Can run as Railway cron job or GitHub Actions scheduled workflow
- Track rolling 30-day signal accuracy per model
- Alert when accuracy drops below 48% (worse than random)
- Dashboard page showing model drift over time
- Store daily accuracy snapshots in
model_performancetable
- Add FastAPI WebSocket endpoint:
ws://host/ws/signals - Authenticate via JWT in query param
- Broadcast new signals to connected clients instantly
- Frontend
realtime-context.tsxalready has the interface — just swap polling for WebSocket
npm install posthog-js # frontendTrack events:
signal_viewed— user views a signalbacktest_run— user runs a backtestplan_upgraded— user upgradesapi_key_created— user creates API key- Funnel: Landing → Signup → Dashboard → First Signal → Upgrade
- Add
next-pwapackage - Create
public/manifest.json - Add service worker for offline dashboard skeleton
- Enable push notifications for signal alerts
- Users publish signal streams as "strategies"
- Other users subscribe (70/30 revenue split)
- Leaderboard ranked by Sharpe ratio
- Tables:
strategies,strategy_subscriptions,strategy_performance
- Portuguese (Brazil — huge B3 futures market)
- Spanish
- Use
next-intlfor frontend i18n - Jason's trilingual ability is a competitive advantage
- Send signals via NinjaTrader's ATI (Automated Trading Interface)
- Create a .NET bridge that reads from AlphaStream API
- Jason already trades 8 symbols on NT8 — dogfood the integration
- Add orderflow features (if Polygon.io data available)
- Volume profile features
- Cross-asset correlation signals (e.g., bond yields → equity signals)
- Regime detection (trending vs mean-reverting)
- Audit logging for all data access
- Encryption at rest (Supabase handles this)
- Annual penetration testing
- Access control documentation
- Required for enterprise clients ($999/month tier)
| Phase | Score | Paying Users | MRR | Timeline |
|---|---|---|---|---|
| Current | 78 | 0 | $0 | Now |
| Phase 1 (Launchable) | 85 | 10-30 | $1.5K-4.5K | +1 week |
| Phase 2 (Professional) | 90 | 50-100 | $7.5K-15K | +1 month |
| Phase 3 (Enterprise) | 95 | 100-300 | $15K-45K | +3 months |
| Phase 4 (World Class) | 99 | 300-670 | $45K-100K | +6-12 months |
| Service | Cost |
|---|---|
| Supabase (free tier for now, Pro at $25/mo when needed) | $0-25 |
| Railway (backend hosting) | $5-20 |
| Vercel (frontend, Pro if needed) | $0-20 |
| Resend (email, free tier 3K/month) | $0 |
| Sentry (free tier 5K errors/month) | $0 |
| PostHog (free tier 1M events/month) | $0 |
| Polygon.io (if upgrading from yfinance) | $199 |
| Total before Polygon | $5-65 |
| Total with Polygon | $204-264 |
Break-even: 2 Starter subscribers ($98/month > $65 costs)
| What | Where |
|---|---|
| ML feature engineering | backend/alphastream/features/engineering.py |
| Model training | backend/alphastream/models/trainer.py |
| Signal inference | backend/alphastream/models/predictor.py |
| API server | backend/alphastream/api/server.py |
| Data fetcher | backend/alphastream/data/fetcher.py |
| Signal generator | backend/alphastream/signals/generator.py |
| DB schema | backend/schema.sql |
| Auth context | frontend/contexts/auth-context.tsx |
| Realtime context | frontend/contexts/realtime-context.tsx |
| API client | frontend/lib/api.ts |
| Supabase client | frontend/lib/supabase.ts |
| Tests | backend/tests/ |
- ID: skppbaparsikzfxvltsz
- URL: https://skppbaparsikzfxvltsz.supabase.co
- Region: us-east-1
- Tables: profiles, subscriptions, signals, models, api_keys, watchlists, alerts, signal_history
- Starter $49/mo:
prod_UQzg72gSrIVabD/price_1TS87LEDeyGfkojJQ7nafYU2 - Pro $149/mo:
prod_UR01RHosp4tjfe/price_1TS87fEDeyGfkojJ7Srqzrha - Premium $299/mo:
prod_UR02VB36kac0Tx/price_1TS887EDeyGfkojJxIXT7RNV