# jonmircha/jonmircha-website architecture

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

- Interactive diagram: https://gitdiagram.com/jonmircha/jonmircha-website
- Repository: https://github.com/jonmircha/jonmircha-website

## Overview

##### Project type and purpose
- This is a static content–driven website (personal blog, tutorial site, PWA) built with HTML templates, components, markdown imports, and a simple Node-based build pipeline.
- It exposes a library of articles (in `_imports/blog`), reusable HTML components (`_imports/components`), page templates (`_imports/templates`), static assets (CSS, JS, images), a service worker (`sw.js`) and a PWA manifest (`manifest.json`).

##### Key architectural components
a. Content source
- Markdown files under `_imports/blog`
- HTML fragments under `_imports/components` (header, footer, post, etc.)
- Page templates under `_imports/templates`
b. Build pipeline (Developer → Build tool → Output)
- Node.js scripts defined in `package.json` consume the imports and templates
- Generates final `.html` pages and copies assets to the output root
c. Hosting layer
- Static file server or CDN serving `.html`, CSS, JS, images, manifest, service worker
d. Client runtime (Browser)
- Requests pages, downloads assets
- Registers service worker for offline caching
- Reads `manifest.json` to enable PWA install

##### Relationships and data flow
- Developer edits markdown, HTML fragments, CSS/JS.
- Build tool merges templates with content → produces site files.
- Hosting serves files over HTTP/HTTPS.
- Browser → requests HTML/CSS/JS → user interacts; service worker caches assets.

##### Architectural patterns and principles
- Static Site Generation (SSG)
- Separation of concerns:
- Content (markdown) vs. Presentation (templates/styles) vs. Logic (build scripts, service worker)
- Progressive Web App: offline support via service worker, manifest for installability

- Related items (e.g., content folders vs. output files) with containers or shaded regions
- Technology stacks next to each component (e.g., “Node.js build script,” “Service Worker”)

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Build Time"
        Dev["Developer\n(IDE, local files)"]:::dev
        BT["Build Tool\n(Node.js, npm scripts)"]:::build

        subgraph "Content Store"
            MD["Markdown Articles"]:::content
            HC["HTML Components"]:::content
            PT["Page Templates"]:::content
        end

        subgraph "Output Artifacts"
            GP["Generated HTML Pages"]:::output
            SA["Static Assets\n(CSS, JS)"]:::output
            IM["Images & Media"]:::output
            M["manifest.json"]:::output
            SW["sw.js"]:::output
        end
    end

    subgraph "Run Time"
        Host["Hosting/CDN\n(Static File Server)"]:::hosting
        Browser["Client Browser"]:::browser
    end

    %% Build Time flows
    Dev -->|edits| MD
    Dev -->|edits| HC
    Dev -->|edits| PT
    Dev -->|runs| BT
    BT -->|reads| MD
    BT -->|reads| HC
    BT -->|reads| PT
    BT -->|writes| GP
    BT -->|writes| SA
    BT -->|writes| IM
    BT -->|writes| M
    BT -->|writes| SW

    %% Deployment and Runtime flows
    GP -->|deployed to| Host
    SA -->|deployed to| Host
    IM -->|deployed to| Host
    M  -->|deployed to| Host
    SW -->|deployed to| Host
    Browser -->|HTTP GET| Host
    Host -->|serves files| Browser
    Browser -->|registers| SW
    Browser -->|caches via| SW
    Browser -->|reads| M

    %% Click Events
    click MD "https://github.com/jonmircha/jonmircha-website/tree/main/_imports/blog/"
    click HC "https://github.com/jonmircha/jonmircha-website/tree/main/_imports/components/"
    click PT "https://github.com/jonmircha/jonmircha-website/tree/main/_imports/templates/"
    click BT "https://github.com/jonmircha/jonmircha-website/blob/main/package.json"
    click GP "https://github.com/jonmircha/jonmircha-website/blob/main/./*.html"
    click SA "https://github.com/jonmircha/jonmircha-website/tree/main/assets/"
    click IM "https://github.com/jonmircha/jonmircha-website/tree/main/img/"
    click M "https://github.com/jonmircha/jonmircha-website/blob/main/manifest.json"
    click SW "https://github.com/jonmircha/jonmircha-website/blob/main/sw.js"
    click Host "https://github.com/jonmircha/jonmircha-website/blob/main/.htaccess"

    %% Styles
    classDef dev fill:#D0E8FF,stroke:#003,stroke-width:1px
    classDef build fill:#D0E8FF,stroke:#003,stroke-width:1px
    classDef content fill:#DFFFD0,stroke:#003,stroke-width:1px
    classDef output fill:#FFF5B1,stroke:#003,stroke-width:1px
    classDef hosting fill:#FFE0B2,stroke:#003,stroke-width:1px
    classDef browser fill:#E1BEE7,stroke:#003,stroke-width:1px
```
