# otniel113/gempabumi architecture

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

- Interactive diagram: https://gitdiagram.com/otniel113/gempabumi
- Repository: https://github.com/otniel113/gempabumi

## Overview

##### Project type and purpose
- This is a single-page, static web application whose sole purpose is to display live earthquake data from BMKG’s public JSON API. There is no custom backend or database—everything runs in the browser.

##### File structure
- Top level:
- index.html – the entry point, defines the page structure and the tabbed UI
- styles.css – presentation layer, mobile-responsive stylesheet
- script.js – application logic, responsible for fetching JSON and rendering three different datasets (latest quake, historical 15 with M≥5.0, historical 15 felt quakes)

##### README for additional insights
- The README confirms the three datasets, their JSON source, and the fact that the UI is mobile-friendly and always up to date. No mention of a build step or server-side code.

##### Elements
- Clear labels: “Browser (Client)”, “Static Hosting (Web Server)”, “BMKG JSON API”
- From Browser → Static Hosting (GET index.html, CSS, JS)
- From Browser → BMKG API (HTTP GET requests)
- From BMKG API → Browser (JSON responses)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client-Side Components
    subgraph "Browser (Client)" 
        direction TB
        UI["UI Structure"]:::client
        subgraph "Tabs" 
            direction TB
            Latest["Latest Quake Tab"]:::client
            M5["Historical M≥5.0 Tab"]:::client
            Felt["Historical Felt Tab"]:::client
        end
        Presentation["Presentation Layer (CSS)"]:::client
        FetchLogic["Data Fetching & DOM Updates"]:::client
    end

    %% Server & External
    StaticHosting["Static Hosting (Web Server)"]:::server
    BMKGAPI["BMKG JSON API"]:::external
    README["Project Documentation (README.md)"]:::doc

    %% Connections
    UI --> Tabs
    UI --> Presentation
    Presentation --> UI
    UI --> FetchLogic
    FetchLogic --> UI
    UI -->|"GET index.html, CSS, JS"| StaticHosting
    FetchLogic -->|"HTTP GET requests"| BMKGAPI
    BMKGAPI -->|"JSON responses"| FetchLogic

    %% Click events
    click UI "https://github.com/otniel113/gempabumi/blob/main/index.html"
    click Presentation "https://github.com/otniel113/gempabumi/blob/main/styles.css"
    click FetchLogic "https://github.com/otniel113/gempabumi/blob/main/script.js"
    click Latest "https://github.com/otniel113/gempabumi/blob/main/index.html"
    click Latest "https://github.com/otniel113/gempabumi/blob/main/script.js"
    click M5 "https://github.com/otniel113/gempabumi/blob/main/index.html"
    click M5 "https://github.com/otniel113/gempabumi/blob/main/script.js"
    click Felt "https://github.com/otniel113/gempabumi/blob/main/index.html"
    click Felt "https://github.com/otniel113/gempabumi/blob/main/script.js"
    click README "https://github.com/otniel113/gempabumi/blob/main/README.md"
    click StaticHosting "https://github.com/otniel113/gempabumi/blob/main/."

    %% Styles
    classDef client fill:#D6EAF8,stroke:#21618C,stroke-width:2px
    classDef server fill:#D5F5E3,stroke:#186A3B,stroke-width:2px
    classDef external fill:#FCF3CF,stroke:#B7950B,stroke-width:2px
    classDef doc fill:#EBEDEF,stroke:#85929E,stroke-width:2px
```
