Local Development Guide
Local Development Guide
Section titled “Local Development Guide”Quick Start
Section titled “Quick Start”Start Both Services (Recommended)
Section titled “Start Both Services (Recommended)”./start_local.shThis will:
- ✅ Start backend on http://localhost:8000
- ✅ Start frontend on http://localhost:3000
- ✅ Auto-reload on code changes
- ✅ Show startup status for both services
Press Ctrl+C to stop both services
Manual Startup (Alternative)
Section titled “Manual Startup (Alternative)”Backend Only
Section titled “Backend Only”cd backendsource .venv/bin/activatepython3 -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000Frontend Only
Section titled “Frontend Only”cd frontendnpm run devAccess Points
Section titled “Access Points”- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs (if in dev mode)
- Login Password:
mgslg2025
Available Pages
Section titled “Available Pages”/- Home/Landing page/login- Login page/dashboard- Interactive Analytics Dashboard/ml-analytics- ML Predictions Dashboard/sace-dashboard- SACE Points Compliance Dashboard
Troubleshooting
Section titled “Troubleshooting”Backend won’t start
Section titled “Backend won’t start”cd backendsource .venv/bin/activatepip install -r requirements.txtFrontend won’t start
Section titled “Frontend won’t start”cd frontendrm -rf node_modules package-lock.jsonnpm installDatabase connection issues
Section titled “Database connection issues”Check .env file in backend directory:
DATABASE_URL=postgresql+asyncpg://user:password@localhost/dbnamePort already in use
Section titled “Port already in use”# Kill process on port 8000 (backend)lsof -ti:8000 | xargs kill -9
# Kill process on port 3000 (frontend)lsof -ti:3000 | xargs kill -9View Logs
Section titled “View Logs”# Backend logstail -f /tmp/mgslg-backend.log
# Frontend logstail -f /tmp/mgslg-frontend.logStop Services
Section titled “Stop Services”- If using
start_local.sh: Press Ctrl+C - If running manually: Press Ctrl+C in each terminal window
Database Setup
Section titled “Database Setup”The local database should already be configured. If you need to seed data:
cd backendsource .venv/bin/activatepython3 seed_database.pyProduction vs Local
Section titled “Production vs Local”Local Environment:
- Backend: http://localhost:8000
- Frontend: http://localhost:3000
- Database: Local PostgreSQL
Production (Railway):
- Backend: https://backend-production-c351.up.railway.app
- Frontend: https://frontend-production-5e4e.up.railway.app
- Database: Railway PostgreSQL
Ready to develop! 🚀