How nguyentanphong-12022k5/do_an works
NetOps & Infrastructure Portal combines a React dashboard with an Express backend for device inventory, discovery, polling, metric history, alerts, forecasting, and remote SSH commands. The main monitoring flow is: administrators view devices in the dashboard; the backend polls registered devices, checks reachability and gathers SNMP metrics, stores results, and sends configured alerts. Dashboard metric-history and device-management requests pass through the HTTP routes and controllers. The README documents the end-to-end polling and dashboard behavior; unsampled integrations are included only where the tree or documentation supports them.
Main entry points: device.controller.ts Device Controller · poller.worker.ts Polling Worker · server.ts HTTP Server · device.repository.ts Device Repository
Components 20
Web Portal
- Dashboard
web/src/App.tsx
API & Device Ops
- HTTP Server
backend/src/server.ts - Device Routes
backend/src/routes/device.routes.ts - Device Controller
backend/src/controllers/device.controller.ts - Device Service
backend/src/services/device.service.ts - NetOps Routes
backend/src/routes/netops.routes.ts - NetOps Controller
backend/src/controllers/netops.controller.ts - SSH Commands
backend/src/services/ssh.service.ts
Monitoring & Alerts
- Network Discovery
backend/src/services/discovery.service.ts - Polling Worker
backend/src/workers/poller.worker.ts - Monitoring Service
backend/src/services/monitoring.service.ts - Email Alerts
backend/src/services/email.service.ts - Capacity Forecasting
backend/src/services/ai.service.ts
Persistence
- Device Repository
backend/src/repositories/device.repository.ts - Metric Repository
backend/src/repositories/metric.repository.ts - Database Pool
backend/src/config/db.ts
Other components
- Administrator
- PostgreSQL
- Managed Network Devices
- Email Provider
Connections 25
- Administrator → Dashboard: uses
README.md - Dashboard → HTTP Server: requests API
web/src/App.tsx - HTTP Server → Device Routes: mounts
backend/src/server.ts - HTTP Server → NetOps Routes: mounts
backend/src/server.ts - HTTP Server → Polling Worker: starts worker
backend/src/server.ts - Device Routes → Device Controller: dispatches
backend/src/routes/device.routes.ts - Device Controller → Device Service: manages devices
backend/src/controllers/device.controller.ts - Device Controller → Network Discovery: scans networks
backend/src/controllers/device.controller.ts - Device Controller → Metric Repository: reads history
backend/src/controllers/device.controller.ts - Device Controller → Capacity Forecasting: requests forecast
backend/src/controllers/device.controller.ts - Network Discovery → Monitoring Service: checks SNMP
backend/src/services/discovery.service.ts - Network Discovery → Device Repository: finds or adds
backend/src/services/discovery.service.ts - NetOps Routes → NetOps Controller: dispatches
backend/src/routes/netops.routes.ts - NetOps Controller → Device Repository: loads devices
backend/src/controllers/netops.controller.ts - NetOps Controller → SSH Commands: executes command
backend/src/controllers/netops.controller.ts - SSH Commands → Managed Network Devices: runs remote command
- Polling Worker → Device Repository: loads inventory
backend/src/workers/poller.worker.ts - Polling Worker → Monitoring Service: checks and collects
backend/src/workers/poller.worker.ts - Polling Worker → Metric Repository: stores metrics
backend/src/workers/poller.worker.ts - Polling Worker → Email Alerts: sends alerts
backend/src/workers/poller.worker.ts - Monitoring Service → Managed Network Devices: pings and queries SNMP
backend/src/services/monitoring.service.ts - Email Alerts → Email Provider: sends email
- Device Repository → Database Pool: queries
backend/src/repositories/device.repository.ts - Metric Repository → Database Pool: queries
backend/src/repositories/metric.repository.ts - Database Pool → PostgreSQL: connects
backend/src/config/db.ts