# sykoramade/incidentdice architecture

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

- Interactive diagram: https://gitdiagram.com/sykoramade/incidentdice
- Repository: https://github.com/sykoramade/incidentdice

## Overview

##### File structure
- index.html: the single-page UI and application logic (likely includes embedded or linked JavaScript).
- incident_matrix.csv: the data file containing the dice outcomes or incident matrix.
- README.md: minimal project description.

##### README for additional insights
- There are no back-end services or additional instructions. Everything is expected to run in the client (browser) against a static CSV.

##### Main components and their relationships
a. Client (Browser):
- Loads index.html and any associated JS/CSS assets.
- Renders the UI (dice roller interface).
- Fetches incident_matrix.csv (via an HTTP GET request to the static server).
- Processes the matrix and displays roll results.
b. Static File Server:
- Hosts index.html and incident_matrix.csv.
- Serves all assets over HTTP or HTTPS.
c. Data Store:
- incident_matrix.csv acts as a simple lookup table. No database engine is involved.

Data flow:
Browser → HTTP GET index.html
Browser → HTTP GET incident_matrix.csv
Browser (JS) → Reads CSV, applies randomization logic → Updates UI

##### Architectural patterns and design principles
- Single-Page Application (SPA) style, but without a framework.
- Clear separation: Presentation layer (HTML/JS/CSS) vs. Data layer (CSV).
- No server-side logic: “server” is purely a static asset host.

## Diagram (Mermaid)

```mermaid
flowchart TB
    B["Browser (UI + JS)"]:::browser
    S["Static File Server"]:::server
    D["incident_matrix.csv"]:::data
    Doc["README.md"]:::doc

    B -->|"GET index.html, incident_matrix.csv"| S
    S -->|"Serves HTML + JS, CSV"| B
    B -->|"Parse CSV & random dice roll & update DOM"| B

    classDef browser fill:#e0f7fa,stroke:#0288d1,stroke-width:2px
    classDef server fill:#fff3e0,stroke:#ef6c00,stroke-width:2px
    classDef data fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
    classDef doc fill:#eceff1,stroke:#607d8b,stroke-width:2px

    click B "https://github.com/sykoramade/incidentdice/blob/main/index.html"
    click D "https://github.com/sykoramade/incidentdice/blob/main/incident_matrix.csv"
    click Doc "https://github.com/sykoramade/incidentdice/blob/main/README.md"
    click S "https://github.com/sykoramade/incidentdice/tree/main/project root directory"
```
