# shetharp/arpitsheth architecture

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

- Interactive diagram: https://gitdiagram.com/shetharp/arpitsheth
- Repository: https://github.com/shetharp/arpitsheth

## Overview

##### Project Type and Purpose
- This is a static personal website and portfolio built with Gatsby (a React-based static site generator).
- Content is authored in MDX under `content/` and `drafts/`. A custom theme plugin (`gatsby-theme-polaroid`) provides styling, components, and data.

##### File Structure
- Top level:
- `gatsby-config.js`, `package.json`, `tsconfig.json` → project configuration and dependencies
- `content/` & `drafts/` → MDX pages and posts
- `src/@shetharp/gatsby-theme-polaroid/` → local theme plugin (assets, components, data)
- `src/components/` → custom React components
- `src/gatsby-plugin-theme-ui/` → Theme UI plugin overrides
- `static/` → static assets (e.g., CNAME)
- `public/` → generated site

##### Readme Insights
- Gatsby CLI is used for “develop”, “build”, “serve”, and “deploy” (to GitHub Pages).
- No automated CI/CD; manual `yarn deploy` pushes `public` to the `gh-pages` branch.
- Customizable via MDX and theme shadowing.

##### Main Components
a. Developer Workstation
- Node.js & Yarn → runs Gatsby CLI
b. Content Sources
- `content/` (pages, posts) and `drafts/`
- MDX files and images
c. Theme Plugin & Custom Code
- `gatsby-theme-polaroid` (assets, components, data)
- Custom components in `src/components`
- Theme-UI plugin overrides
d. Gatsby Build Pipeline
- Source plugins read files
- MDX transformer
- GraphQL data layer
- React renderer → static HTML/CSS/JS
e. Build Artifacts
- `public/` directory (static site)
f. Deployment Target
- GitHub Pages (serving `gh-pages` branch)
- DNS via CNAME pointing `arpitsheth.com` to GitHub

##### Relationships and Data Flow
1. Developer invokes `gatsby develop` or `gatsby build`
2. Gatsby sources MDX & assets → transforms via plugins → builds a GraphQL schema
3. React components (from the theme plugin and custom code) query data and render pages
4. Gatsby outputs static site in `public/`
5. `yarn deploy` pushes `public/` to `gh-pages` branch
6. GitHub Pages serves the static files; DNS CNAME directs domain
7. Client browser requests pages over HTTPS

##### Architectural Patterns and Principles
- Static Site Generation (SSG)
- Plugin-based extensibility (Gatsby themes & plugins)
- Component shadowing for easy customization
- MDX for combined markdown + React

##### Essential Details to Capture
- The transformation steps in Gatsby (MDX → GraphQL → React → HTML)
- The manual deploy step to GitHub Pages and DNS configuration via CNAME
- How local development (`gatsby develop`) vs. production build (`gatsby build` + `gatsby serve`) fit into the workflow

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Layer
    subgraph "Source Code & Content" 
        direction TB
        Pages["Pages MDX"]:::source
        Posts["Posts MDX"]:::source
        Drafts["Drafts MDX"]:::source
        ThemePlugin["Theme Plugin Root"]:::source
        ThemeAssets["Theme Plugin Assets"]:::source
        ThemeComponents["Theme Plugin Component"]:::source
        ThemeData["Theme Plugin Data"]:::source
        CustomAbout["AboutMe Component"]:::source
        CustomCall["CallMe Component"]:::source
        ThemeUI["Theme UI Overrides"]:::source
        GatsbyConfig["gatsby-config.js"]:::source
        PackageJSON["package.json"]:::source
        TSConfig["tsconfig.json"]:::source
        CNAME["CNAME (DNS)"]:::source
    end

    %% Developer Workstation
    Dev["Developer Workstation\nNode.js & Yarn"]:::external

    %% Build Process Layer
    subgraph "Gatsby Build Pipeline" 
        direction TB
        CLI["Gatsby CLI"]:::build
        MDX["MDX Transformer"]:::build
        GraphQL["GraphQL Data Layer"]:::build
        ReactRender["React Renderer"]:::build
    end

    %% Output and Deployment
    subgraph "Output & Deployment"
        direction TB
        Public["public/ (Static Site)"]:::output
        Deploy["GitHub Pages\ngh-pages branch"]:::deployment
        Browser["Client Browser"]:::external
    end

    DNS["GitHub Pages DNS"]:::external

    %% Connections
    Dev -->|runs develop/build| CLI
    Pages -->|source files| CLI
    Posts -->|source files| CLI
    Drafts -->|source files| CLI
    ThemePlugin -->|provides code| CLI
    ThemeAssets -->|provides assets| CLI
    ThemeComponents -->|provides components| CLI
    ThemeData -->|provides data| CLI
    CustomAbout -->|shadowed component| CLI
    CustomCall -->|shadowed component| CLI
    ThemeUI -->|provides theme UI| CLI
    GatsbyConfig -->|configuration| CLI
    PackageJSON -->|dependencies| CLI
    TSConfig -->|type config| CLI
    CLI -->|transforms| MDX
    MDX -->|builds schema| GraphQL
    GraphQL -->|feeds data| ReactRender
    ReactRender -->|renders pages| Public
    Public -->|static-site push| Deploy
    CNAME -->|DNS points to| DNS
    DNS -->|serves| Deploy
    Deploy -->|HTTP over HTTPS| Browser

    %% Click Events
    click Pages "https://github.com/shetharp/arpitsheth/blob/master/content/pages/**/*.mdx"
    click Posts "https://github.com/shetharp/arpitsheth/blob/master/content/posts/**/*.mdx"
    click Drafts "https://github.com/shetharp/arpitsheth/blob/master/drafts/pages/**/*.mdx"
    click ThemePlugin "https://github.com/shetharp/arpitsheth/tree/master/src/@shetharp/gatsby-theme-polaroid/"
    click ThemeAssets "https://github.com/shetharp/arpitsheth/tree/master/src/@shetharp/gatsby-theme-polaroid/assets/"
    click ThemeComponents "https://github.com/shetharp/arpitsheth/blob/master/src/@shetharp/gatsby-theme-polaroid/components/slide-title.tsx"
    click ThemeData "https://github.com/shetharp/arpitsheth/blob/master/src/@shetharp/gatsby-theme-polaroid/data/*.ts(x)"
    click CustomAbout "https://github.com/shetharp/arpitsheth/blob/master/src/components/about-me.tsx"
    click CustomCall "https://github.com/shetharp/arpitsheth/blob/master/src/components/call-me.tsx"
    click ThemeUI "https://github.com/shetharp/arpitsheth/blob/master/src/gatsby-plugin-theme-ui/index.ts"
    click GatsbyConfig "https://github.com/shetharp/arpitsheth/blob/master/gatsby-config.js"
    click PackageJSON "https://github.com/shetharp/arpitsheth/blob/master/package.json"
    click TSConfig "https://github.com/shetharp/arpitsheth/blob/master/tsconfig.json"
    click CNAME "https://github.com/shetharp/arpitsheth/tree/master/static/CNAME"
    click Public "https://github.com/shetharp/arpitsheth/tree/master/public/"

    %% Styles
    classDef source fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef build fill:#FFE8B2,stroke:#D2691E,color:#D2691E
    classDef output fill:#E6FFCC,stroke:#228B22,color:#228B22
    classDef deployment fill:#E6FFCC,stroke:#228B22,color:#228B22
    classDef external fill:#F2E6FF,stroke:#800080,color:#800080
```
