A modern, microservices-based incident management platform built with React, Node.js, and MongoDB. Designed for DevOps teams, SREs, and IT operations to handle incidents efficiently with real-time collaboration.
- Microservices: Auth, Incident, User, OnCall services
- Reverse Proxy: Nginx with load balancing and SSL termination
- Containerized: Full Docker support with health checks
- Real-time: Socket.IO for live incident updates
- Dark Mode: Complete UI with smooth transitions
- Rate Limiting: API protection against DDoS
- Security Headers: XSS, CSRF, and content type protection
- SSL/TLS: HTTPS support with certificate management
- Gzip Compression: Optimized content delivery
- Static Caching: Long-term asset caching
- Health Checks: All services monitored
- Logging: Structured logs for debugging
- Error Handling: Graceful failure recovery
- Scalability: Ready for horizontal scaling
- Docker & Docker Compose
- MongoDB Atlas account (or local MongoDB)
- AWS S3 bucket (for file uploads)
- SMTP provider (for email notifications)
git clone https://github.com/shubnimkar/incidentflow.git
cd incidentflow
# Copy environment templates
cp services/auth/env.example services/auth/.env
cp services/incident/env.example services/incident/.env
cp services/user/env.example services/user/.env
cp services/oncall/env.example services/oncall/.env
cp frontend/client/env.example frontend/client/.env
Edit each .env
file with your production values:
Required for all services:
MONGO_URI=mongodb+srv://username:[email protected]/incidentflow
JWT_SECRET=your-super-secure-jwt-secret
For file uploads (User & Incident services):
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
S3_BUCKET=your-s3-bucket-name
For email notifications:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_PASS=your-app-password
EMAIL_FROM=[email protected]
For SMS notifications (User service):
TWILIO_ACCOUNT_SID=your-twilio-sid
TWILIO_AUTH_TOKEN=your-twilio-token
TWILIO_FROM_NUMBER=+1234567890
# Start all services with Nginx reverse proxy
make nginx-start
# Access via: http://localhost
# Generate development SSL certificates
make ssl-dev
# Or use Let's Encrypt for production
# Follow nginx/ssl/README.md for instructions
make up
# Access: http://localhost:3000
# Build all images
make build
# Start specific service
docker compose up -d auth-service
docker compose up -d incident-service
docker compose up -d user-service
docker compose up -d oncall-service
docker compose up -d frontend
Service | Port | Purpose | Health Check |
---|---|---|---|
Nginx | 80/443 | Reverse Proxy | /health |
Frontend | 3000 | React App | http://localhost:3000 |
Auth | 5000 | Authentication | http://localhost:5000/health |
Incident | 5001 | Incident Management | http://localhost:5001/health |
User | 5002 | User Management | http://localhost:5002/health |
OnCall | 5003 | On-Call Scheduling | http://localhost:5003/health |
make help # Show all available commands
make status # Check service status
make logs # View all logs
make restart # Restart all services
make down # Stop all services
make clean # Remove containers and volumes
make nginx-start # Start with Nginx reverse proxy
make nginx-stop # Stop Nginx service
make nginx-logs # View Nginx logs
make ssl-dev # Generate development SSL certificates
make shell # Open shell in any service
make install-deps # Install all dependencies
- Main App:
http://localhost/
orhttps://localhost/
- API Gateway: All APIs through port 80/443
- Health Check:
http://localhost/health
- Frontend:
http://localhost:3000
- Auth API:
http://localhost:5000/api/auth
- Incident API:
http://localhost:5001/api/incidents
- User API:
http://localhost:5002/api/users
- OnCall API:
http://localhost:5003/api/oncall
- Rate Limiting: 10 req/s for APIs, 5 req/min for login
- Security Headers: XSS, CSRF, content type protection
- SSL/TLS: Full HTTPS support
- DDoS Protection: Request limiting and filtering
- JWT Authentication: Secure token-based auth
- Password Hashing: bcrypt with salt
- Input Validation: All user inputs sanitized
- CORS Protection: Configured for production domains
# Check all services
make status
# Individual service health
curl http://localhost/api/auth/test
curl http://localhost/api/incidents/health
curl http://localhost/api/users/health
curl http://localhost/api/oncall/health
# All services
make logs
# Specific service
docker compose logs -f auth-service
docker compose logs -f nginx
# Nginx logs
make nginx-logs
# Set production environment variables
export NODE_ENV=production
export MONGO_URI=your-production-mongodb-uri
export JWT_SECRET=your-production-jwt-secret
# Install certbot
sudo apt-get install certbot
# Generate certificate
sudo certbot certonly --standalone -d yourdomain.com
# Copy to Nginx
sudo cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem nginx/ssl/cert.pem
sudo cp /etc/letsencrypt/live/yourdomain.com/privkey.pem nginx/ssl/key.pem
# Start with Nginx and SSL
make nginx-start
# Verify SSL
curl -I https://yourdomain.com
# Add to crontab
0 12 * * * /usr/bin/certbot renew --quiet
Edit nginx/nginx.conf
for:
- Custom rate limiting
- Additional security headers
- Load balancing configuration
- SSL certificate paths
Each service has its own .env
file:
services/auth/.env
- Authentication settingsservices/incident/.env
- Incident managementservices/user/.env
- User managementservices/oncall/.env
- On-call scheduling
frontend/client/.env
- React app settings- API endpoints
- Feature flags
- Analytics configuration
1. Service Won't Start
# Check logs
docker compose logs service-name
# Check health
make status
# Restart service
docker compose restart service-name
2. Nginx 502 Errors
# Check if backend services are running
make status
# Check Nginx logs
make nginx-logs
# Test backend directly
curl http://localhost:5000/health
3. SSL Certificate Issues
# Check certificate validity
openssl x509 -in nginx/ssl/cert.pem -text -noout
# Test SSL connection
curl -I https://localhost
4. Database Connection Issues
# Test MongoDB connection
docker compose exec auth-service node -e "
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGO_URI)
.then(() => console.log('Connected'))
.catch(err => console.error(err));
"
# Check resource usage
docker stats
# Monitor Nginx performance
docker compose exec nginx nginx -V
# Check service response times
curl -w "@curl-format.txt" -o /dev/null -s http://localhost/api/auth/test
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginGET /api/auth/me
- Get current user
GET /api/incidents
- List incidentsPOST /api/incidents
- Create incidentPUT /api/incidents/:id
- Update incidentDELETE /api/incidents/:id
- Delete incident
GET /api/users
- List usersPUT /api/users/me
- Update profilePOST /api/users/me/avatar
- Upload avatar
GET /api/oncall/schedules
- Get schedulesPOST /api/oncall/schedules
- Create schedule
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: Wiki
- Security: Report to [email protected]
Built with β€οΈ for modern incident management