# thetechie/my-blog architecture

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

- Interactive diagram: https://gitdiagram.com/thetechie/my-blog
- Repository: https://github.com/thetechie/my-blog

## Overview

##### Project Type and Purpose
- This is a **static site** (personal blog) built with **GatsbyJS** (React + GraphQL SSG).
- Purpose: convert Markdown content + React templates + assets into a fully static website, then host it (Netlify).

##### File Structure
Top level:
– Configuration & CI:
- gatsby‐config.js, gatsby‐node.js (Gatsby setup & page‐creation hooks)
- netlify.toml (deploy rules)
- .eslintrc, .prettierrc, .codeclimate.yml, travis.yml (linting, formatting, CI)
– src/:
- assets/ (fonts, SCSS) → visual styling resources
- components/ (React pieces: Layout, Menu, Sidebar, Post, Disqus, etc.)
- pages/ (entry points: index.jsx, 404.jsx, category/tag listings, Markdown content under articles/ & pages/)
- templates/ (category‐template.jsx, post‐template.jsx, etc. – used by Gatsby’s GraphQL‐driven page creation)

##### README for Insights
– “my personal blog listing my work and profile”: confirms static, content‐centric, no server-side logic at runtime.

##### Main Components
a. Developer & Source Control
– Local code repository (Git) pushes to remote (e.g., GitHub).
b. Continuous Integration & Quality
– Travis CI (travis.yml) runs lint (ESLint), formatting checks (Prettier), optional tests, reports to CodeClimate.
c. Build System
– Netlify (triggered on push) calls Gatsby CLI:
- Reads gatsby-config.js & gatsby-node.js
- Parses Markdown files via GraphQL data layer
- Runs React templates + components + SCSS → generates static HTML, CSS, JS in /public
d. Data Layer (at build time only)
– GraphQL schema: sources content from src/pages/**/*.md, images, site metadata
e. Presentation Layer
f. Hosting & Delivery
– Netlify’s CDN serves the static /public site to end users (browsers).
g. External Integrations
– Disqus for comments (client‐side embed)
– Analytics (if configured, not in tree)

##### Relationships & Interactions
- Netlify CI → (runs) → Gatsby build → outputs /public
- Netlify CDN → serves static assets → End user browser
- Gatsby build:
– GraphQL Data Layer ← Markdown files, siteConfig
– React Templates + Data → Static HTML files
– SCSS & CSS → bundled styles
– JS bundle (runtime React for client side features like Disqus embed)
- Disqus component → client‐side network call to Disqus service

##### Architectural Patterns & Principles
– **Static Site Generation**: no server logic at runtime
– **Component‐Based UI**: React components + SCSS modules
– **Data‐Driven Templates**: GraphQL queries in templates + gatsby-node page creation
– **CI/CD**: automated lint, build, deploy
– **Separation of Concerns**: assets / styling / content / templates / configs clearly separated

