🎯 Deployment Status

  • âś“ GitHub repository connected
  • âś“ Custom domain app.socialagent.me mapped
  • âś“ GFAVIP SSO domain whitelisted
  • ⚡ Database setup needed (5 minutes)
  • ⚡ Netlify configuration (5 minutes)
  • 🚀 Deploy & test (5 minutes)

🗄️ 1. Database Setup (Neon Postgres)

Why Neon? Serverless Postgres, free tier (500MB), auto-scales, Netlify-native integration

1

📝 Create Neon Database

  1. Go to neon.tech → Sign up (GitHub login)
  2. Click “Create project”
  3. Project name: socialagentme-prod
  4. Database name: socialagentme
  5. Click “Create project”

2

🔑 Get Connection String

In Neon dashboard → “Connection Details” tab → Copy “Connection string”

postgresql://user:password@ep-cool-123456.us-east-2.aws.neon.tech/socialagentme?sslmode=require

💡 Save this string - you’ll need it for Netlify environment variables

3

🚀 Initialize Tables

Local test first:

# Test connection locally export DATABASE_URL=“your-neon-connection-string” flask db upgrade

This creates: users, teams, avatars, module_types, modules

⚙️ 2. Netlify Configuration

1

🌍 Environment Variables

Netlify Dashboard → Site settings → Environment variables

Variable

Value

Notes

DATABASE_URL

postgresql://...

Your Neon connection string

FLASK_ENV

production

Required for production

SECRET_KEY

your-super-secret-key-123

Generate: python -c "import secrets; print(secrets.token_hex(32))"

XAI_API_KEY

your-xai-key

From x.ai/api

GFAVIP_SERVICE

socialagentme

For SSO integration

2

đź“„ Create netlify.toml

Add this file to your project root:

[build] publish = ”.” functions = “functions” command = “pip install -r requirements.txt && flask db upgrade” [functions] node_bundler = “esbuild” [[redirects]] from = ”/*” to = “/.netlify/functions/api/main/:splat” status = 200 force = true

3

📦 Update requirements.txt

Flask==3.0.0 Flask-SQLAlchemy==3.1.1 Flask-Migrate==4.0.7 psycopg2-binary==2.9.9 python-dotenv==1.0.0 gunicorn==22.0.0

🚀 3. Deploy & Test

1

đź’ľ Push to GitHub

git add . git commit -m “Add Netlify config + Neon DB” git push origin main

2

⏳ Watch Auto-Deploy

Netlify Dashboard → Deploys tab:

  • Build command: pip install -r requirements.txt && flask db upgrade
  • Publish directory: .
  • Functions directory: functions

3

âś… Verification Tests

Test

URL

Expected Result

Landing Page

https://app.socialagent.me

Login button appears

GFAVIP Auth

Click “Login with GFAVIP”

Redirects to wallet.gfavip.com → callback

Dashboard

After login

Avatar grid (empty initially)

API Health

/api/avatars

JSON response []

đź’° Cost Summary

Monthly Total

$0-24

Production Ready | No Credit Card Required

Service

Monthly Cost

Notes

Netlify

$0-19

Your paid plan covers

Neon Postgres

$0

500MB free tier

xAI API

~$5

1M tokens (~1000 chats)

đź”§ Common Issues & Solutions

Issue

Solution

500 Error on API

Check Functions logs in Netlify dashboard

DB Connection Failed

Verify DATABASE_URL environment variable

GFAVIP Auth Fails

Check whitelist; verify GFAVIP_SERVICE

Build Fails

Add psycopg2-binary to requirements.txt

🚀 One-Command Deploy Checklist

1. Set DATABASE_URL in Netlify environment variables 2. Create netlify.toml (copy code above) 3. Update requirements.txt (add psycopg2-binary) 4. git add . && git commit -m “Netlify deployment” 5. git push origin main 6. Wait 2-3 minutes for build 7. Test: https://app.socialagent.me

🎉 YOU’RE LIVE!