# calispec-balaji/github_actions architecture

> Architecture diagram of the GitHub repository calispec-balaji/github_actions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/calispec-balaji/github_actions
- Repository: https://github.com/calispec-balaji/github_actions

## Overview

##### Project type + purpose (what you’re diagramming)
This repo is a **frontend-only Single Page Application (SPA) template**: **React + TypeScript + Vite**. There is **no backend/service layer** in the tree; the “system” is primarily:
- a **browser runtime** (React app)
- a **build/dev toolchain** (Vite, TypeScript, ESLint)
- **static asset serving** (Vite dev server in dev; static hosting in prod)
- **containerization + CI performance checks** (Dockerfile, GitHub Actions workflow, Lighthouse config)

##### Runtime (what runs in the browser)
- `index.html` — Vite entry HTML; bootstraps the SPA
- `src/main.tsx` — React entrypoint; mounts the app to the DOM
- `src/App.tsx` — root component
- `src/assets/*` — bundled assets (imported in code)
- `public/*` — static assets copied as-is (not bundled)
- `src/*.css` — styling pipeline (bundled via Vite)

##### Build/dev toolchain (what produces the runtime)
- `vite.config.ts` — bundler/dev server configuration (plugins, base path, etc.)
- `tsconfig*.json` — split TS configs for app vs node tooling
- `eslint.config.js` — linting rules (quality gate)
- `package.json` / `package-lock.json` — dependency graph and scripts

##### Delivery / automation (how it ships / is validated)
- `.github/workflows/performance.yml` + `lighthouserc.cjs` + `PERFORMANCE_CI.md` — CI job that runs Lighthouse (performance/quality regression gate)

##### What to include as “main components”
Break the system into **as many components as is reasonable**, even if they’re simple:

##### User Browser
2. **Static Hosting Origin** (choose the intended target generically: “CDN / Static host / Nginx container”)
##### React App
- `main.tsx` (bootstrapping)
- `App.tsx` (root UI)
##### Static Assets
- `/public` (copied as-is)
- `/src/assets` (bundled)

- Browser → Static Host: `GET /index.html`, `GET /assets/*.js`, `GET /assets/*.css`, images/fonts
- `index.html` → loads bundled JS/CSS
- Bundled JS → mounts React into DOM (`main.tsx`)

##### Vite Dev Server
- HMR / Fast Refresh
##### Browser (local)

- Developer edits `src/*` → Vite transforms → Browser receives HMR updates
- Vite reads `index.html` as the entry boundary

##### Vite Build
2. **TypeScript compile/typecheck** (even if Vite transpiles, TS config still defines types and build constraints)
##### Static Server / Container Image (if Docker is used for serving)

**Relationships**
- `src/*` + `index.html` + configs → Vite → `dist/`
- `dist/` → deployed to hosting or copied into container

##### Reports / thresholds (fail/pass gate)

**Relationships**
- GitHub Actions → install deps → build → run Lighthouse → upload/store results / enforce budgets

##### Important patterns/design principles to reflect
- **SPA + static deployment**: no server-side rendering or backend in repo.
- **Entry-point driven UI**: `index.html` → `main.tsx` → `App.tsx` → component tree.
- **Bundled vs unbundled assets**:
- `public/` = served as-is
- `src/assets/` = fingerprinted/bundled
- **Separation of concerns**:
- runtime UI code in `src/`
- tooling/config at repo root
- CI in `.github/workflows/`

## Diagram (Mermaid)

