# koteswarraobyline-boop/scholario-ops-byline architecture

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

- Interactive diagram: https://gitdiagram.com/koteswarraobyline-boop/scholario-ops-byline
- Repository: https://github.com/koteswarraobyline-boop/scholario-ops-byline

## Overview

Scholario Ops is an operations dashboard for primary and disaster-recovery VPS applications. Administrators configure servers, applications, monitors, and integrations in the dashboard; the backend persists configuration in PostgreSQL, probes application endpoints, receives agent telemetry, and reads provider health. It presents operational status, incidents, analytics, and DR readiness, while failover remains a reviewed manual workflow that records an audit decision rather than changing Cloudflare. Some subsystem links reflect README documentation because their implementation files were not excerpted.

Main entry points: [`server/engine.ts`](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/engine.ts) (Monitoring engine), [`src/context/OpsContext.tsx`](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/context/OpsContext.tsx) (Operations context), [`src/App.tsx`](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/App.tsx) (Dashboard views), [`server/server.ts`](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/server.ts) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_dashboard["Dashboard views<br/>[App.tsx]"]
  node_setup["Setup and connections<br/>[SetupView.tsx]"]
  node_opscontext["Operations context<br/>[OpsContext.tsx]"]
  node_authcontext["Authentication context<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_ops_views["Operations views<br/>[OverviewView.tsx]"]
  node_provider_views["Provider views<br/>[CloudflareView.tsx]"]
  node_communications_view["Communications view"]
end

subgraph group_api["Backend API"]
  node_server["API server<br/>[server.ts]"]
  node_routes["API routes<br/>[routes.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
end

subgraph group_operations["Monitoring and resilience"]
  node_engine["Monitoring engine<br/>[engine.ts]"]
  node_probes["Endpoint probes<br/>[probes.ts]"]
  node_agent["VPS agent reporting<br/>[agent.ts]"]
  node_telemetry["Telemetry processing<br/>[telemetry.ts]"]
  node_incidents["Incidents and alerts<br/>[alerts.ts]"]
  node_readiness["DR readiness<br/>[readiness.ts]"]
  node_failover["Failover preflight<br/>[routes.ts]"]
end

subgraph group_integrations["External integrations"]
  node_cloudflare["Cloudflare monitoring<br/>[cloudflare.ts]"]
  node_loadbalancer["Load balancer health<br/>[loadbalancer.ts]"]
  node_hostinger["Hostinger provider data<br/>[hostinger.ts]"]
end

subgraph group_data["State and communications"]
  node_notification["Notification delivery<br/>[notify.ts]"]
  node_events["Events and audit<br/>[events.ts]"]
  node_store[("Operational store<br/>[store.ts]")]
end

node_admin(("Administrator"))
node_postgres[("PostgreSQL")]
node_app_endpoints["Monitored app endpoints"]
node_vps_agents(("VPS agents"))
node_cloudflare_service["Cloudflare API"]
node_hostinger_service["Hostinger API"]
node_channels["Notification channels"]

node_admin -->|"uses"| node_dashboard
node_dashboard -->|"routes to"| node_setup
node_dashboard -->|"routes to"| node_ops_views
node_dashboard -->|"routes to"| node_provider_views
node_dashboard -.->|"routes to"| node_communications_view
node_admin -->|"configures"| node_setup
node_setup -->|"uses"| node_opscontext
node_ops_views -->|"reads state"| node_opscontext
node_provider_views -->|"reads state"| node_opscontext
node_communications_view -->|"reads state"| node_opscontext
node_opscontext -->|"calls"| node_api_client
node_authcontext -->|"uses"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -->|"registers"| node_routes
node_routes -->|"authenticates"| node_auth
node_routes -->|"runs preflight"| node_failover
node_engine -->|"runs probes"| node_probes
node_probes -->|"checks"| node_app_endpoints
node_vps_agents -->|"reports telemetry"| node_server
node_engine -->|"applies reports"| node_telemetry
node_engine -->|"persists"| node_store
node_engine -->|"broadcasts"| node_events
node_server -->|"starts"| node_engine
node_engine -->|"reads health"| node_cloudflare
node_cloudflare -->|"polls"| node_cloudflare_service
node_loadbalancer -->|"uses"| node_cloudflare
node_server -->|"uses"| node_hostinger
node_hostinger -->|"imports data"| node_hostinger_service
node_engine -->|"raises incidents"| node_incidents
node_incidents -->|"sends alerts"| node_notification
node_notification -->|"delivers to"| node_channels
node_failover -->|"checks readiness"| node_readiness
node_readiness -->|"reads configuration"| node_store
node_store -->|"reads and writes"| node_postgres
node_events -->|"persists audit"| node_store
node_failover -->|"records decision"| node_events
node_events -.->|"streams updates"| node_opscontext

click node_dashboard "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/App.tsx"
click node_setup "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/setup/SetupView.tsx"
click node_opscontext "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/context/OpsContext.tsx"
click node_authcontext "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/context/AuthContext.tsx"
click node_api_client "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/services/api.ts"
click node_ops_views "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/overview/OverviewView.tsx"
click node_provider_views "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/providers/CloudflareView.tsx"
click node_communications_view "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/communications/CommunicationsView.tsx"
click node_server "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/server.ts"
click node_routes "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/routes.ts"
click node_auth "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/auth.ts"
click node_engine "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/engine.ts"
click node_probes "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/probes.ts"
click node_agent "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/agent.ts"
click node_telemetry "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/telemetry.ts"
click node_incidents "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/alerts.ts"
click node_readiness "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/readiness.ts"
click node_failover "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/routes.ts"
click node_cloudflare "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/cloudflare.ts"
click node_loadbalancer "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/loadbalancer.ts"
click node_hostinger "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/hostinger.ts"
click node_notification "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/notify.ts"
click node_events "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/events.ts"
click node_store "https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/store.ts"

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_dashboard,node_setup,node_opscontext,node_authcontext,node_api_client,node_ops_views,node_provider_views,node_communications_view toneBlue
class node_server,node_routes,node_auth,node_postgres toneAmber
class node_engine,node_probes,node_agent,node_telemetry,node_incidents,node_readiness,node_failover,node_cloudflare_service,node_hostinger_service toneMint
class node_cloudflare,node_loadbalancer,node_hostinger toneRose
class node_notification,node_events,node_store,node_admin,node_app_endpoints,node_vps_agents,node_channels toneIndigo
```

## Components

### Dashboard

- [Dashboard views](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/App.tsx): `src/App.tsx`
- [Setup and connections](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/setup/SetupView.tsx): `src/components/setup/SetupView.tsx`
- [Operations context](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/context/OpsContext.tsx): `src/context/OpsContext.tsx`
- [Authentication context](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [API client](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/services/api.ts): `src/services/api.ts`
- [Operations views](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/overview/OverviewView.tsx): `src/components/overview/OverviewView.tsx`
- [Provider views](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/providers/CloudflareView.tsx): `src/components/providers/CloudflareView.tsx`
- [Communications view](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/src/components/communications/CommunicationsView.tsx): `src/components/communications/CommunicationsView.tsx`

### Backend API

- [API server](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/server.ts): `server/server.ts`
- [API routes](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/routes.ts): `server/routes.ts`
- [Authentication](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/auth.ts): `server/auth.ts`

### Monitoring and resilience

- [Monitoring engine](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/engine.ts): `server/engine.ts`
- [Endpoint probes](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/probes.ts): `server/probes.ts`
- [VPS agent reporting](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/agent.ts): `server/agent.ts`
- [Telemetry processing](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/telemetry.ts): `server/telemetry.ts`
- [Incidents and alerts](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/alerts.ts): `server/alerts.ts`
- [DR readiness](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/readiness.ts): `server/readiness.ts`
- [Failover preflight](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/routes.ts): `server/routes.ts`

### External integrations

- [Cloudflare monitoring](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/cloudflare.ts): `server/cloudflare.ts`
- [Load balancer health](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/loadbalancer.ts): `server/loadbalancer.ts`
- [Hostinger provider data](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/hostinger.ts): `server/hostinger.ts`

### State and communications

- [Notification delivery](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/notify.ts): `server/notify.ts`
- [Events and audit](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/events.ts): `server/events.ts`
- [Operational store](https://github.com/koteswarraobyline-boop/scholario-ops-byline/blob/main/server/store.ts): `server/store.ts`

### Other components

- **Administrator**
- **PostgreSQL**
- **Monitored app endpoints**
- **VPS agents**
- **Cloudflare API**
- **Hostinger API**
- **Notification channels**

## Connections

- Administrator → Dashboard views: uses (evidence: `README.md`)
- Dashboard views → Setup and connections: routes to (evidence: `src/App.tsx`)
- Dashboard views → Operations views: routes to (evidence: `src/App.tsx`)
- Dashboard views → Provider views: routes to (evidence: `src/App.tsx`)
- Dashboard views → Communications view: routes to (evidence: `src/App.tsx`)
- Administrator → Setup and connections: configures (evidence: `README.md`)
- Setup and connections → Operations context: uses (evidence: `src/components/setup/SetupView.tsx`)
- Operations views → Operations context: reads state (evidence: `src/components/overview/OverviewView.tsx`)
- Provider views → Operations context: reads state (evidence: `src/components/providers/CloudflareView.tsx`)
- Communications view → Operations context: reads state (evidence: `src/components/communications/CommunicationsView.tsx`)
- Operations context → API client: calls (evidence: `src/context/OpsContext.tsx`)
- Authentication context → API client: uses (evidence: `src/context/AuthContext.tsx`)
- API client → API server: HTTP requests (evidence: `README.md`)
- API server → API routes: registers (evidence: `server/server.ts`)
- API routes → Authentication: authenticates (evidence: `server/routes.ts`)
- API routes → Failover preflight: runs preflight (evidence: `README.md`)
- Monitoring engine → Endpoint probes: runs probes (evidence: `server/engine.ts`)
- Endpoint probes → Monitored app endpoints: checks (evidence: `README.md`)
- VPS agents → API server: reports telemetry (evidence: `README.md`)
- Monitoring engine → Telemetry processing: applies reports (evidence: `server/engine.ts`)
- Monitoring engine → Operational store: persists (evidence: `server/engine.ts`)
- Monitoring engine → Events and audit: broadcasts (evidence: `server/engine.ts`)
- API server → Monitoring engine: starts (evidence: `server/server.ts`)
- Monitoring engine → Cloudflare monitoring: reads health (evidence: `server/engine.ts`)
- Cloudflare monitoring → Cloudflare API: polls (evidence: `README.md`)
- Load balancer health → Cloudflare monitoring: uses (evidence: `server/loadbalancer.ts`)
- API server → Hostinger provider data: uses (evidence: `server/server.ts`)
- Hostinger provider data → Hostinger API: imports data (evidence: `README.md`)
- Monitoring engine → Incidents and alerts: raises incidents (evidence: `README.md`)
- Incidents and alerts → Notification delivery: sends alerts (evidence: `server/alerts.ts`)
- Notification delivery → Notification channels: delivers to (evidence: `README.md`)
- Failover preflight → DR readiness: checks readiness (evidence: `server/routes.ts`)
- DR readiness → Operational store: reads configuration (evidence: `README.md`)
- Operational store → PostgreSQL: reads and writes (evidence: `README.md`)
- Events and audit → Operational store: persists audit (evidence: `server/events.ts`)
- Failover preflight → Events and audit: records decision (evidence: `README.md`)
- Events and audit → Operations context: streams updates
