How anujbendre/ai-ransomware-detection-system works
This is an AI-based ransomware detection system: filesystem activity is recorded, event counts feed a machine-learning prediction, and alerts and event analytics are exposed through a FastAPI backend for a React dashboard. The main documented path is file monitoring through detection and alerting to dashboard display. Some connections are supported only by the README or the SOURCE INDEX; unsampled implementations are represented by their existing paths, with uncertain wiring left out or marked dashed.
Main entry points: Dashboard.jsx Dashboard · stats.py Stats endpoint · main.py FastAPI app · event_handler.py Event handler
Components 21
Monitoring and detection
- File monitor
backend/monitoring/file_monitor.py - Event handler
backend/monitoring/event_handler.py - Feature collector
backend/monitoring/feature_collector.py - ML predictor
backend/ml/predict.py - Trained model
backend/ml/ransomware_model.pkl
Storage and API
- Events CSV
backend/storage/events.csv - Alerts CSV
backend/storage/alerts.csv - FastAPI app
backend/main.py - Events endpoint
backend/routes/events.py - Alerts endpoint
backend/routes/alerts.py - Stats endpoint
backend/routes/stats.py
Dashboard
- React app
frontend/src/App.jsx - Landing page
frontend/src/components/LandingPage.jsx - Dashboard
frontend/src/components/Dashboard.jsx - API client
frontend/src/services/api.jsx - Stats cards
frontend/src/components/StatsCards.jsx - Event chart
frontend/src/components/EventChart.jsx - Threat meter
frontend/src/components/ThreatMeter.jsx - Events table
frontend/src/components/EventsTable.jsx - Alerts table
frontend/src/components/AlertsTable.jsx
Other components
- User activity
Connections 25
- User activity → File monitor: changes files
README.md - File monitor → Event handler: dispatches events
backend/monitoring/file_monitor.py - Event handler → Events CSV: writes events
backend/monitoring/event_handler.py - Event handler → Feature collector: updates counts
backend/monitoring/event_handler.py - Feature collector → ML predictor: requests prediction
backend/monitoring/feature_collector.py - ML predictor → Trained model: loads and predicts
backend/ml/predict.py - Feature collector → Alerts CSV: writes alerts
backend/monitoring/feature_collector.py - FastAPI app → Events endpoint: mounts router
backend/main.py - FastAPI app → Alerts endpoint: mounts router
backend/main.py - FastAPI app → Stats endpoint: mounts router
backend/main.py - Events endpoint → Events CSV: reads events
backend/routes/events.py - Alerts endpoint → Alerts CSV: reads alerts
backend/routes/alerts.py - Stats endpoint → Events CSV: reads events
backend/routes/stats.py - Stats endpoint → Alerts CSV: reads alerts
backend/routes/stats.py - React app → Landing page: renders
frontend/src/App.jsx - React app → Dashboard: renders
frontend/src/App.jsx - Dashboard → API client: requests data through
frontend/src/components/Dashboard.jsx - Dashboard → Events endpoint: requests events
frontend/src/components/Dashboard.jsx - Dashboard → Alerts endpoint: requests alerts
frontend/src/components/Dashboard.jsx - Dashboard → Stats endpoint: requests stats
frontend/src/components/Dashboard.jsx - Dashboard → Stats cards: renders
frontend/src/components/Dashboard.jsx - Dashboard → Event chart: renders
frontend/src/components/Dashboard.jsx - Dashboard → Threat meter: renders
frontend/src/components/Dashboard.jsx - Dashboard → Events table: renders
frontend/src/components/Dashboard.jsx - Dashboard → Alerts table: renders
frontend/src/components/Dashboard.jsx