# richardl05/infrastructure-monitoring-using-prometheus-and-grafana architecture

> Architecture diagram of the GitHub repository richardl05/infrastructure-monitoring-using-prometheus-and-grafana, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana
- Repository: https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana

## Overview

This repository combines a Spring Boot board-game website with a documented Prometheus/Grafana monitoring setup. The main user workflow serves game listings and details, then lets authorized users add games and create or edit reviews; controllers delegate persistence to JDBC access. A separate REST API exposes board games. README-documented monitoring components collect host and website-probe metrics and present them in Grafana. The monitoring configuration and exporters are described in the README, not implemented in the sampled Java sources.

Main entry points: [`src/main/java/com/javaproject/controllers/HomeController.java`](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/controllers/HomeController.java) (Page workflows), [`src/main/java/com/javaproject/database/DatabaseAccess.java`](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/database/DatabaseAccess.java) (JDBC access), [`src/main/java/com/javaproject/DatabaseServiceProjectApplication.java`](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/DatabaseServiceProjectApplication.java) (Spring Boot app), [`src/main/java/com/javaproject/controllers/BoardGameController.java`](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/controllers/BoardGameController.java) (Board-game REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Board-game Website"]
  node_spring["Spring Boot app"]
  node_home["Page workflows"]
  node_rest["Board-game REST API"]
  node_templates["Web pages"]
  node_browserjs["Form validation<br/>[script.js]"]
end

subgraph group_domain["Domain and Persistence"]
  node_boardgame["Board-game model<br/>[BoardGame.java]"]
  node_review["Review model<br/>[Review.java]"]
  node_error["API error model<br/>[ErrorMessage.java]"]
  node_dataaccess["JDBC access"]
  node_db[("Application database<br/>[schema.sql]")]
end

subgraph group_security["Identity and Access"]
  node_securityconfig["Security configuration"]
  node_denied["Denied access handler"]
  node_userstore[("User and role records")]
end

subgraph group_monitoring["Monitoring Stack"]
  node_nodeexporter["Node Exporter"]
  node_blackbox["Blackbox Exporter"]
  node_promconfig["Scrape configuration"]
  node_prometheus[("Prometheus")]
  node_grafana["Grafana dashboards"]
end

node_visitor(("Website visitor"))
node_admin(("Authorized user"))
node_externalweb(("External websites"))

node_visitor -->|"requests pages"| node_spring
node_admin -->|"uses website"| node_spring
node_spring -.->|"routes requests"| node_home
node_home -->|"loads and saves"| node_dataaccess
node_home -->|"creates users"| node_userstore
node_home -->|"selects views"| node_templates
node_visitor -.->|"requests API"| node_rest
node_rest -->|"loads and saves"| node_dataaccess
node_rest -->|"returns errors"| node_error
node_dataaccess -->|"queries and updates"| node_db
node_dataaccess -->|"maps records"| node_boardgame
node_dataaccess -->|"maps records"| node_review
node_boardgame -->|"contains reviews"| node_review
node_securityconfig -->|"authenticates users"| node_userstore
node_securityconfig -->|"delegates denial"| node_denied
node_denied -.->|"redirects denied requests"| node_home
node_visitor -->|"exposes host metrics"| node_nodeexporter
node_promconfig -->|"configures scrapes"| node_prometheus
node_prometheus -->|"scrapes metrics"| node_nodeexporter
node_prometheus -->|"requests probes"| node_blackbox
node_blackbox -->|"checks website"| node_spring
node_blackbox -->|"checks websites"| node_externalweb
node_grafana -->|"queries metrics"| node_prometheus

click node_spring "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/DatabaseServiceProjectApplication.java"
click node_home "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/controllers/HomeController.java"
click node_rest "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/controllers/BoardGameController.java"
click node_templates "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/tree/main/src/main/resources/templates"
click node_browserjs "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/resources/static/js/script.js"
click node_boardgame "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/beans/BoardGame.java"
click node_review "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/beans/Review.java"
click node_error "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/beans/ErrorMessage.java"
click node_dataaccess "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/database/DatabaseAccess.java"
click node_db "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/resources/schema.sql"
click node_securityconfig "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/security/SecurityConfig.java"
click node_denied "https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/security/LoggingAccessDeniedHandler.java"

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_spring,node_home,node_rest,node_templates,node_browserjs,node_admin toneBlue
class node_boardgame,node_review,node_error,node_dataaccess,node_db toneAmber
class node_securityconfig,node_denied,node_userstore toneMint
class node_nodeexporter,node_blackbox,node_promconfig,node_prometheus,node_grafana toneRose
class node_visitor,node_externalweb toneIndigo
```

## Components

### Board-game Website

- [Spring Boot app](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/DatabaseServiceProjectApplication.java): `src/main/java/com/javaproject/DatabaseServiceProjectApplication.java`
- [Page workflows](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/controllers/HomeController.java): `src/main/java/com/javaproject/controllers/HomeController.java`
- [Board-game REST API](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/controllers/BoardGameController.java): `src/main/java/com/javaproject/controllers/BoardGameController.java`
- [Web pages](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/tree/main/src/main/resources/templates): `src/main/resources/templates`
- [Form validation](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/resources/static/js/script.js): `src/main/resources/static/js/script.js`

### Domain and Persistence

- [Board-game model](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/beans/BoardGame.java): `src/main/java/com/javaproject/beans/BoardGame.java`
- [Review model](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/beans/Review.java): `src/main/java/com/javaproject/beans/Review.java`
- [API error model](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/beans/ErrorMessage.java): `src/main/java/com/javaproject/beans/ErrorMessage.java`
- [JDBC access](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/database/DatabaseAccess.java): `src/main/java/com/javaproject/database/DatabaseAccess.java`
- [Application database](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/resources/schema.sql): `src/main/resources/schema.sql`

### Identity and Access

- [Security configuration](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/security/SecurityConfig.java): `src/main/java/com/javaproject/security/SecurityConfig.java`
- [Denied access handler](https://github.com/richardl05/infrastructure-monitoring-using-prometheus-and-grafana/blob/main/src/main/java/com/javaproject/security/LoggingAccessDeniedHandler.java): `src/main/java/com/javaproject/security/LoggingAccessDeniedHandler.java`
- **User and role records**

### Monitoring Stack

- **Node Exporter**
- **Blackbox Exporter**
- **Scrape configuration**
- **Prometheus**
- **Grafana dashboards**

### Other components

- **Website visitor**
- **Authorized user**
- **External websites**

## Connections

- Website visitor → Spring Boot app: requests pages (evidence: `README.md`)
- Authorized user → Spring Boot app: uses website (evidence: `README.md`)
- Spring Boot app → Page workflows: routes requests
- Page workflows → JDBC access: loads and saves (evidence: `src/main/java/com/javaproject/controllers/HomeController.java`)
- Page workflows → User and role records: creates users (evidence: `src/main/java/com/javaproject/controllers/HomeController.java`)
- Page workflows → Web pages: selects views (evidence: `src/main/java/com/javaproject/controllers/HomeController.java`)
- Website visitor → Board-game REST API: requests API
- Board-game REST API → JDBC access: loads and saves (evidence: `src/main/java/com/javaproject/controllers/BoardGameController.java`)
- Board-game REST API → API error model: returns errors (evidence: `src/main/java/com/javaproject/controllers/BoardGameController.java`)
- JDBC access → Application database: queries and updates (evidence: `src/main/java/com/javaproject/database/DatabaseAccess.java`)
- JDBC access → Board-game model: maps records (evidence: `src/main/java/com/javaproject/database/DatabaseAccess.java`)
- JDBC access → Review model: maps records (evidence: `src/main/java/com/javaproject/database/DatabaseAccess.java`)
- Board-game model → Review model: contains reviews (evidence: `src/main/java/com/javaproject/beans/BoardGame.java`)
- Security configuration → User and role records: authenticates users (evidence: `src/main/java/com/javaproject/security/SecurityConfig.java`)
- Security configuration → Denied access handler: delegates denial (evidence: `src/main/java/com/javaproject/security/SecurityConfig.java`)
- Denied access handler → Page workflows: redirects denied requests
- Website visitor → Node Exporter: exposes host metrics (evidence: `README.md`)
- Scrape configuration → Prometheus: configures scrapes (evidence: `README.md`)
- Prometheus → Node Exporter: scrapes metrics (evidence: `README.md`)
- Prometheus → Blackbox Exporter: requests probes (evidence: `README.md`)
- Blackbox Exporter → Spring Boot app: checks website (evidence: `README.md`)
- Blackbox Exporter → External websites: checks websites (evidence: `README.md`)
- Grafana dashboards → Prometheus: queries metrics (evidence: `README.md`)
