How vishwajeet-gupta-001/api-sentinel works
API Sentinel lets users authenticate, configure API monitors, inspect health history and analytics, and manage incidents. Its runtime monitoring flow schedules due monitors into BullMQ, processes checks against external APIs, stores results, evaluates incident creation or recovery, and broadcasts events through Redis Pub/Sub and Socket.IO to the dashboard. The README documents the overall real-time and background-job architecture; source excerpts establish several key calls and route relationships, while some integration wiring is documented rather than sampled.
Main entry points: server.js Express and Socket.IO · App.jsx React application · monitoringWorker.js Check worker · dashboardController.js Summary and analytics
Components 28
Web dashboard
- React application
frontend/src/App.jsx - Authentication state
frontend/src/context/AuthContext.jsx - Monitor management
frontend/src/pages/CreateMonitor.jsx - Monitor views
frontend/src/pages/MonitorDetails.jsx - Dashboard analytics
frontend/src/pages/Dashboard.jsx - Incident views
frontend/src/pages/Incidents.jsx - API endpoint config
frontend/src/config.js
API and access
- Express and Socket.IO
server/server.js - Authentication routes
server/routes/authRoutes.js - Authentication service
server/controllers/authController.js - Monitor routes
server/routes/monitorRoutes.js - Monitor operations
server/controllers/monitorController.js - Incident routes
server/routes/incidentRoutes.js - Incident operations
server/controllers/incidentController.js - Dashboard routes
server/routes/dashboardRoutes.js - Summary and analytics
server/controllers/dashboardController.js
Monitoring pipeline
- Monitoring scheduler
server/scheduler/monitoringScheduler.js - BullMQ job queue
server/queues/monitoringQueue.js - Check worker
server/workers/monitoringWorker.js
Application data
- MongoDB records
server/config/db.js - Monitor records
server/models/Monitor.js - Check history
server/models/CheckResult.js - Incident records
server/models/Incident.js
Live events
- Event publisher
server/pubsub/pubsubPublisher.js - Event subscriber
server/pubsub/pubsubSubscriber.js - Redis Pub/Sub
server/config/redis.js
Other components
- Monitor user
- Monitored APIs
Connections 41
- Monitor user → React application: uses
README.md - React application → Authentication state: provides auth
frontend/src/main.jsx - React application → Monitor management: routes to
frontend/src/App.jsx - React application → Monitor views: routes to
frontend/src/App.jsx - React application → Dashboard analytics: routes to
frontend/src/App.jsx - React application → Incident views: routes to
frontend/src/App.jsx - Monitor management → API endpoint config: uses endpoint
frontend/src/pages/CreateMonitor.jsx - Monitor views → API endpoint config: uses endpoint
frontend/src/pages/MonitorDetails.jsx - Dashboard analytics → API endpoint config: uses endpoint
frontend/src/pages/Dashboard.jsx - Incident views → API endpoint config: uses endpoint
frontend/src/pages/Incidents.jsx - React application → Express and Socket.IO: calls API
README.md - Express and Socket.IO → Authentication routes: mounts routes
server/server.js - Express and Socket.IO → Monitor routes: mounts routes
server/server.js - Express and Socket.IO → Incident routes: mounts routes
server/server.js - Express and Socket.IO → Dashboard routes: mounts routes
server/server.js - Authentication routes → Authentication service: dispatches
server/routes/authRoutes.js - Monitor routes → Monitor operations: dispatches
server/routes/monitorRoutes.js - Incident routes → Incident operations: dispatches
server/routes/incidentRoutes.js - Dashboard routes → Summary and analytics: dispatches
server/routes/dashboardRoutes.js - Express and Socket.IO → Monitoring scheduler: starts
server/server.js - Monitoring scheduler → Monitor records: finds due monitors
server/scheduler/monitoringScheduler.js - Monitoring scheduler → BullMQ job queue: enqueues jobs
server/scheduler/monitoringScheduler.js - BullMQ job queue → Check worker: delivers jobs
README.md - Check worker → Monitored APIs: checks API
README.md - Check worker → Check history: stores results
README.md - Check worker → Monitor records: updates status
server/workers/monitoringWorker.js - Check worker → Incident operations: evaluates incidents
- Check worker → Incident records: evaluates failures
- Monitor operations → Monitor records: reads and writes
server/controllers/monitorController.js - Monitor operations → Check history: reads history
server/controllers/monitorController.js - Summary and analytics → Monitor records: counts monitors
server/controllers/dashboardController.js - Summary and analytics → Check history: reads analytics
server/controllers/dashboardController.js - Summary and analytics → Incident records: counts incidents
server/controllers/dashboardController.js - Incident operations → Incident records: manages incidents
server/controllers/incidentController.js - Check worker → Event publisher: publishes changes
server/workers/monitoringWorker.js - Incident records → Event publisher: publishes transitions
server/services/incidentEngine.js - Event publisher → Redis Pub/Sub: publishes events
- Redis Pub/Sub → Event subscriber: forwards events
README.md - Express and Socket.IO → Event subscriber: initializes
server/server.js - Event subscriber → Express and Socket.IO: emits Socket.IO
README.md - Express and Socket.IO → React application: pushes live updates
README.md