Skip to content

Latest commit

 

History

History
129 lines (99 loc) · 3.15 KB

File metadata and controls

129 lines (99 loc) · 3.15 KB

🎉 Dashboard Deployment Complete!

The Miku dashboard is now ready for free deployment on Vercel!

What Changed

1. New API Server (src/api_server.py)

  • FastAPI server that exposes bot database via REST API
  • Allows remote dashboard to access bot data
  • Runs alongside the Discord bot

2. Updated Dashboard API Routes

  • All API routes now fetch from bot's API server instead of local database
  • No more direct database access from dashboard
  • Works seamlessly with remote deployment

3. Deployment Configuration

  • vercel.json - Vercel deployment config
  • start_all.py - Runs both bot and API server
  • Updated environment variable examples
  • Comprehensive deployment documentation

4. Removed Dependencies

  • Removed better-sqlite3 from dashboard (no longer needed)
  • Dashboard is now lighter and deployable to serverless platforms

File Structure

Miku/
├── src/
│   ├── api_server.py          # NEW: REST API for dashboard
│   ├── bot.py
│   ├── cogs/
│   └── utils/
├── dash/
│   ├── src/
│   │   ├── pages/
│   │   │   └── api/           # Updated to use bot API
│   │   ├── components/
│   │   └── lib/
│   ├── vercel.json            # NEW: Vercel config
│   ├── QUICK_DEPLOY.md        # NEW: Quick guide
│   └── .env.example           # Updated
├── start_all.py               # NEW: Start bot + API
├── DEPLOYMENT.md              # NEW: Full guide
├── .env.example               # Updated
└── requirements.txt           # Updated (added FastAPI)

Next Steps

1. Update WispByte Deployment

Add to your .env on WispByte:

API_PORT=8000
ALLOWED_ORIGINS=*

Change your startup command to:

python start_all.py

2. Deploy Dashboard to Vercel

Follow: DEPLOYMENT.md or dash/QUICK_DEPLOY.md

Quick steps:

  1. Push code to GitHub
  2. Import to Vercel
  3. Add environment variables
  4. Deploy!

3. Connect Them

Set BOT_API_URL in Vercel to your WispByte bot's URL.

Environment Variables

WispByte (.env)

DISCORD_BOT_TOKEN=your_token
API_PORT=8000
ALLOWED_ORIGINS=https://your-dashboard.vercel.app

Vercel (Dashboard)

NEXTAUTH_URL=https://your-dashboard.vercel.app
NEXTAUTH_SECRET=generate_with_openssl_rand_base64_32
DISCORD_CLIENT_ID=your_client_id
DISCORD_CLIENT_SECRET=your_client_secret
DISCORD_BOT_TOKEN=your_token
BOT_API_URL=https://your-bot-url.wispbyte.com

Test It

Bot API:

curl https://your-bot-url.com/
# Should return: {"status": "ok"}

Dashboard:

  1. Visit your Vercel URL
  2. Login with Discord
  3. View server stats!

Documentation

What's Free? 🎉

  • ✅ WispByte (Bot hosting)
  • ✅ Vercel (Dashboard hosting)
  • ✅ Discord API
  • ✅ Everything!

Total Cost: $0/month


Need help? Check the FAQs and troubleshooting in DEPLOYMENT.md!