# jreyespetroil/upptime architecture

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

- Interactive diagram: https://gitdiagram.com/jreyespetroil/upptime
- Repository: https://github.com/jreyespetroil/upptime

## Overview

##### Project type and purpose
- This is an open-source uptime monitor and status page powered by Upptime. It runs entirely within a GitHub repository by polling a list of URLs/APIs, storing the results as files, generating graphs, and publishing a static status website via GitHub Pages.

##### File structure
- .github/workflows/ – GitHub Actions YAML files (“Uptime CI”, “Response Time CI”, “Graphs CI”, “Static Site CI”, “Summary CI”) that drive data collection, graph generation, site build, and deployment.
- api/ – JSON endpoints (response time & uptime metrics) for each monitored target.
- graphs/ – Generated PNG graphs (daily/weekly/monthly/yearly) for each endpoint.
- history/ – Raw time-series data (YAML) per endpoint and a summary.json.
- assets/ – Static assets (CSS/JS/images) for the status page.
- README.md, LICENSE – Documentation and metadata.

##### README for additional insights
- The README confirms use of GitHub Issues for incident reports, GitHub Actions for monitoring jobs, and GitHub Pages for hosting. It shows a status table that’s regenerated by the “Summary CI” workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Services
    ES["Monitored URLs/APIs"]:::external

    %% Configuration
    UPPC[".upptimerc.yml"]:::config

    %% Data Collection Workflows
    subgraph "Data Collection"
        direction TB
        UC["Uptime CI"]:::workflow
        RC["Response Time CI"]:::workflow
    end

    %% Data Stores
    subgraph "Data Stores"
        direction TB
        API["api/ (JSON endpoints)"]:::datastore
        HIST["history/ (YAML time-series)"]:::datastore
    end

    %% Data Processing Workflows
    subgraph "Data Processing"
        direction TB
        GC["Graphs CI"]:::workflow
        SC["Summary CI"]:::workflow
    end

    %% Generated Graphs
    GR["graphs/ (PNG)"]:::datastore

    %% Site Generation
    subgraph "Site Generation"
        direction TB
        SS["Static Site CI"]:::workflow
        AS["assets/ (CSS/JS/images)"]:::datastore
    end

    %% Hosting and Users
    subgraph "Hosting"
        direction TB
        GH["GitHub Pages"]:::hosting
        EU["End Users"]:::external
    end

    %% Repository Files
    subgraph "Repository Files"
        direction TB
        RD["README.md"]:::docs
        LIC["LICENSE"]:::docs
        ISS[".github/ISSUE_TEMPLATE/"]:::docs
    end

    %% Connections
    ES -->|cron trigger| UC
    ES -->|cron trigger| RC
    UPPC --> UC
    UPPC --> RC
    UC -->|ping → write JSON| API
    UC -->|append YAML| HIST
    RC -->|ping → write JSON| API
    RC -->|append YAML| HIST
    GC -->|reads history| HIST
    GC -->|writes graphs| GR
    SC -->|reads API & history| API
    SC -->|updates README & summary.json| RD
    SC --> RD
    SS -->|build site using assets, API, graphs| AS
    SS -->|deploy| GH
    GR --> SS
    API --> SS
    DHISTORY(HIST) --> SC
    GH -->|serves| EU

    %% Click Events
    click UC "https://github.com/jreyespetroil/upptime/blob/master/.github/workflows/uptime.yml"
    click RC "https://github.com/jreyespetroil/upptime/blob/master/.github/workflows/response-time.yml"
    click GC "https://github.com/jreyespetroil/upptime/blob/master/.github/workflows/graphs.yml"
    click SC "https://github.com/jreyespetroil/upptime/blob/master/.github/workflows/summary.yml"
    click SS "https://github.com/jreyespetroil/upptime/blob/master/.github/workflows/site.yml"
    click UPPC "https://github.com/jreyespetroil/upptime/blob/master/.upptimerc.yml"
    click API "https://github.com/jreyespetroil/upptime/tree/master/api/"
    click HIST "https://github.com/jreyespetroil/upptime/tree/master/history/"
    click GR "https://github.com/jreyespetroil/upptime/tree/master/graphs/"
    click AS "https://github.com/jreyespetroil/upptime/tree/master/assets/"
    click ISS "https://github.com/jreyespetroil/upptime/tree/master/.github/ISSUE_TEMPLATE/"
    click RD "https://github.com/jreyespetroil/upptime/blob/master/README.md"
    click LIC "https://github.com/jreyespetroil/upptime/tree/master/LICENSE"

    %% Styles
    classDef external fill:#D0E8FF,stroke:#1B4F72
    classDef workflow fill:#D5F5E3,stroke:#1E8449
    classDef datastore fill:#FAD7A0,stroke:#B9770E
    classDef hosting fill:#D7BDE2,stroke:#6C3483
    classDef config fill:#AED6F1,stroke:#1F618D
    classDef docs fill:#F9E79F,stroke:#B7950B
```
