# sharkesh-17/scoutops-student-service-portal architecture

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

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

## Overview

ScoutOps lets campus users report and manage maintenance issues through a web UI and REST API, with issue records persisted in PostgreSQL. The sampled code shows the server starting the Express app, the app validating and handling issue requests, and its database calls. The README documents Prometheus/Grafana monitoring, but their runtime wiring was not sampled; those links reflect the documented architecture. The UI and monitoring branches are based on README capabilities and the available file tree.

Main entry points: [`src/server.js`](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/server.js) (HTTP server), [`public/index.html`](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/public/index.html) (Web interface), [`src/app.js`](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/app.js) (Issue API), [`src/db.js`](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/db.js) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Issue access"]
  node_web_ui["Web interface<br/>[index.html]"]
end

subgraph group_application["Application runtime"]
  node_server["HTTP server<br/>[server.js]"]
  node_issue_api["Issue API<br/>[app.js]"]
  node_metrics["Metrics endpoint<br/>[app.js]"]
end

subgraph group_persistence["Issue storage"]
  node_db_access["Database access<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_observability["Monitoring"]
  node_prometheus["Prometheus<br/>[prometheus.yml]"]
  node_grafana["Grafana"]
  node_alert_rules["Alert rules<br/>[alerts.yml]"]
end

node_campus_user(("Campus user"))

node_campus_user -->|"uses"| node_web_ui
node_web_ui -->|"sends requests"| node_server
node_server -->|"starts app"| node_issue_api
node_issue_api -->|"queries"| node_db_access
node_db_access -->|"reads and writes"| node_postgres
node_server -->|"serves routes"| node_metrics
node_metrics -->|"scrapes metrics"| node_prometheus
node_prometheus -->|"feeds data"| node_grafana
node_grafana -->|"supports alerts"| node_alert_rules

click node_web_ui "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/public/index.html"
click node_server "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/server.js"
click node_issue_api "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/app.js"
click node_metrics "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/app.js"
click node_db_access "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/db.js"
click node_prometheus "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/monitoring/prometheus.yml"
click node_grafana "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/monitoring/grafana-datasource.yml"
click node_alert_rules "https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/monitoring/alerts.yml"

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_campus_user toneBlue
class node_server,node_issue_api,node_metrics toneAmber
class node_db_access,node_postgres toneMint
class node_prometheus,node_grafana,node_alert_rules toneRose
```

## Components

### Issue access

- [Web interface](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/public/index.html): `public/index.html`

### Application runtime

- [HTTP server](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/server.js): `src/server.js`
- [Issue API](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/app.js): `src/app.js`
- [Metrics endpoint](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/app.js): `src/app.js`

### Issue storage

- [Database access](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/src/db.js): `src/db.js`
- **PostgreSQL**

### Monitoring

- [Prometheus](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/monitoring/prometheus.yml): `monitoring/prometheus.yml`
- [Grafana](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/monitoring/grafana-datasource.yml): `monitoring/grafana-datasource.yml`
- [Alert rules](https://github.com/sharkesh-17/scoutops-student-service-portal/blob/main/monitoring/alerts.yml): `monitoring/alerts.yml`

### Other components

- **Campus user**

## Connections

- Campus user → Web interface: uses (evidence: `README.md`)
- Web interface → HTTP server: sends requests (evidence: `README.md`)
- HTTP server → Issue API: starts app (evidence: `src/server.js`)
- Issue API → Database access: queries (evidence: `src/app.js`)
- Database access → PostgreSQL: reads and writes (evidence: `README.md`)
- HTTP server → Metrics endpoint: serves routes (evidence: `src/server.js`)
- Metrics endpoint → Prometheus: scrapes metrics (evidence: `README.md`)
- Prometheus → Grafana: feeds data (evidence: `README.md`)
- Grafana → Alert rules: supports alerts (evidence: `README.md`)
