# sharkesh-17/scoutops--ss-portal architecture

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

- Interactive diagram: https://gitdiagram.com/sharkesh-17/scoutops--ss-portal
- Repository: https://github.com/sharkesh-17/scoutops--ss-portal

## Overview

ScoutOps lets campus users report infrastructure issues and maintenance staff track, assign, update, and resolve them through a web UI and REST API backed by PostgreSQL. The API also exposes health checks and Prometheus metrics. The README documents monitoring, deployment, backup, and rollback as operational capabilities. Runtime relationships are supported by the excerpts; operational links rely on README descriptions, since those implementation files were not sampled.

Main entry points: [`src/app.js`](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/app.js) (Issue REST API), [`monitoring/prometheus.yml`](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/prometheus.yml) (Prometheus), [`public/index.html`](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/public/index.html) (ScoutOps web UI), [`src/server.js`](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_issue["Issue management"]
  node_web_ui["ScoutOps web UI<br/>[index.html]"]
  node_issue_api["Issue REST API<br/>[app.js]"]
end

subgraph group_runtime["Application runtime"]
  node_app_server["HTTP server<br/>[server.js]"]
  node_db_access["Database access<br/>[db.js]"]
  node_postgres[("PostgreSQL<br/>[init.sql]")]
end

subgraph group_observability["Monitoring"]
  node_metrics["Metrics endpoint<br/>[app.js]"]
  node_prometheus["Prometheus<br/>[prometheus.yml]"]
  node_alert_rules["Alert rules<br/>[alerts.yml]"]
  node_grafana["Grafana datasource"]
end

subgraph group_operations["Operations"]
  node_deploy["Production deployment<br/>[deploy.sh]"]
  node_backup["Database backup<br/>[backup.sh]"]
  node_rollback["Image rollback<br/>[rollback.sh]"]
end

node_campus_users(("Students and staff"))
node_maintenance(("Maintenance team"))

node_campus_users -->|"report issues"| node_web_ui
node_web_ui -->|"fetches from"| node_issue_api
node_maintenance -->|"track issues"| node_web_ui
node_app_server -->|"serves"| node_issue_api
node_issue_api -->|"queries"| node_db_access
node_db_access -->|"queries"| node_postgres
node_issue_api -->|"exposes"| node_metrics
node_prometheus -->|"scrapes"| node_metrics
node_prometheus -->|"evaluates"| node_alert_rules
node_grafana -->|"uses datasource"| node_prometheus
node_deploy -->|"deploys"| node_app_server
node_backup -->|"backs up"| node_postgres
node_rollback -->|"restores image"| node_app_server

click node_web_ui "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/public/index.html"
click node_issue_api "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/app.js"
click node_app_server "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/server.js"
click node_db_access "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/db.js"
click node_postgres "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/db/init.sql"
click node_metrics "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/app.js"
click node_prometheus "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/prometheus.yml"
click node_alert_rules "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/alerts.yml"
click node_grafana "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/grafana-datasource.yml"
click node_deploy "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/scripts/deploy.sh"
click node_backup "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/scripts/backup.sh"
click node_rollback "https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/scripts/rollback.sh"

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_ui,node_issue_api toneBlue
class node_app_server,node_db_access,node_postgres toneAmber
class node_metrics,node_prometheus,node_alert_rules,node_grafana toneMint
class node_deploy,node_backup,node_rollback toneRose
class node_campus_users,node_maintenance toneIndigo
```

## Components

### Issue management

- [ScoutOps web UI](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/public/index.html): `public/index.html`
- [Issue REST API](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/app.js): `src/app.js`

### Application runtime

- [HTTP server](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/server.js): `src/server.js`
- [Database access](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/db.js): `src/db.js`
- [PostgreSQL](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/db/init.sql): `db/init.sql`

### Monitoring

- [Metrics endpoint](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/src/app.js): `src/app.js`
- [Prometheus](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/prometheus.yml): `monitoring/prometheus.yml`
- [Alert rules](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/alerts.yml): `monitoring/alerts.yml`
- [Grafana datasource](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/monitoring/grafana-datasource.yml): `monitoring/grafana-datasource.yml`

### Operations

- [Production deployment](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/scripts/deploy.sh): `scripts/deploy.sh`
- [Database backup](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/scripts/backup.sh): `scripts/backup.sh`
- [Image rollback](https://github.com/sharkesh-17/scoutops--ss-portal/blob/main/scripts/rollback.sh): `scripts/rollback.sh`

### Other components

- **Students and staff**
- **Maintenance team**

## Connections

- Students and staff → ScoutOps web UI: report issues (evidence: `README.md`)
- ScoutOps web UI → Issue REST API: fetches from (evidence: `README.md`)
- Maintenance team → ScoutOps web UI: track issues (evidence: `README.md`)
- HTTP server → Issue REST API: serves (evidence: `src/server.js`)
- Issue REST API → Database access: queries (evidence: `src/app.js`)
- Database access → PostgreSQL: queries (evidence: `README.md`)
- Issue REST API → Metrics endpoint: exposes (evidence: `src/app.js`)
- Prometheus → Metrics endpoint: scrapes (evidence: `README.md`)
- Prometheus → Alert rules: evaluates (evidence: `README.md`)
- Grafana datasource → Prometheus: uses datasource (evidence: `README.md`)
- Production deployment → HTTP server: deploys (evidence: `README.md`)
- Database backup → PostgreSQL: backs up (evidence: `README.md`)
- Image rollback → HTTP server: restores image (evidence: `README.md`)
