# fabricegeib/react-for-designers architecture

> Architecture diagram of the GitHub repository fabricegeib/react-for-designers, 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/fabricegeib/react-for-designers
- Repository: https://github.com/fabricegeib/react-for-designers

## Overview

##### Project type and purpose
- This is a Gatsby-based static site (a React SSG) built with the default starter.
- It has no dynamic backend/service—everything is generated at build time via Gatsby’s Node process and GraphQL data layer, then deployed as static assets.

##### Main components
A. Developer / CI system
- Triggers commands (`gatsby develop` in dev, `gatsby build` in CI/production).
B. Gatsby Build Process (Node.js)
1. Configuration & Plugins layer
- gatsby-config.js (site metadata, plugins)
- gatsby-node.js (createPages, extend GraphQL schema)
- gatsby-browser.js (client API hooks)
- gatsby-ssr.js (SSR API hooks)
2. Data Layer (GraphQL)
- Sources: staticdata.json (and any images under src/images)
- Gatsby’s internal GraphQL server to query nodes
3. React Compilation
- src/pages/… → page templates
- src/components/… → React UI components
4. Bundling & Transpilation
- Webpack, Babel (configured by Gatsby under the hood)
C. Build Output
- /public folder: HTML, CSS, JS bundles, static assets
D. Hosting / CDN
- e.g. Netlify (build & deploy) or any static‐file host
E. Client Browser
- Fetches static HTML/CSS/JS and hydrates React for client interactions

##### Relationships & data flow
- Developer → Gatsby CLI → Build Process
- Build Process reads config + plugins → Spins up GraphQL → Reads data sources → Compiles React pages → Generates static files
- In dev: Build Process serves files on localhost:8000 + GraphiQL at /___graphql
- In prod: CI runs `gatsby build` → Outputs /public → Deployed to CDN/Netlify → Browser requests static assets

##### Architectural patterns & principles
- Static-site generation (SSG) pattern
- Component-based UI (React)
- Data abstraction via GraphQL node layer
- Plugin/config-based extensibility (Gatsby APIs)
- Separation of concerns: config, data, component logic, build vs. runtime

##### Technologies / frameworks
- Node.js & Gatsby CLI
- React (JSX, components under src/)
- GraphQL (data queries at build time)
- Webpack & Babel (bundling & transpilation)
- Prettier (code style)
- NPM/Yarn (package management)

## Diagram (Mermaid)

```mermaid
flowchart TD
    devCI["Developer / CI"]:::trigger
    devCI -->|"run gatsby develop / build"| buildProc["Gatsby Build Process"]:::build

    subgraph "Gatsby Build Process"
        direction TB
        subgraph "Config & Plugins" 
            direction TB
            cfg["gatsby-config.js"] 
            nodejs["gatsby-node.js"]
            browserAPI["gatsby-browser.js"]
            ssrAPI["gatsby-ssr.js"]
        end
        subgraph "Data Layer (GraphQL)" 
            direction TB
            staticdata["staticdata.json"]:::data
            images["src/images/*"]:::data
        end
        subgraph "React Compilation" 
            direction TB
            pages404["src/pages/404.js"] 
            pageIndex["src/pages/index.js"]
            page2["src/pages/page-2.js"]
            compCard["src/components/Card.js"]
            compCell["src/components/Cell.js"]
            compFooter["src/components/Footer.js"]
            compHeader["src/components/Header.js"]
            compSection["src/components/Section.js"]
            compWave["src/components/Wave.js"]
            compLayout["src/components/layout.js"]
        end
        subgraph "Styles & Assets" 
            direction TB
            CardCSS["src/components/Card.css"]
            HeaderCSS["src/components/Header.css"]
            LayoutCSS["src/components/layout.css"]
        end
        subgraph "Bundler & Transpilation" 
            direction TB
            webpack["Webpack"] 
            babel["Babel"]
        end

        buildProc --> cfg
        buildProc --> nodejs
        buildProc --> browserAPI
        buildProc --> ssrAPI
        buildProc --> staticdata
        buildProc --> images
        buildProc --> pages404
        buildProc --> pageIndex
        buildProc --> page2
        buildProc --> compCard
        buildProc --> compCell
        buildProc --> compFooter
        buildProc --> compHeader
        buildProc --> compSection
        buildProc --> compWave
        buildProc --> compLayout
        buildProc --> CardCSS
        buildProc --> HeaderCSS
        buildProc --> LayoutCSS
        buildProc --> webpack
        buildProc --> babel
    end

    buildProc -->|"generate static files"| staticOut["/public"]:::build
    staticOut -->|"deploy to CDN"| hosting["Hosting / CDN (e.g. Netlify)"]:::runtime
    hosting -->|"serve static assets"| browser["Client Browser"]:::runtime

    buildProc -->|"serve dev server"| localServer["Local Dev Server<br>(localhost:8000 & GraphiQL)"]:::runtime
    localServer -->|"browse site / query GraphQL"| browser

    click cfg "https://github.com/fabricegeib/react-for-designers/blob/master/gatsby-config.js"
    click nodejs "https://github.com/fabricegeib/react-for-designers/blob/master/gatsby-node.js"
    click browserAPI "https://github.com/fabricegeib/react-for-designers/blob/master/gatsby-browser.js"
    click ssrAPI "https://github.com/fabricegeib/react-for-designers/blob/master/gatsby-ssr.js"
    click staticdata "https://github.com/fabricegeib/react-for-designers/blob/master/staticdata.json"
    click images "https://github.com/fabricegeib/react-for-designers/tree/master/src/images"
    click pages404 "https://github.com/fabricegeib/react-for-designers/blob/master/src/pages/404.js"
    click pageIndex "https://github.com/fabricegeib/react-for-designers/blob/master/src/pages/index.js"
    click page2 "https://github.com/fabricegeib/react-for-designers/blob/master/src/pages/page-2.js"
    click compCard "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Card.js"
    click compCell "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Cell.js"
    click compFooter "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Footer.js"
    click compHeader "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Header.js"
    click compSection "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Section.js"
    click compWave "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Wave.js"
    click compLayout "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/layout.js"
    click CardCSS "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Card.css"
    click HeaderCSS "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/Header.css"
    click LayoutCSS "https://github.com/fabricegeib/react-for-designers/blob/master/src/components/layout.css"
    click staticOut "https://github.com/fabricegeib/react-for-designers/tree/master//public"

    classDef trigger fill:#CCCCCC,stroke:#333,stroke-width:1px
    classDef build fill:#D0E6FF,stroke:#333,stroke-width:1px
    classDef runtime fill:#D0FFD6,stroke:#333,stroke-width:1px
    classDef data fill:#FFE6CC,stroke:#333,stroke-width:1px
    classDef code fill:#E6E6E6,stroke:#333,stroke-width:1px
```
