RealOutcomes Deployment Guide¶
Overview¶
RealOutcomes is deployed on Railway using Docker. This guide covers deploying to Railway and setting up the required services.
Prerequisites¶
- Railway account
- Supabase account (for database, auth, and storage)
- Stripe account
- SendGrid account
- OpenAI API key
- Firecrawl API key
Step 1: Create Supabase Project¶
- Create a new Supabase project at supabase.com
- Note down:
SUPABASE_URL- Project URLSUPABASE_ANON_KEY- Anon/Public keySUPABASE_SERVICE_ROLE_KEY- Service role key-
DATABASE_URL- PostgreSQL connection string (from Database Settings) -
Create a storage bucket named
uploads(or your preferred name) -
Configure Auth providers as needed (email/password, Google, etc.)
Step 2: Create Railway Project¶
- Go to railway.app and create a new project
- Connect your GitHub repository
- Railway will auto-detect the Dockerfile
Step 3: Configure Environment Variables¶
In Railway project settings, add these environment variables:
Required¶
# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
DATABASE_URL=postgresql://postgres:password@db.your-project.supabase.co:5432/postgres
# Client (must match server values)
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
# Session
SESSION_SECRET=your-secure-session-secret-at-least-32-chars
# App
NODE_ENV=production
PUBLIC_URL=https://realoutcomes.app
PORT=5000
# Stripe
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PRO_MONTHLY_PRICE_ID=price_...
STRIPE_PRO_YEARLY_PRICE_ID=price_...
# SendGrid
SENDGRID_API_KEY=SG....
SENDGRID_FROM_EMAIL=hello@realoutcomes.app
# OpenAI
OPENAI_API_KEY=sk-...
# Firecrawl
FIRECRAWL_API_KEY=fc-...
Optional¶
# Storage (if not using default bucket name)
SUPABASE_STORAGE_BUCKET=uploads
# FEC — free key at https://api.open.fec.gov/developers/
FEC_API_KEY=your-fec-api-key
# Last1 certification (hide until JSON API is live)
LAST1_CERT_REGISTRY_URL=false
Step 4: Database Migration¶
Run migrations against the Supabase Real Outcomes project (cpocwrygxlqhzvmlrpjv):
Verified-source tables (org_data_provenance, schedule_i_grants, federal_awards, etc.) are in
supabase/migrations/20260611120000_verified_sources.sql. Production also requires hub tables from
migrations/20260309_fwa_financial_political.sql if not already applied.
Step 4b: Monthly IRS sync (BMF + Auto-Revocation List)¶
Create a second Railway service in the same project (same repo, no public domain):
| Setting | Value |
|---|---|
| Start command | npm run import:monthly-irs |
| Cron schedule | 0 3 1 * * (1st of month, 03:00 UTC) |
| Variables | Same as web app (DATABASE_URL, etc.) |
The script runs BMF import then ARL import (scripts/monthly-irs-sync.ts).
Manual run:
Step 5: Configure Custom Domain¶
- In Railway project settings, add custom domain
realoutcomes.app - Configure DNS:
- CNAME record pointing to Railway's provided hostname
Step 6: Stripe Webhook¶
- In Stripe Dashboard, create a webhook endpoint:
- URL:
https://realoutcomes.app/api/stripe/webhook -
Events to listen for:
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedcheckout.session.completed
-
Copy the webhook signing secret to
STRIPE_WEBHOOK_SECRET
Deployment¶
Railway auto-deploys on push to main branch. To manually deploy:
Monitoring¶
- Railway provides built-in logs and metrics
- Check Railway dashboard for deployment status
- Monitor Supabase dashboard for database performance
Troubleshooting¶
Build Fails¶
- Check that all environment variables are set
- Verify Dockerfile syntax
- Check Railway build logs
Auth Issues¶
- Verify Supabase URL and keys are correct
- Check that Supabase Auth is properly configured
- Ensure
VITE_*variables match server values
Database Connection Issues¶
- Verify
DATABASE_URLformat - Check that the database exists
- Run migrations if needed
Storage Issues¶
- Verify storage bucket exists in Supabase
- Check service role key permissions
- Verify bucket policies
Entity Information¶
RealOutcomes is operated by Last 1 Enterprises, LLC.
For support: support@realoutcomes.app