A real-time DDoS attack detection and mitigation system with AI-powered threat analysis, interactive dashboard, and automated firewall management.
- Real-time Monitoring: Live traffic analysis with WebSocket support
- AI-Powered Detection: Machine learning algorithms to detect anomalies and threats
- Interactive Dashboard: Modern React-based UI with charts and visualizations
- Automated Mitigation: Auto-blocking of suspicious IPs with configurable thresholds
- GeoIP Intelligence: Location-based blocking and analysis
- IP Management: Whitelist/blacklist management interface
- Analytics: Detailed attack patterns and traffic analysis
- Settings Management: Configurable protection parameters
ddos-shield/
├── backend/ # Node.js + Express backend
│ ├── src/
│ │ ├── core/ # Detection engine, firewall, AI analyzer
│ │ ├── routes/ # API routes (auth, admin)
│ │ ├── services/ # IP service, GeoIP, auth
│ │ ├── realtime/ # Socket.IO server
│ │ └── middleware/# Auth, rate limiting
│ └── ecosystem.config.js
├── frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Dashboard pages
│ │ └── services/ # API & socket services
│ └── public/
├── config/ # Configuration files
└── docker-compose.yml
- Node.js 18+
- MongoDB
- Redis
- iptables (for firewall functionality)
cd backend
npm install
cp .env.example .env
# Edit .env with your configuration
npm run devcd frontend
npm install
cp .env.example .env
# Edit .env with your API URL
npm run devdocker-compose up -dPORT=3000
NODE_ENV=development
JWT_SECRET=your-super-secret-jwt-key
MONGO_URI=mongodb://localhost:27017/ddos-shield
REDIS_HOST=localhost
REDIS_PORT=6379
CORS_ORIGIN=http://localhost:5173
VITE_API_URL=http://localhost:3000
VITE_SOCKET_URL=http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current userPOST /api/auth/logout- Logout user
GET /api/admin/stats- Get dashboard statisticsGET /api/admin/attacks- Get attack logsGET /api/admin/ips- Get IP listGET /api/admin/top-ips- Get top offending IPsGET /api/admin/attack-types- Get attack type distributionPOST /api/admin/block- Block an IPPOST /api/admin/unblock- Unblock an IPPOST /api/admin/bulk-block- Bulk block IPsPOST /api/admin/whitelist- Whitelist an IPPOST /api/admin/unwhitelist- Remove from whitelistGET /api/admin/settings- Get settingsPOST /api/admin/settings- Update settings
detection_update- Real-time detection resultscritical_alert- Critical threat alertsauto_blocked- Auto-block notificationsip_blocked- Manual block notificationsip_unblocked- Unblock notificationssettings- Settings updates
update_settings- Update detection settingsblock_ip- Block an IPunblock_ip- Unblock an IP
MIT