This guide covers everything you need to get the iOps application running locally.
# Terminal 1 - Backend
cd backend
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
pip install -r requirements.txt
cp .env.example .env # Then edit .env with your values
python migrate.py upgrade
python create_test_user.py # Creates a test user
python run.py
# Terminal 2 - Frontend
cd frontend
npm install
cp .env.example .env.local
npm run devURLs:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
| Software | Version | Purpose |
|---|---|---|
| Python | 3.11+ | Backend runtime |
| Node.js | 18+ | Frontend runtime |
| Git | Latest | Version control |
- PostgreSQL 12+ (SQLite works for development)
- Redis (for background jobs)
cd backend
python -m venv venv
# Activate (choose your OS)
venv\Scripts\activate # Windows CMD
.\venv\Scripts\Activate.ps1 # Windows PowerShell
source venv/bin/activate # Linux/Macpip install -r requirements.txtcp .env.example .envEdit .env and configure these required variables:
| Variable | Description | How to Get |
|---|---|---|
SECRET_KEY |
JWT signing key | python -c "import secrets; print(secrets.token_urlsafe(32))" |
ENCRYPTION_KEY |
Data encryption | python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" |
GROQ_API_KEY |
AI features | console.groq.com |
Optional variables for full functionality:
PAYSTACK_SECRET_KEY- Payment processingRESEND_API_KEY- Email serviceGOOGLE_CLIENT_ID/SECRET- Google Sheets integration
python migrate.py upgradepython create_test_user.pyThis creates a user you can use to test the application.
cd frontend
npm installcp .env.example .env.localDefault configuration works for local development:
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-herecd backend
python run.pyBackend runs at: http://localhost:8000
cd frontend
npm run devFrontend runs at: http://localhost:3000
- Open http://localhost:3000
- Register a new account or use the test user
- Upload a CSV file to test data processing
- Create an analysis to test AI features
- User registration and login
- Dashboard loads correctly
- Upload CSV/Excel dataset
- Create and execute analysis
- AI Copilot chat functionality
- Generate and share reports
- Browse template marketplace
- Admin dashboard metrics
- User management
- Revenue analytics
| Endpoint | Method | Description |
|---|---|---|
/api/auth/register |
POST | User registration |
/api/auth/login |
POST | User login |
/api/auth/me |
GET | Get current user |
| Endpoint | Method | Description |
|---|---|---|
/api/datasets |
GET/POST | List/upload datasets |
/api/analyses |
GET/POST | List/create analyses |
/api/analyses/{id}/execute |
POST | Run analysis |
Full API documentation available at: http://localhost:8000/docs
"Module not found" errors
pip install -r requirements.txtDatabase errors
python migrate.py upgradePort 8000 in use
# Windows
netstat -ano | findstr :8000
taskkill /PID <PID> /F
# Linux/Mac
lsof -i :8000
kill -9 <PID>API connection errors
- Verify backend is running on port 8000
- Check
NEXT_PUBLIC_API_URLin.env.local
Build errors
rm -rf node_modules .next
npm install
npm run dev- Create account at console.groq.com
- Generate API key
- Add to
GROQ_API_KEYin.env
- Create account at paystack.com
- Get API keys from dashboard
- Add to
PAYSTACK_SECRET_KEYandPAYSTACK_PUBLIC_KEY
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Set redirect URI:
http://localhost:8000/api/connections/google-sheets/callback - Add to
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET
- Create account at resend.com
- Get API key
- Add to
RESEND_API_KEY
- Create account at sentry.io
- Create a FastAPI project
- Add DSN to
SENTRY_DSN
For production deployment instructions, see docs/DEPLOYMENT.md.
Key considerations:
- Use PostgreSQL instead of SQLite
- Set
DEBUG=false - Configure proper CORS origins
- Use HTTPS
- Set up monitoring (Sentry)
- Check the API documentation
- Review docs/ folder for additional guides
- Open an issue on GitHub
- Contact: nwangumaemmanuel29@gmail.com