#!/bin/bash # GNX Mail Development Startup Script echo "🚀 Starting GNX Mail Development Environment..." # Check if virtual environment exists if [ ! -d "venv" ]; then echo "❌ Virtual environment not found. Please run setup first." exit 1 fi # Activate virtual environment echo "📦 Activating virtual environment..." source venv/bin/activate # Check if database exists if [ ! -f "db.sqlite3" ]; then echo "🗄️ Database not found. Running migrations..." python manage.py migrate fi # Start Redis (if not running) echo "🔴 Starting Redis..." redis-server --daemonize yes # Start Django server echo "🐍 Starting Django server..." python manage.py runserver 0.0.0.0:8000 & DJANGO_PID=$! # Wait a moment for Django to start sleep 3 # Start React frontend echo "⚛️ Starting React frontend..." cd frontend npm start & REACT_PID=$! # Go back to root directory cd .. echo "" echo "✅ GNX Mail is now running!" echo "" echo "🌐 Frontend: http://localhost:3000" echo "🔧 Backend API: http://localhost:8000" echo "👨‍💼 Admin Panel: http://localhost:8000/admin" echo "" echo "📧 Login credentials:" echo " Email: admin@gnxmail.com" echo " Username: admin" echo " Password: [the password you set during setup]" echo "" echo "🛑 To stop all services, press Ctrl+C" echo "" # Wait for user to stop wait