Skip to content

Latest commit

Β 

History

History
104 lines (79 loc) Β· 2.18 KB

File metadata and controls

104 lines (79 loc) Β· 2.18 KB

Supabase Quick Start Guide

This is a condensed guide for setting up the OBS Telegram Bot with Supabase.

πŸš€ Supabase Setup in 5 Minutes

1. Create Supabase Project

  1. Go to supabase.com β†’ Sign up
  2. Create new project β†’ Name: obs-telegram-bot
  3. Set strong database password β†’ Create project

2. Get Database URL

  1. Project Settings β†’ Database
  2. Copy "Connection string" β†’ URI format
  3. Format: postgresql://postgres:[PASSWORD]@db.[PROJECT].supabase.co:5432/postgres

3. Configure Environment

Create .env file:

DATABASE_URL="postgresql://postgres:[PASSWORD]@db.[PROJECT].supabase.co:5432/postgres"
TELEGRAM_BOT_TOKEN="your_bot_token"

4. Setup Database

npm install
npm run db:generate
npm run db:push

5. Test Locally

npm run dev

Visit http://localhost:3000

πŸ“± Deploy to Vercel

1. Install Vercel CLI

npm install -g vercel

2. Deploy

vercel

3. Set Environment Variables in Vercel

  • Go to Vercel Dashboard β†’ Your Project β†’ Settings β†’ Environment Variables
  • Add:
    • DATABASE_URL (your Supabase URL)
    • TELEGRAM_BOT_TOKEN (your bot token)

4. Redeploy

vercel --prod

🎯 Next Steps

  1. Configure OBS Studio:

    • Tools β†’ WebSocket Server Settings
    • Enable server, port 4455, set password
  2. Test Bot:

    • Send /start to your Telegram bot
    • Use /connect to connect to OBS
    • Try /scenes, /stream start, etc.
  3. Monitor:

    • Check Supabase dashboard for database stats
    • Monitor Vercel for deployment logs

πŸ”§ Common Commands

# Development
npm run dev

# Database
npm run db:generate    # Generate Prisma client
npm run db:push        # Push schema to database
npx prisma studio      # View database

# Deployment
vercel --prod          # Deploy to production

πŸ“š Troubleshooting

Connection Issues:

  • Verify DATABASE_URL includes password
  • Check Supabase project status
  • Ensure SSL is enabled

Bot Issues:

  • Verify TELEGRAM_BOT_TOKEN
  • Check Vercel environment variables
  • Review Vercel function logs

That's it! Your OBS Telegram Bot should be running with Supabase in minutes.