# bal16/spk-gis architecture

> Architecture diagram of the GitHub repository bal16/spk-gis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bal16/spk-gis
- Repository: https://github.com/bal16/spk-gis

## Overview

SPK-GIS is a web-based decision-support system for prioritizing building maintenance. Visitors view building locations and rankings; administrators sign in, manage buildings and condition assessments, configure criterion weights, and run SAW prioritization. The resulting rankings are presented on the map and saved as auditable snapshots. The README documents the product capabilities and frontend/backend split, but no source excerpts were provided, so the graph uses only those documented relationships and does not infer finer internal call paths.

Main entry points: [`frontend`](https://github.com/bal16/spk-gis/tree/main/frontend) (Admin area), [`backend`](https://github.com/bal16/spk-gis/tree/main/backend) (SAW calculation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_public_map["Public map and rankings"]
  node_admin_area["Admin area"]
  node_guided_tour["Interactive tour"]
end

subgraph group_operations["Building assessment"]
  node_building_management["Building management"]
  node_condition_assessment["Condition assessments"]
  node_assessment_history["Assessment history"]
end

subgraph group_decision["Prioritization"]
  node_criterion_weights["Criterion weights"]
  node_saw_calculation["SAW calculation"]
  node_priority_snapshots["Decision snapshots"]
end

subgraph group_platform["API and persistence"]
  node_api["Backend API"]
  node_database[("PostgreSQL database")]
end

node_visitor(("Visitor"))
node_admin(("Administrator"))

node_visitor -->|"views"| node_public_map
node_admin -->|"signs into"| node_admin_area
node_admin_area -->|"offers guidance"| node_guided_tour
node_admin_area -->|"manages buildings"| node_building_management
node_admin_area -->|"records assessments"| node_condition_assessment
node_condition_assessment -->|"retains history"| node_assessment_history
node_admin_area -->|"configures weights"| node_criterion_weights
node_admin_area -->|"runs prioritization"| node_saw_calculation
node_saw_calculation -->|"uses weights"| node_criterion_weights
node_saw_calculation -->|"saves snapshot"| node_priority_snapshots
node_priority_snapshots -->|"provides rankings"| node_public_map
node_admin_area -->|"uses API"| node_api
node_public_map -->|"requests data"| node_api
node_api -->|"persists application data"| node_database

click node_public_map "https://github.com/bal16/spk-gis/tree/main/frontend"
click node_admin_area "https://github.com/bal16/spk-gis/tree/main/frontend"
click node_guided_tour "https://github.com/bal16/spk-gis/tree/main/frontend"
click node_building_management "https://github.com/bal16/spk-gis/tree/main/backend"
click node_condition_assessment "https://github.com/bal16/spk-gis/tree/main/backend"
click node_assessment_history "https://github.com/bal16/spk-gis/tree/main/backend"
click node_criterion_weights "https://github.com/bal16/spk-gis/tree/main/backend"
click node_saw_calculation "https://github.com/bal16/spk-gis/tree/main/backend"
click node_priority_snapshots "https://github.com/bal16/spk-gis/tree/main/backend"
click node_api "https://github.com/bal16/spk-gis/tree/main/backend"

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_public_map,node_admin_area,node_guided_tour toneBlue
class node_building_management,node_condition_assessment,node_assessment_history toneAmber
class node_criterion_weights,node_saw_calculation,node_priority_snapshots toneMint
class node_api,node_database toneRose
class node_visitor,node_admin toneIndigo
```

## Components

### Web experience

- [Public map and rankings](https://github.com/bal16/spk-gis/tree/main/frontend): `frontend`
- [Admin area](https://github.com/bal16/spk-gis/tree/main/frontend): `frontend`
- [Interactive tour](https://github.com/bal16/spk-gis/tree/main/frontend): `frontend`

### Building assessment

- [Building management](https://github.com/bal16/spk-gis/tree/main/backend): `backend`
- [Condition assessments](https://github.com/bal16/spk-gis/tree/main/backend): `backend`
- [Assessment history](https://github.com/bal16/spk-gis/tree/main/backend): `backend`

### Prioritization

- [Criterion weights](https://github.com/bal16/spk-gis/tree/main/backend): `backend`
- [SAW calculation](https://github.com/bal16/spk-gis/tree/main/backend): `backend`
- [Decision snapshots](https://github.com/bal16/spk-gis/tree/main/backend): `backend`

### API and persistence

- [Backend API](https://github.com/bal16/spk-gis/tree/main/backend): `backend`
- **PostgreSQL database**

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Public map and rankings: views (evidence: `README.md`)
- Administrator → Admin area: signs into (evidence: `README.md`)
- Admin area → Interactive tour: offers guidance (evidence: `README.md`)
- Admin area → Building management: manages buildings (evidence: `README.md`)
- Admin area → Condition assessments: records assessments (evidence: `README.md`)
- Condition assessments → Assessment history: retains history (evidence: `README.md`)
- Admin area → Criterion weights: configures weights (evidence: `README.md`)
- Admin area → SAW calculation: runs prioritization (evidence: `README.md`)
- SAW calculation → Criterion weights: uses weights (evidence: `README.md`)
- SAW calculation → Decision snapshots: saves snapshot (evidence: `README.md`)
- Decision snapshots → Public map and rankings: provides rankings (evidence: `README.md`)
- Admin area → Backend API: uses API (evidence: `README.md`)
- Public map and rankings → Backend API: requests data (evidence: `README.md`)
- Backend API → PostgreSQL database: persists application data (evidence: `README.md`)
