# ramantehlan/moi architecture

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

- Interactive diagram: https://gitdiagram.com/ramantehlan/moi
- Repository: https://github.com/ramantehlan/moi

## Overview

##### Project Type and Purpose
- This is a static, single-page personal site template built with Vue.js (and a bit of jQuery), delivered entirely as client-side assets.
- Purpose: allow users to fork, supply content via a JSON file, and deploy to GitHub Pages (or any static host) without running a server or database.

##### File Structure Highlights
- Top-level:
- config files (.circleci/config.yml, .eslintrc.js, .gitignore)
- README.md, data.json (the user-editable content)
- index.html – the shell that loads the app
- robots.txt, sitemap.xml – SEO/static host helpers
- /images – media assets
- /style – compiled CSS (themes, variables)
- /script – bundled JS (Vue app, runtime, vendor code)
- No “backend” folder or server code—everything runs in the browser.

##### Key Architecture Insights from README
- The app fetches data.json at runtime and feeds it into a Vue.js frontend.
- Themes and layout are driven by CSS custom properties and the JSON “themes” section.
- Content sections are pre-defined in HTML and populated dynamically (e.g., about, work, projects).
- Build artifacts live on the master branch; source code (unbundled) lives on the source branch.
- CI/CD via CircleCI likely automates bundle generation and deployment to GitHub Pages.

##### Main Components
a. Developer & CI/CD
- GitHub repository (source branch → build pipeline → master branch)
- CircleCI (pulls source, runs linter, webpack build, pushes artifacts)
b. Static Hosting
- GitHub Pages or any CDN/host serving index.html, script/*.js, style/*.css, data.json, images/
c. Client (User’s Browser)
- Asset loader (HTML → CSS + JS bundles)
- Vue.js runtime: fetches data.json, applies themes, renders sections
- jQuery usage (if any) for DOM manipulations
d. External Services (optional)
- Google Analytics (tracking snippet injected via data.json)
- Google Search Console (verification via meta tag in data.json)

##### Relationships & Data Flows
- Developer commits → GitHub → CircleCI → builds JS/CSS → deploy to hosting.
- User’s browser request → static host → serves index.html → loads CSS/JS → app fires.
- App runtime fetches data.json → renders dynamic content.
- Optionally sends pageview data to Google Analytics.

##### Architectural Patterns & Principles
- “Jamstack” style: pre-build assets + client-side rendering from a flat JSON file.
- Fully decoupled frontend: no server logic beyond static file serving.
- Build-time vs. runtime separation: webpack bundles built by CI; JSON drives runtime content.

##### Essential Elements to Capture
- CI/CD process and branches (source vs. master)
- Static asset types and where they live
- Runtime data flow (JSON → Vue.js → rendered HTML)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer & CI/CD Pipeline
    subgraph "Developer & CI/CD"
        direction TB
        GitHubRepo["GitHub Repo\n(source branch)"]:::build
        CircleCI["CircleCI Build"]:::build
    end
    GitHubRepo -->|"git push"| CircleCI
    CircleCI -->|"build bundles & deploy"| StaticHost

    click GitHubRepo "https://github.com/ramantehlan/moi/blob/master/README.md"
    click CircleCI "https://github.com/ramantehlan/moi/blob/master/.circleci/config.yml"

    %% Static Hosting
    subgraph "Static Hosting (GitHub Pages/CDN)" 
        direction TB
        StaticHost(("Static Host/CDN")):::hosting

        indexHTML["index.html"]:::hosting
        cssBundle["CSS Bundles"]:::hosting
        mainJS["main.ff906fcfda52cf0be525.bundle.js"]:::hosting
        runtimeJS["runtime~main.1cf4dc892e323a5a5e05.bundle.js"]:::hosting
        vendorsJS["vendors~main.ab6dfcd3fdb89f5d0b95.bundle.js"]:::hosting
        jsonFile["data.json"]:::hosting
        imagesDir["images/"]:::hosting
        robotsTxt["robots.txt"]:::hosting
        sitemapXml["sitemap.xml"]:::hosting
    end

    click indexHTML "https://github.com/ramantehlan/moi/blob/master/index.html"
    click cssBundle "https://github.com/ramantehlan/moi/blob/master/style/0.47f8d6f5c03e5f25ba3d.css"
    click mainJS "https://github.com/ramantehlan/moi/blob/master/script/main.ff906fcfda52cf0be525.bundle.js"
    click runtimeJS "https://github.com/ramantehlan/moi/blob/master/script/runtime~main.1cf4dc892e323a5a5e05.bundle.js"
    click vendorsJS "https://github.com/ramantehlan/moi/blob/master/script/vendors~main.ab6dfcd3fdb89f5d0b95.bundle.js"
    click jsonFile "https://github.com/ramantehlan/moi/blob/master/data.json"
    click imagesDir "https://github.com/ramantehlan/moi/tree/master/images/"
    click robotsTxt "https://github.com/ramantehlan/moi/blob/master/robots.txt"
    click sitemapXml "https://github.com/ramantehlan/moi/blob/master/sitemap.xml"

    StaticHost --> indexHTML
    StaticHost --> cssBundle
    StaticHost --> mainJS
    StaticHost --> runtimeJS
    StaticHost --> vendorsJS
    StaticHost --> jsonFile
    StaticHost --> imagesDir
    StaticHost --> robotsTxt
    StaticHost --> sitemapXml

    %% Client Browser and Runtime
    subgraph "Client Browser" 
        direction TB
        Browser["User's Browser"]:::client
        Loader["Asset Loader\n(HTML → CSS/JS)"]:::client
        VueRuntime["Vue.js Runtime"]:::client
        jQuery["jQuery"]:::client
    end

    Browser -->|"HTTP GET index.html"| indexHTML
    Browser -->|"HTTP GET CSS"| cssBundle
    Browser -->|"HTTP GET JS"| mainJS
    Browser -->|"HTTP GET JS"| runtimeJS
    Browser -->|"HTTP GET JS"| vendorsJS
    Loader --> VueRuntime
    VueRuntime -->|"HTTP GET data.json"| jsonFile
    VueRuntime --> jQuery
    Browser --> Loader

    %% External Services
    subgraph "External Services"
        direction TB
        GA["Google Analytics"]:::external
        GSC["Google Search Console"]:::external
        FA["Font Awesome CDN"]:::external
    end

    VueRuntime -->|"POST pageview event"| GA
    Browser -->|"meta verification"| GSC
    Browser -->|"HTTP GET icons"| FA

    %% Connections from CI
    CircleCI --> StaticHost

    classDef build fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef hosting fill:#90EE90,stroke:#333,stroke-width:1px
    classDef client fill:#FFFF99,stroke:#333,stroke-width:1px
    classDef external fill:#FFCC99,stroke:#333,stroke-width:1px
```