– Clear labels: “Developer,” “GitHub (repo),” “Travis CI,” “Netlify Build,” “Gatsby GraphQL Layer,” “React Templates,” “Disqus,” “Netlify CDN,” “Browser”
- Config & CI (e.g., blue)
- Build process (e.g., green)
- Static assets & content (e.g., yellow)
- Runtime delivery & external services (e.g., orange)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Control & CI
    subgraph "Source Control & CI"
        Developer(["Developer"]):::actor
        GitHub[(GitHub Repo)]:::repo
        TravisCI[[Travis CI]]:::ci
        ESLint[[.eslintrc]]:::ci
        Prettier[[.prettierrc]]:::ci
        CodeClimate[[.codeclimate.yml]]:::ci

        Developer -->|"push"| GitHub
        GitHub -->|"webhook"| TravisCI
        TravisCI -->|"lint & formatting"| ESLint
        TravisCI -->|"lint & formatting"| Prettier
        TravisCI -->|"report"| CodeClimate
    end

    %% Netlify Build & Deployment
    subgraph "Netlify Build & Deployment"
        NetlifyCI[[Netlify Build]]:::ci
        GatsbyCLI(("Gatsby CLI")):::build
        NetlifyCI -->|"runs"| GatsbyCLI
    end
    Developer -->|"push"| NetlifyCI

    %% Build Process
    subgraph "Build Process"
        direction TB
        subgraph "Configs"
            Config["gatsby-config.js"]:::config
            NodeHooks["gatsby-node.js"]:::config
        end

        subgraph "Static Assets"
            Fonts["fonts"]:::asset
            SCSSDir["scss"]:::asset
            Fonts -->|"assets"| GatsbyCLI
            SCSSDir -->|"styles"| GatsbyCLI
        end

        subgraph "Data Layer"
            Markdown["Markdown Content"]:::content
            GraphQL(("GraphQL Schema")):::build
            Markdown -->|"source"| GraphQL
            Config --> GraphQL
            NodeHooks --> GraphQL
        end

        subgraph "Templates"
            CatTemp["category-template.jsx"]:::template
            TagTemp["tag-template.jsx"]:::template
            PostTemp["post-template.jsx"]:::template
            PageTemp["page-template.jsx"]:::template
            GraphQL -->|"query data"| CatTemp
            GraphQL -->|"query data"| TagTemp
            GraphQL -->|"query data"| PostTemp
            GraphQL -->|"query data"| PageTemp
        end

        subgraph "Components"
            Layout["Layout"]:::component
            Menu["Menu"]:::component
            Sidebar["Sidebar"]:::component
            PostPrev["Post Preview"]:::component
            Links["Links"]:::component
            DisqusComp["Disqus Embed"]:::component
            CatDetails["Category Details"]:::component
            TagDetails["Tag Details"]:::component
            PostDetails["Post Details"]:::component
            PageDetails["Page Details"]:::component

            Layout --> GatsbyCLI
            Menu --> GatsbyCLI
            Sidebar --> GatsbyCLI
            PostPrev --> GatsbyCLI
            Links --> GatsbyCLI
            DisqusComp --> GatsbyCLI
            CatDetails --> GatsbyCLI
            TagDetails --> GatsbyCLI
            PostDetails --> GatsbyCLI
            PageDetails --> GatsbyCLI
        end

        GatsbyCLI -->|"generate"| HTML["Static HTML/CSS/JS"]:::output
    end

    %% Hosting & Delivery
    subgraph "Hosting & Delivery"
        CDN[(Netlify CDN)]:::cdn
        Browser(("End User Browser")):::client
        Disqus[(Disqus Service)]:::external

        HTML --> CDN
        CDN -->|"serve assets"| Browser
        Browser -->|"fetch comments"| Disqus
    end

    %% Click Events
    click Config "https://github.com/thetechie/my-blog/blob/master/gatsby-config.js"
    click NodeHooks "https://github.com/thetechie/my-blog/blob/master/gatsby-node.js"
    click NetlifyCI "https://github.com/thetechie/my-blog/blob/master/netlify.toml"
    click TravisCI "https://github.com/thetechie/my-blog/blob/master/travis.yml"
    click ESLint "https://github.com/thetechie/my-blog/blob/master/.eslintrc"
    click Prettier "https://github.com/thetechie/my-blog/blob/master/.prettierrc"
    click CodeClimate "https://github.com/thetechie/my-blog/blob/master/.codeclimate.yml"
    click Fonts "https://github.com/thetechie/my-blog/tree/master/src/assets/fonts/fontello-771c82e0/"
    click SCSSDir "https://github.com/thetechie/my-blog/tree/master/src/assets/scss/"
    click Layout "https://github.com/thetechie/my-blog/blob/master/src/components/Layout/index.jsx"
    click Menu "https://github.com/thetechie/my-blog/blob/master/src/components/Menu/index.jsx"
    click Sidebar "https://github.com/thetechie/my-blog/blob/master/src/components/Sidebar/index.jsx"
    click PostPrev "https://github.com/thetechie/my-blog/blob/master/src/components/Post/index.jsx"
    click Links "https://github.com/thetechie/my-blog/blob/master/src/components/Links/index.jsx"
    click DisqusComp "https://github.com/thetechie/my-blog/blob/master/src/components/Disqus/Disqus.jsx"
    click CatDetails "https://github.com/thetechie/my-blog/blob/master/src/components/CategoryTemplateDetails/index.jsx"
    click TagDetails "https://github.com/thetechie/my-blog/blob/master/src/components/TagTemplateDetails/index.jsx"
    click PostDetails "https://github.com/thetechie/my-blog/blob/master/src/components/PostTemplateDetails/index.jsx"
    click PageDetails "https://github.com/thetechie/my-blog/blob/master/src/components/PageTemplateDetails/index.jsx"
    click CatTemp "https://github.com/thetechie/my-blog/blob/master/src/templates/category-template.jsx"
    click TagTemp "https://github.com/thetechie/my-blog/blob/master/src/templates/tag-template.jsx"
    click PostTemp "https://github.com/thetechie/my-blog/blob/master/src/templates/post-template.jsx"
    click PageTemp "https://github.com/thetechie/my-blog/blob/master/src/templates/page-template.jsx"

    %% Styles
    classDef actor fill:#f9f,stroke:#333,stroke-width:1px
    classDef repo fill:#ddf,stroke:#333,stroke-width:1px
    classDef ci fill:#bbf,stroke:#333,stroke-width:1px
    classDef build fill:#dfd,stroke:#333,stroke-width:1px
    classDef config fill:#afa,stroke:#333,stroke-width:1px
    classDef asset fill:#ffea8a,stroke:#333,stroke-width:1px
    classDef content fill:#ffe4b3,stroke:#333,stroke-width:1px
    classDef template fill:#c8e7ff,stroke:#333,stroke-width:1px
    classDef component fill:#e7c8ff,stroke:#333,stroke-width:1px
    classDef output fill:#f0f0f0,stroke:#333,stroke-width:1px
    classDef cdn fill:#ffd5b3,stroke:#333,stroke-width:1px
    classDef client fill:#ffe1e1,stroke:#333,stroke-width:1px
    classDef external fill:#fff1b3,stroke:#333,stroke-width:1px
```
