# vasu3110/react-js-fundamentals architecture

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

- Interactive diagram: https://gitdiagram.com/vasu3110/react-js-fundamentals
- Repository: https://github.com/vasu3110/react-js-fundamentals

## Overview

##### Project type and purpose
- This repository is a collection of practice React.js single‑page applications (SPAs). It contains three demos built with Create React App (CRA) and Vite (“01_basicsreact”, “01_vitereact”, “02Counter”) plus a minimal custom‑React implementation (“customReact”). The goal is purely front‑end learning—no backend or database is involved.

##### File structure
- Top‑level folders (“01_basicsreact”, “01_vitereact”, “02Counter”, “customReact”) each represent an independent front‑end demo.
- “01_basicsreact” uses CRA conventions: “public/” holds static HTML and manifest, “src/” contains JSX components, CSS, index.js entry, plus package.json and build scripts.
- “01_vitereact” and “02Counter” use Vite: a lightweight bundler (vite.config.js, main.jsx entry).
- “customReact” is a single HTML file loading a hand‑rolled customreact.js library for educational purposes.

##### README
- The README simply states: “This is practice repo for react js.” No further architectural notes are provided.

##### Detailed capturing of essential elements
- Config files (vite.config.js, eslint.config.js) where relevant
- Clearly separate “public/static assets” vs. “src code” vs. “node_modules”
- CSS imports and CSS modules where used (e.g., appStyles.module.css)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Machine"
        direction TB
        DEVCODE["Source Code"]:::source
        DEVPKG["Package Manager & Scripts"]:::buildDev
    end

    %% Source Code breakdown
    subgraph "CRA Demo (01_basicsreact)" 
        direction TB
        CRA_ROOT["01_basicsreact/"]:::source
        CRA_PKG["package.json"]:::source
        CRA_PUBLIC["public/"]:::source
        CRA_SRC["src/"]:::source
    end

    subgraph "Vite React Demo (01_vitereact)"
        direction TB
        VITE_ROOT["01_vitereact/"]:::source
        VITE_PKG["package.json"]:::source
        VITE_CONFIG["vite.config.js"]:::source
        VITE_HTML["index.html"]:::source
        VITE_SRC["src/"]:::source
    end

    subgraph "Vite Counter Demo (02Counter)"
        direction TB
        CNT_ROOT["02Counter/"]:::source
        CNT_PKG["package.json"]:::source
        CNT_CONFIG["vite.config.js"]:::source
        CNT_PUBLIC["public/"]:::source
        CNT_SRC["src/"]:::source
    end

    subgraph "Custom React Demo (customReact)"
        direction TB
        CUST_ROOT["customReact/"]:::source
        CUST_LIB["customreact.js"]:::source
        CUST_HTML["index.html"]:::source
    end

    DEVCODE -->|"edit code"| CRA_ROOT
    DEVCODE -->|"edit code"| VITE_ROOT
    DEVCODE -->|"edit code"| CNT_ROOT
    DEVCODE -->|"edit code"| CUST_ROOT
    DEVPKG --> CRA_PKG
    DEVPKG --> VITE_PKG
    DEVPKG --> CNT_PKG

    %% Build & Dev Server
    subgraph "Build & Dev Server" 
        direction TB
        CRA_BUNDLER["Webpack (CRA)"]:::buildDev
        VITE_BUNDLER["Vite (esbuild/Rollup)"]:::buildDev
        DEV_SERVER["Dev Server & HMR"]:::buildDev
    end

    CRA_ROOT -->|"npm start / build"| CRA_BUNDLER
    VITE_ROOT -->|"vite"| VITE_BUNDLER
    CNT_ROOT -->|"vite"| VITE_BUNDLER
    CRA_BUNDLER --> DEV_SERVER
    VITE_BUNDLER --> DEV_SERVER

    %% Production Server
    PROD["Static Host / CDN"]:::host

    DEV_SERVER -->|"bundle & serve"| PROD
    DEV_SERVER -->|"bundle & serve"| BROWSER

    %% Browser Runtime
    subgraph "Browser Runtime" 
        direction TB
        HTML["index.html"]:::runtime
        subgraph "Vendor Libraries"
            direction TB
            REACT_CORE["React / ReactDOM"]:::runtime
            CUSTOM_CORE["customReact lib"]:::runtime
        end
        subgraph "App Components"
            direction TB
            ROOT_COMP["App Component"]:::runtime
            COMP_TREE["Child Components"]:::runtime
        end
    end

    PROD -->|"HTTP GET"| HTML
    HTML -->|"load bundle"| REACT_CORE
    HTML -->|"load bundle"| CUSTOM_CORE
    REACT_CORE -->|"mount"| ROOT_COMP
    CUSTOM_CORE -->|"mount"| ROOT_COMP
    ROOT_COMP -->|"render"| COMP_TREE

    %% Click Events
    click CRA_ROOT "https://github.com/vasu3110/react-js-fundamentals/tree/main/01_basicsreact/"
    click CRA_PKG "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_basicsreact/package.json"
    click CRA_PUBLIC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_basicsreact/public/index.html"
    click CRA_PUBLIC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_basicsreact/public/manifest.json"
    click CRA_PUBLIC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_basicsreact/public/robots.txt"
    click CRA_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_basicsreact/src/App.js"
    click CRA_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_basicsreact/src/index.js"
    click VITE_ROOT "https://github.com/vasu3110/react-js-fundamentals/tree/main/01_vitereact/"
    click VITE_CONFIG "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_vitereact/vite.config.js"
    click VITE_HTML "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_vitereact/index.html"
    click VITE_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_vitereact/src/main.jsx"
    click VITE_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_vitereact/src/App.jsx"
    click VITE_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/01_vitereact/src/Chai.jsx"
    click CNT_ROOT "https://github.com/vasu3110/react-js-fundamentals/tree/main/02Counter/"
    click CNT_CONFIG "https://github.com/vasu3110/react-js-fundamentals/blob/main/02Counter/vite.config.js"
    click CNT_PUBLIC "https://github.com/vasu3110/react-js-fundamentals/tree/main/02Counter/public/"
    click CNT_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/02Counter/src/main.jsx"
    click CNT_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/02Counter/src/App.jsx"
    click CNT_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/02Counter/src/App.css"
    click CNT_SRC "https://github.com/vasu3110/react-js-fundamentals/blob/main/02Counter/src/index.css"
    click CUST_ROOT "https://github.com/vasu3110/react-js-fundamentals/tree/main/customReact/"
    click CUST_LIB "https://github.com/vasu3110/react-js-fundamentals/blob/main/customReact/customreact.js"
    click CUST_HTML "https://github.com/vasu3110/react-js-fundamentals/blob/main/customReact/index.html"

    %% Styles
    classDef buildDev fill:#cceeff,stroke:#0077cc
    classDef source fill:#ccffcc,stroke:#00aa00
    classDef runtime fill:#ffcc99,stroke:#cc7700
    classDef host fill:#eeeeee,stroke:#999999
```