```mermaid
flowchart TD

%% =========================
%% Diagram A — Runtime & Deployment
%% =========================
subgraph "Diagram A — Runtime & Deployment (Production Request Flow)"
  direction TB

  subgraph "User Device"
    direction TB
    Browser["User Browser"]:::runtime
    subgraph "SPA Runtime (in Browser)"
      direction TB
      HTML["HTML Entry (index.html)"]:::runtime
      Main["React Bootstrap (main.tsx)"]:::runtime
      App["React Root UI (App.tsx)"]:::runtime
      Tree["Component Tree (future feature modules)"]:::runtime
      CSSApp["App Styling (App.css)"]:::asset
      CSSGlobal["Global Styling (index.css)"]:::asset
    end
  end

  subgraph "Static Delivery"
    direction TB
    Host["Static Hosting Origin (CDN / Static Host / Nginx)"]:::runtime
    Bundled["Bundled Build Output (assets/*.js, assets/*.css)"]:::asset
    PublicAssets["Public Assets (copied as-is)"]:::asset
    SrcAssets["Bundled Assets (fingerprinted)"]:::asset
  end

  Browser -->|"HTTP_GET /index.html"| Host
  Browser -->|"HTTP_GET /assets/*.js"| Host
  Browser -->|"HTTP_GET /assets/*.css"| Host
  Browser -->|"HTTP_GET images/fonts"| Host

  Host -->|"serves"| HTML
  HTML -->|"loads_JS/CSS_bundle"| Bundled
  Bundled -->|"executes"| Main
  Main -->|"mounts_React_into_DOM"| App
  App -->|"renders"| Tree

  Host -->|"serves_static"| PublicAssets
  Host -->|"serves_fingerprinted"| SrcAssets
  CSSApp -->|"bundled_into"| Bundled
  CSSGlobal -->|"bundled_into"| Bundled
end

%% =========================
%% Diagram B — Dev, Build & CI
%% =========================
subgraph "Diagram B — Dev Workflow, Build Artifact, CI Quality Gates"
  direction TB

  subgraph "Local Development"
    direction TB
    Dev["Developer Machine"]:::tooling
    Src["Source Code (src/*)"]:::tooling
    ViteDev["Vite Dev Server (HMR)"]:::tooling
    LocalBrowser["Local Browser (dev)"]:::runtime

    Dev -->|"edits"| Src
    ViteDev -->|"reads_entry_boundary"| HTML
    Src -->|"transforms_modules"| ViteDev
    ViteDev -->|"HMR_websocket/module_updates"| LocalBrowser
    LocalBrowser -->|"requests_modules"| ViteDev
  end

  subgraph "Build & Packaging"
    direction TB
    ViteBuild["Vite Build"]:::tooling
    TS["TypeScript Typecheck (tsconfig*)"]:::tooling
    ESLint["ESLint (quality gate)"]:::tooling
    Deps["Dependencies & Scripts (npm)"]:::tooling
    Dist["Build Artifact (dist/)"]:::artifact
    Docker["Container Build (static serving option)"]:::deploy
    DeployTarget["Deployment Target (CDN/Static Host)"]:::deploy

    Deps -->|"install_deps"| ViteBuild
    Src -->|"input_sources"| ViteBuild
    HTML -->|"input_entry"| ViteBuild
    ViteBuild -->|"outputs"| Dist

    TS -->|"type_constraints"| ViteBuild
    ESLint -->|"lint_rules"| ViteBuild

    Dist -->|"upload_static"| DeployTarget
    Dist -->|"copy_into_image"| Docker
    Docker -->|"serves_static"| DeployTarget
  end

  subgraph "CI — Performance Validation"
    direction TB
    GHA["GitHub Actions Workflow (Performance CI)"]:::ci
    LH["Lighthouse CI"]:::ci
    Reports["Reports & Threshold Gate (pass/fail)"]:::ci
    Docs["Performance CI Docs"]:::doc

    GHA -->|"ci_install_deps"| Deps
    GHA -->|"ci_build"| ViteBuild
    GHA -->|"run_audit"| LH
    LH -->|"enforce_thresholds"| Reports
    Reports -->|"fail_or_pass_pipeline"| GHA
    Docs -->|"documents_process"| GHA
  end
end

%% =========================
%% Config & Root Tooling Evidence Links
%% =========================
ViteCfg["Vite Config (vite.config.ts)"]:::tooling
TSRoot["tsconfig.json"]:::tooling
TSApp["tsconfig.app.json"]:::tooling
TSNode["tsconfig.node.json"]:::tooling
Pkg["package.json"]:::tooling
PkgLock["package-lock.json"]:::tooling
DockerIgnore[".dockerignore"]:::deploy
Workflow["performance.yml"]:::ci
LHCfg["lighthouserc.cjs"]:::ci
SrcAssets -->|"sources_from"| ViteBuild
PublicAssets -->|"copied_verbatim"| Dist

ViteCfg -->|"configures"| ViteDev
ViteCfg -->|"configures"| ViteBuild
TSRoot -->|"base_config"| TS
TSApp -->|"app_types"| TS
TSNode -->|"tooling_types"| TS
Pkg -->|"defines_scripts"| Deps
PkgLock -->|"locks_versions"| Deps
DockerIgnore -->|"excludes_from_context"| Docker
Workflow -->|"defines_job"| GHA
LHCfg -->|"audit_config"| LH

%% =========================
%% Click Events (component_mapping)
%% =========================
click HTML "https://github.com/calispec-balaji/github_actions/blob/main/index.html"
click Main "https://github.com/calispec-balaji/github_actions/blob/main/src/main.tsx"
click App "https://github.com/calispec-balaji/github_actions/blob/main/src/App.tsx"
click CSSApp "https://github.com/calispec-balaji/github_actions/blob/main/src/App.css"
click CSSGlobal "https://github.com/calispec-balaji/github_actions/blob/main/src/index.css"
click SrcAssets "https://github.com/calispec-balaji/github_actions/tree/main/src/assets/"
click PublicAssets "https://github.com/calispec-balaji/github_actions/tree/main/public/"
click ViteCfg "https://github.com/calispec-balaji/github_actions/blob/main/vite.config.ts"
click TSRoot "https://github.com/calispec-balaji/github_actions/blob/main/tsconfig.json"
click TSApp "https://github.com/calispec-balaji/github_actions/blob/main/tsconfig.app.json"
click TSNode "https://github.com/calispec-balaji/github_actions/blob/main/tsconfig.node.json"
click ESLint "https://github.com/calispec-balaji/github_actions/blob/main/eslint.config.js"
click Pkg "https://github.com/calispec-balaji/github_actions/blob/main/package.json"
click PkgLock "https://github.com/calispec-balaji/github_actions/blob/main/package-lock.json"
click Docker "https://github.com/calispec-balaji/github_actions/tree/main/Dockerfile"
click DockerIgnore "https://github.com/calispec-balaji/github_actions/blob/main/.dockerignore"
click Workflow "https://github.com/calispec-balaji/github_actions/blob/main/.github/workflows/performance.yml"
click LHCfg "https://github.com/calispec-balaji/github_actions/blob/main/lighthouserc.cjs"
click Docs "https://github.com/calispec-balaji/github_actions/blob/main/PERFORMANCE_CI.md"

%% =========================
%% Styles
%% =========================
classDef runtime fill:#1f77b4,stroke:#0b3d91,stroke-width:1.5px,color:#ffffff
classDef tooling fill:#6c757d,stroke:#343a40,stroke-width:1.5px,color:#ffffff
classDef ci fill:#2ca02c,stroke:#1b6e1b,stroke-width:1.5px,color:#ffffff
classDef deploy fill:#9467bd,stroke:#5e3f8c,stroke-width:1.5px,color:#ffffff
classDef asset fill:#17a2b8,stroke:#0f6674,stroke-width:1.5px,color:#ffffff
classDef artifact fill:#ff7f0e,stroke:#a64b00,stroke-width:1.5px,color:#ffffff
classDef doc fill:#ffd54f,stroke:#b28900,stroke-width:1.5px,color:#1a1a1a
```
