# dani2159/uptime-server architecture

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

- Interactive diagram: https://gitdiagram.com/dani2159/uptime-server
- Repository: https://github.com/dani2159/uptime-server

## Overview

WatchTower is a Laravel uptime and API-health monitoring application. Operators configure monitors and notification channels, scheduled checks record status and logs, and status transitions can create incidents and trigger alerts; users then inspect dashboards, history, SLA reports, and public status pages. The graph also preserves API-health checks, DNS/IP and SSL checks, maintenance, escalation, and audit capabilities documented or represented in the tree. Some links rely on the README or SOURCE INDEX because their implementation excerpts were not provided.

Main entry points: [`routes/web.php`](https://github.com/dani2159/uptime-server/blob/main/routes/web.php) (Web routes), [`app/Console/Commands/CheckMonitors.php`](https://github.com/dani2159/uptime-server/blob/main/app/Console/Commands/CheckMonitors.php) (Scheduled monitor checks), [`app/Models/Monitor.php`](https://github.com/dani2159/uptime-server/blob/main/app/Models/Monitor.php) (Monitor records), [`app/Http/Controllers/DashboardController.php`](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/DashboardController.php) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_dashboard["Dashboard"]
  node_monitor_admin["Monitor management"]
  node_settings["Settings"]
end

subgraph group_monitoring["Monitoring"]
  node_monitor_records[("Monitor records<br/>[Monitor.php]")]
  node_check_command["Scheduled monitor checks<br/>[CheckMonitors.php]"]
  node_uptime_checker["Uptime checker<br/>[UptimeChecker.php]"]
  node_dns_resolver["DNS and IP lookup<br/>[DnsResolver.php]"]
  node_ssl_checker["SSL checks<br/>[SslChecker.php]"]
  node_monitor_logs[("Check history<br/>[MonitorLog.php]")]
end

subgraph group_incidents["Incidents and alerts"]
  node_maintenance[("Maintenance windows")]
  node_incidents[("Incident tracking<br/>[Incident.php]")]
  node_escalation["Escalation jobs"]
  node_notifications["Notification dispatch"]
  node_channels[("Notification channels")]
  node_notification_services["Telegram, WhatsApp, webhook"]
end

subgraph group_api["API health"]
  node_api_dashboard["API health dashboard"]
  node_api_registry["API health registry"]
  node_api_checkers["BPJS and Satu Sehat checks<br/>[BpjsChecker.php]"]
end

subgraph group_reporting["Status and reporting"]
  node_status_pages["Public status pages"]
  node_sla_reports["SLA reports"]
  node_audit["Audit logging<br/>[AuditService.php]"]
end

node_operator(("Operator"))
node_external_checks(("Monitored endpoints"))

node_operator -->|"uses"| node_web_routes
node_web_routes -->|"routes to"| node_dashboard
node_web_routes -->|"routes to"| node_monitor_admin
node_web_routes -->|"routes to"| node_settings
node_web_routes -->|"routes to"| node_api_dashboard
node_web_routes -->|"routes to"| node_status_pages
node_web_routes -->|"routes to"| node_sla_reports
node_monitor_admin -->|"creates and updates"| node_monitor_records
node_monitor_admin -->|"resolves IPs"| node_dns_resolver
node_monitor_admin -->|"checks SSL"| node_ssl_checker
node_check_command -->|"loads monitors"| node_monitor_records
node_check_command -->|"runs checks"| node_uptime_checker
node_check_command -->|"checks windows"| node_maintenance
node_check_command -->|"tracks transitions"| node_incidents
node_check_command -->|"dispatches alerts"| node_notifications
node_uptime_checker -->|"checks monitor"| node_monitor_records
node_uptime_checker -->|"saves results"| node_monitor_logs
node_external_checks -.->|"receives probes"| node_uptime_checker
node_dashboard -->|"checks on demand"| node_uptime_checker
node_dashboard -->|"requests alerts"| node_notifications
node_dashboard -->|"reads status"| node_monitor_records
node_dashboard -->|"reads history"| node_monitor_logs
node_notifications -->|"selects channels"| node_channels
node_notifications -->|"sends messages"| node_notification_services
node_notification_services -.->|"delivers alerts"| node_operator
node_escalation -->|"uses notifier"| node_notifications
node_escalation -->|"loads incident"| node_incidents
node_api_dashboard -->|"lists services"| node_api_registry
node_api_registry -->|"registers checkers"| node_api_checkers
node_status_pages -->|"reads services"| node_api_registry
node_status_pages -->|"reads monitors"| node_monitor_records
node_status_pages -->|"reads heartbeats"| node_monitor_logs
node_sla_reports -->|"reads incidents"| node_incidents
node_sla_reports -->|"reads uptime"| node_monitor_records
node_monitor_admin -->|"records actions"| node_audit
node_audit -->|"writes audit log"| node_audit
node_check_command -->|"resolves addresses"| node_dns_resolver

click node_web_routes "https://github.com/dani2159/uptime-server/blob/main/routes/web.php"
click node_dashboard "https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/DashboardController.php"
click node_monitor_admin "https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/MonitorController.php"
click node_settings "https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/SettingController.php"
click node_monitor_records "https://github.com/dani2159/uptime-server/blob/main/app/Models/Monitor.php"
click node_check_command "https://github.com/dani2159/uptime-server/blob/main/app/Console/Commands/CheckMonitors.php"
click node_uptime_checker "https://github.com/dani2159/uptime-server/blob/main/app/Services/UptimeChecker.php"
click node_dns_resolver "https://github.com/dani2159/uptime-server/blob/main/app/Services/DnsResolver.php"
click node_ssl_checker "https://github.com/dani2159/uptime-server/blob/main/app/Services/SslChecker.php"
click node_monitor_logs "https://github.com/dani2159/uptime-server/blob/main/app/Models/MonitorLog.php"
click node_maintenance "https://github.com/dani2159/uptime-server/blob/main/app/Models/MaintenanceWindow.php"
click node_incidents "https://github.com/dani2159/uptime-server/blob/main/app/Models/Incident.php"
click node_escalation "https://github.com/dani2159/uptime-server/blob/main/app/Jobs/EscalateIncidentJob.php"
click node_notifications "https://github.com/dani2159/uptime-server/blob/main/app/Services/NotificationService.php"
click node_channels "https://github.com/dani2159/uptime-server/blob/main/app/Models/NotificationChannel.php"
click node_api_dashboard "https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/BpjsDashboardController.php"
click node_api_registry "https://github.com/dani2159/uptime-server/blob/main/app/Services/ApiHealthRegistry.php"
click node_api_checkers "https://github.com/dani2159/uptime-server/blob/main/app/Services/BpjsChecker.php"
click node_status_pages "https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/StatusPageController.php"
click node_sla_reports "https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/SlaReportController.php"
click node_audit "https://github.com/dani2159/uptime-server/blob/main/app/Services/AuditService.php"

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_web_routes,node_dashboard,node_monitor_admin,node_settings toneBlue
class node_monitor_records,node_check_command,node_uptime_checker,node_dns_resolver,node_ssl_checker,node_monitor_logs toneAmber
class node_maintenance,node_incidents,node_escalation,node_notifications,node_channels,node_notification_services toneMint
class node_api_dashboard,node_api_registry,node_api_checkers toneRose
class node_status_pages,node_sla_reports,node_audit,node_operator,node_external_checks toneIndigo
```

## Components

### Web interface

- [Web routes](https://github.com/dani2159/uptime-server/blob/main/routes/web.php): `routes/web.php`
- [Dashboard](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Monitor management](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/MonitorController.php): `app/Http/Controllers/MonitorController.php`
- [Settings](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/SettingController.php): `app/Http/Controllers/SettingController.php`

### Monitoring

- [Monitor records](https://github.com/dani2159/uptime-server/blob/main/app/Models/Monitor.php): `app/Models/Monitor.php`
- [Scheduled monitor checks](https://github.com/dani2159/uptime-server/blob/main/app/Console/Commands/CheckMonitors.php): `app/Console/Commands/CheckMonitors.php`
- [Uptime checker](https://github.com/dani2159/uptime-server/blob/main/app/Services/UptimeChecker.php): `app/Services/UptimeChecker.php`
- [DNS and IP lookup](https://github.com/dani2159/uptime-server/blob/main/app/Services/DnsResolver.php): `app/Services/DnsResolver.php`
- [SSL checks](https://github.com/dani2159/uptime-server/blob/main/app/Services/SslChecker.php): `app/Services/SslChecker.php`
- [Check history](https://github.com/dani2159/uptime-server/blob/main/app/Models/MonitorLog.php): `app/Models/MonitorLog.php`

### Incidents and alerts

- [Maintenance windows](https://github.com/dani2159/uptime-server/blob/main/app/Models/MaintenanceWindow.php): `app/Models/MaintenanceWindow.php`
- [Incident tracking](https://github.com/dani2159/uptime-server/blob/main/app/Models/Incident.php): `app/Models/Incident.php`
- [Escalation jobs](https://github.com/dani2159/uptime-server/blob/main/app/Jobs/EscalateIncidentJob.php): `app/Jobs/EscalateIncidentJob.php`
- [Notification dispatch](https://github.com/dani2159/uptime-server/blob/main/app/Services/NotificationService.php): `app/Services/NotificationService.php`
- [Notification channels](https://github.com/dani2159/uptime-server/blob/main/app/Models/NotificationChannel.php): `app/Models/NotificationChannel.php`
- **Telegram, WhatsApp, webhook**

### API health

- [API health dashboard](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/BpjsDashboardController.php): `app/Http/Controllers/BpjsDashboardController.php`
- [API health registry](https://github.com/dani2159/uptime-server/blob/main/app/Services/ApiHealthRegistry.php): `app/Services/ApiHealthRegistry.php`
- [BPJS and Satu Sehat checks](https://github.com/dani2159/uptime-server/blob/main/app/Services/BpjsChecker.php): `app/Services/BpjsChecker.php`

### Status and reporting

- [Public status pages](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/StatusPageController.php): `app/Http/Controllers/StatusPageController.php`
- [SLA reports](https://github.com/dani2159/uptime-server/blob/main/app/Http/Controllers/SlaReportController.php): `app/Http/Controllers/SlaReportController.php`
- [Audit logging](https://github.com/dani2159/uptime-server/blob/main/app/Services/AuditService.php): `app/Services/AuditService.php`

### Other components

- **Operator**
- **Monitored endpoints**

## Connections

- Operator → Web routes: uses (evidence: `routes/web.php`)
- Web routes → Dashboard: routes to (evidence: `routes/web.php`)
- Web routes → Monitor management: routes to (evidence: `routes/web.php`)
- Web routes → Settings: routes to (evidence: `routes/web.php`)
- Web routes → API health dashboard: routes to (evidence: `routes/web.php`)
- Web routes → Public status pages: routes to (evidence: `routes/web.php`)
- Web routes → SLA reports: routes to (evidence: `routes/web.php`)
- Monitor management → Monitor records: creates and updates (evidence: `app/Http/Controllers/MonitorController.php`)
- Monitor management → DNS and IP lookup: resolves IPs (evidence: `app/Http/Controllers/MonitorController.php`)
- Monitor management → SSL checks: checks SSL (evidence: `app/Http/Controllers/MonitorController.php`)
- Scheduled monitor checks → Monitor records: loads monitors (evidence: `app/Console/Commands/CheckMonitors.php`)
- Scheduled monitor checks → Uptime checker: runs checks (evidence: `app/Console/Commands/CheckMonitors.php`)
- Scheduled monitor checks → Maintenance windows: checks windows (evidence: `app/Console/Commands/CheckMonitors.php`)
- Scheduled monitor checks → Incident tracking: tracks transitions (evidence: `app/Console/Commands/CheckMonitors.php`)
- Scheduled monitor checks → Notification dispatch: dispatches alerts (evidence: `app/Console/Commands/CheckMonitors.php`)
- Uptime checker → Monitor records: checks monitor (evidence: `app/Services/UptimeChecker.php`)
- Uptime checker → Check history: saves results (evidence: `app/Services/UptimeChecker.php`)
- Monitored endpoints → Uptime checker: receives probes
- Dashboard → Uptime checker: checks on demand (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → Notification dispatch: requests alerts (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → Monitor records: reads status (evidence: `app/Http/Controllers/DashboardController.php`)
- Dashboard → Check history: reads history (evidence: `app/Http/Controllers/DashboardController.php`)
- Notification dispatch → Notification channels: selects channels (evidence: `app/Services/NotificationService.php`)
- Notification dispatch → Telegram, WhatsApp, webhook: sends messages (evidence: `app/Services/NotificationService.php`)
- Telegram, WhatsApp, webhook → Operator: delivers alerts
- Escalation jobs → Notification dispatch: uses notifier (evidence: `app/Jobs/EscalateIncidentJob.php`)
- Escalation jobs → Incident tracking: loads incident (evidence: `app/Jobs/EscalateIncidentJob.php`)
- API health dashboard → API health registry: lists services
- API health registry → BPJS and Satu Sehat checks: registers checkers (evidence: `app/Providers/AppServiceProvider.php`)
- Public status pages → API health registry: reads services (evidence: `app/Http/Controllers/StatusPageController.php`)
- Public status pages → Monitor records: reads monitors (evidence: `app/Http/Controllers/StatusPageController.php`)
- Public status pages → Check history: reads heartbeats (evidence: `app/Http/Controllers/StatusPageController.php`)
- SLA reports → Incident tracking: reads incidents (evidence: `app/Http/Controllers/SlaReportController.php`)
- SLA reports → Monitor records: reads uptime (evidence: `app/Http/Controllers/SlaReportController.php`)
- Monitor management → Audit logging: records actions (evidence: `app/Http/Controllers/MonitorController.php`)
- Audit logging → Audit logging: writes audit log (evidence: `app/Services/AuditService.php`)
- Scheduled monitor checks → DNS and IP lookup: resolves addresses (evidence: `app/Console/Commands/CheckMonitors.php`)
