# kritisans25/devops-monitor architecture

> Architecture diagram of the GitHub repository kritisans25/devops-monitor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kritisans25/devops-monitor
- Repository: https://github.com/kritisans25/devops-monitor

## Overview

devops-monitor is a web-based infrastructure and HTTP endpoint monitoring dashboard. Users add endpoints, which the backend registers and checks; scheduled checks and server sampling provide history and telemetry for overview and endpoint-detail views. The backend exposes these results through an API backed by MongoDB. The README gives no feature detail, so capability coverage follows the source index and sampled code; several component-to-component links are omitted where implementation excerpts do not show the relationship.

Main entry points: [`backend/server.js`](https://github.com/kritisans25/devops-monitor/blob/main/backend/server.js) (HTTP routes), [`frontend/src/App.jsx`](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/App.jsx) (App routing), [`backend/services/apimonitorservices.js`](https://github.com/kritisans25/devops-monitor/blob/main/backend/services/apimonitorservices.js) (Endpoint checks), [`frontend/src/api/api.js`](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/api/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Dashboard"]
  node_app["App routing<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_overview["Infrastructure overview<br/>[Overview.jsx]"]
  node_endpoints["Endpoint directory<br/>[Endpoints.jsx]"]
  node_detail["Endpoint telemetry<br/>[EndpointDetail.jsx]"]
  node_containers["Container view<br/>[Containers.jsx]"]
  node_addmodal["Add endpoint form"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_backend["HTTP routes<br/>[server.js]"]
end

subgraph group_monitoring["Monitoring"]
  node_server_sampling["Server sampling"]
  node_endpoint_checks["Endpoint checks"]
  node_check_scheduler["Check scheduler<br/>[apiScheduler.js]"]
  node_uptime["Uptime calculation<br/>[uptimeservice.js]"]
end

subgraph group_persistence["Persistence"]
  node_api_history[("Check history<br/>[apimonitor.js]")]
  node_monitor_registry[("Monitor registry<br/>[MonitoredApi.js]")]
  node_server_history[("Server metrics<br/>[ServerMetrics.js]")]
  node_database_config["Database connection<br/>[database.js]"]
end

node_user(("Operator"))
node_mongo[("MongoDB")]
node_host(("Monitored host"))
node_targets(("HTTP endpoints"))

node_user -->|"uses"| node_app
node_app -->|"routes"| node_landing
node_app -->|"routes"| node_overview
node_app -->|"routes"| node_endpoints
node_app -->|"routes"| node_detail
node_app -->|"routes"| node_containers
node_endpoints -->|"renders"| node_addmodal
node_addmodal -->|"calls"| node_api_client
node_overview -->|"calls"| node_api_client
node_detail -->|"calls"| node_api_client
node_api_client -->|"requests"| node_backend
node_backend -->|"starts sampling"| node_server_sampling
node_backend -->|"starts checks"| node_check_scheduler
node_backend -->|"checks endpoint"| node_endpoint_checks
node_backend -->|"calculates uptime"| node_uptime
node_backend -->|"reads and writes"| node_monitor_registry
node_backend -->|"reads history"| node_api_history
node_check_scheduler -->|"dispatches checks"| node_endpoint_checks
node_endpoint_checks -->|"writes results"| node_api_history
node_uptime -->|"reads checks"| node_api_history
node_backend -->|"reads metrics"| node_server_history
node_backend -->|"connects database"| node_database_config
node_database_config -->|"connects"| node_mongo
node_endpoint_checks -->|"sends HTTP checks"| node_targets
node_server_sampling -.->|"samples host"| node_host

click node_app "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/App.jsx"
click node_landing "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Landing.jsx"
click node_overview "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Overview.jsx"
click node_endpoints "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Endpoints.jsx"
click node_detail "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/EndpointDetail.jsx"
click node_containers "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Containers.jsx"
click node_addmodal "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/components/AddEndpointModal.jsx"
click node_api_client "https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/api/api.js"
click node_backend "https://github.com/kritisans25/devops-monitor/blob/main/backend/server.js"
click node_server_sampling "https://github.com/kritisans25/devops-monitor/blob/main/backend/services/monitoringServices.js"
click node_endpoint_checks "https://github.com/kritisans25/devops-monitor/blob/main/backend/services/apimonitorservices.js"
click node_check_scheduler "https://github.com/kritisans25/devops-monitor/blob/main/backend/services/apiScheduler.js"
click node_uptime "https://github.com/kritisans25/devops-monitor/blob/main/backend/services/uptimeservice.js"
click node_api_history "https://github.com/kritisans25/devops-monitor/blob/main/backend/models/apimonitor.js"
click node_monitor_registry "https://github.com/kritisans25/devops-monitor/blob/main/backend/models/MonitoredApi.js"
click node_server_history "https://github.com/kritisans25/devops-monitor/blob/main/backend/models/ServerMetrics.js"
click node_database_config "https://github.com/kritisans25/devops-monitor/blob/main/backend/config/database.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_landing,node_overview,node_endpoints,node_detail,node_containers,node_addmodal,node_api_client toneBlue
class node_backend,node_mongo toneAmber
class node_server_sampling,node_endpoint_checks,node_check_scheduler,node_uptime toneMint
class node_api_history,node_monitor_registry,node_server_history,node_database_config toneRose
class node_user,node_host,node_targets toneIndigo
```

## Components

### Dashboard

- [App routing](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Landing page](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Landing.jsx): `frontend/src/pages/Landing.jsx`
- [Infrastructure overview](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Overview.jsx): `frontend/src/pages/Overview.jsx`
- [Endpoint directory](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Endpoints.jsx): `frontend/src/pages/Endpoints.jsx`
- [Endpoint telemetry](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/EndpointDetail.jsx): `frontend/src/pages/EndpointDetail.jsx`
- [Container view](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/pages/Containers.jsx): `frontend/src/pages/Containers.jsx`
- [Add endpoint form](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/components/AddEndpointModal.jsx): `frontend/src/components/AddEndpointModal.jsx`
- [API client](https://github.com/kritisans25/devops-monitor/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`

### Backend API

- [HTTP routes](https://github.com/kritisans25/devops-monitor/blob/main/backend/server.js): `backend/server.js`

### Monitoring

- [Server sampling](https://github.com/kritisans25/devops-monitor/blob/main/backend/services/monitoringServices.js): `backend/services/monitoringServices.js`
- [Endpoint checks](https://github.com/kritisans25/devops-monitor/blob/main/backend/services/apimonitorservices.js): `backend/services/apimonitorservices.js`
- [Check scheduler](https://github.com/kritisans25/devops-monitor/blob/main/backend/services/apiScheduler.js): `backend/services/apiScheduler.js`
- [Uptime calculation](https://github.com/kritisans25/devops-monitor/blob/main/backend/services/uptimeservice.js): `backend/services/uptimeservice.js`

### Persistence

- [Check history](https://github.com/kritisans25/devops-monitor/blob/main/backend/models/apimonitor.js): `backend/models/apimonitor.js`
- [Monitor registry](https://github.com/kritisans25/devops-monitor/blob/main/backend/models/MonitoredApi.js): `backend/models/MonitoredApi.js`
- [Server metrics](https://github.com/kritisans25/devops-monitor/blob/main/backend/models/ServerMetrics.js): `backend/models/ServerMetrics.js`
- [Database connection](https://github.com/kritisans25/devops-monitor/blob/main/backend/config/database.js): `backend/config/database.js`

### Other components

- **Operator**
- **MongoDB**
- **Monitored host**
- **HTTP endpoints**

## Connections

- Operator → App routing: uses
- App routing → Landing page: routes (evidence: `frontend/src/App.jsx`)
- App routing → Infrastructure overview: routes (evidence: `frontend/src/App.jsx`)
- App routing → Endpoint directory: routes (evidence: `frontend/src/App.jsx`)
- App routing → Endpoint telemetry: routes (evidence: `frontend/src/App.jsx`)
- App routing → Container view: routes (evidence: `frontend/src/App.jsx`)
- Endpoint directory → Add endpoint form: renders (evidence: `frontend/src/pages/Endpoints.jsx`)
- Add endpoint form → API client: calls (evidence: `frontend/src/components/AddEndpointModal.jsx`)
- Infrastructure overview → API client: calls (evidence: `frontend/src/pages/Overview.jsx`)
- Endpoint telemetry → API client: calls (evidence: `frontend/src/pages/EndpointDetail.jsx`)
- API client → HTTP routes: requests (evidence: `frontend/src/api/api.js`)
- HTTP routes → Server sampling: starts sampling (evidence: `backend/server.js`)
- HTTP routes → Check scheduler: starts checks (evidence: `backend/server.js`)
- HTTP routes → Endpoint checks: checks endpoint (evidence: `backend/server.js`)
- HTTP routes → Uptime calculation: calculates uptime (evidence: `backend/server.js`)
- HTTP routes → Monitor registry: reads and writes (evidence: `backend/server.js`)
- HTTP routes → Check history: reads history (evidence: `backend/server.js`)
- Check scheduler → Endpoint checks: dispatches checks (evidence: `backend/services/apiScheduler.js`)
- Endpoint checks → Check history: writes results (evidence: `backend/services/apimonitorservices.js`)
- Uptime calculation → Check history: reads checks (evidence: `backend/services/uptimeservice.js`)
- HTTP routes → Server metrics: reads metrics (evidence: `backend/server.js`)
- HTTP routes → Database connection: connects database (evidence: `backend/server.js`)
- Database connection → MongoDB: connects (evidence: `backend/config/database.js`)
- Endpoint checks → HTTP endpoints: sends HTTP checks (evidence: `backend/services/apimonitorservices.js`)
- Server sampling → Monitored host: samples host
