56 lines
1.3 KiB
Bash
Executable File
56 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# BetFun Arena - Development Startup Script
|
|
|
|
echo "๐ Starting BetFun Arena Development Environment..."
|
|
echo ""
|
|
|
|
# Check if .env files exist
|
|
if [ ! -f "apps/web/.env.local" ]; then
|
|
echo "โ ๏ธ Frontend .env.local not found!"
|
|
echo "Run 'npm run setup:env' first."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f "packages/api/.env" ]; then
|
|
echo "โ ๏ธ API .env not found!"
|
|
echo "Run 'npm run setup:env' first."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if node_modules exist
|
|
if [ ! -d "node_modules" ]; then
|
|
echo "๐ฆ Installing dependencies..."
|
|
npm install
|
|
fi
|
|
|
|
# Check if Redis is running
|
|
if ! redis-cli ping > /dev/null 2>&1; then
|
|
echo "โ ๏ธ Redis is not running!"
|
|
echo "Starting Redis..."
|
|
if command -v redis-server &> /dev/null; then
|
|
redis-server --daemonize yes
|
|
echo "โ
Redis started"
|
|
else
|
|
echo "โ Redis not installed. Install with: brew install redis"
|
|
echo "Or use Redis Cloud: https://redis.com/try-free/"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Start all services
|
|
echo ""
|
|
echo "๐ฏ Starting all services..."
|
|
echo ""
|
|
echo "๐ฑ Frontend: http://localhost:3000"
|
|
echo "๐ง API: http://localhost:3001"
|
|
echo "๐ WebSocket: http://localhost:3002"
|
|
echo "๐ก Indexer: Running in background"
|
|
echo ""
|
|
echo "Press Ctrl+C to stop all services"
|
|
echo ""
|
|
|
|
# Use concurrently to run all services
|
|
npm run dev
|
|
|