# fairywsr/reactprojects architecture

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

- Interactive diagram: https://gitdiagram.com/fairywsr/reactprojects
- Repository: https://github.com/fairywsr/reactprojects

## Overview

##### File structure
- Top-level folders:
- cardContext (Context API demo)
- currencyConverter (calls external currency API)
- passwordGenerator (random password SPA)
- Each folder has:
- index.html (HTML shell)
- src/main.jsx → ReactDOM.render entry
- src/App.jsx → top-level component
- src/components or src/Components, src/hooks, src/contexts → UI & logic modules
- public or assets folder → static files
- tailwind.config.js, postcss.config.js → styling pipeline
- vite.config.js → dev server / build settings
- package.json → dependencies & scripts

##### README
- Confirms these are small React demos focused on state, styling, context, external API consumption.

##### Elements
- Code → Vite → bundle → browser
- User events → React state changes → UI updates
- Hook → fetch → API → data → UI
- Tooling / build pipeline (e.g. grey)
- Runtime components (e.g. blue)
- External services (e.g. green)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer and Tooling
    Dev["Developer Workstation"]:::developer
    Dev -->|edits code & triggers| VitePipeline

    subgraph "Build & Dev Pipeline"
        direction TB
        VitePipeline["Vite Dev Server & Bundler"]:::build
        PostCSS["PostCSS → TailwindCSS"]:::build
        ESLint["ESLint Linting"]:::build
        VitePipeline --> PostCSS
        VitePipeline --> ESLint
    end

    %% Apps Isolation
    subgraph "Apps"
        direction TB

        subgraph "Background Color Switcher (bgColor)" 
            direction TB
            BgIndex["index.html"]:::runtime
            BgMain["src/main.jsx"]:::runtime
            BgApp["src/App.jsx"]:::runtime
            BgConfig["tailwind.config.js / postcss.config.js / vite.config.js / eslint.config.js"]:::config
            BgIndex --> BgMain
            BgMain --> BgApp
        end

        subgraph "Card Context Demo (cardContext)"
            direction TB
            CardIndex["index.html"]:::runtime
            CardMain["src/main.jsx"]:::runtime
            CardApp["src/App.jsx"]:::runtime
            ThemeCtx["ThemeContext Provider"]:::runtime
            CardComponents["Card & ThemeButton Components"]:::runtime
            CardConfig["tailwind.config.js / postcss.config.js / vite.config.js / eslint.config.js"]:::config
            CardIndex --> CardMain
            CardMain --> CardApp
            CardApp --> ThemeCtx
            ThemeCtx --> CardComponents
        end

        subgraph "Currency Converter (currencyConverter)"
            direction TB
            CurrIndex["index.html"]:::runtime
            CurrMain["src/main.jsx"]:::runtime
            CurrApp["src/App.jsx"]:::runtime
            UseHook["useCurrencyInfo Hook"]:::runtime
            CurrComponents["InputBox & Components Index"]:::runtime
            ExternalAPI["External Currency API"]:::external
            CurrConfig["tailwind.config.js / postcss.config.js / vite.config.js / eslint.config.js"]:::config
            CurrIndex --> CurrMain
            CurrMain --> CurrApp
            CurrApp --> UseHook
            UseHook --> ExternalAPI
            CurrApp --> CurrComponents
        end

        subgraph "Password Generator (passwordGenerator)"
            direction TB
            PassIndex["index.html"]:::runtime
            PassMain["src/main.jsx"]:::runtime
            PassApp["src/App.jsx"]:::runtime
            Assets["src/assets"]:::runtime
            PassConfig["tailwind.config.js / postcss.config.js / vite.config.js / eslint.config.js"]:::config
            PassIndex --> PassMain
            PassMain --> PassApp
            PassApp --> Assets
        end
    end

    %% Deployment
    VitePipeline -->|bundles to| Dist["dist (Static Hosting Output)"]:::external
    Dist -->|served to| Browser["Browser Runtime"]:::runtime
    Browser -->|loads apps| BgIndex
    Browser --> CardIndex
    Browser --> CurrIndex
    Browser --> PassIndex

    %% Click Events
    click BgIndex "https://github.com/fairywsr/reactprojects/blob/main/bgColor/index.html"
    click BgMain "https://github.com/fairywsr/reactprojects/blob/main/bgColor/src/main.jsx"
    click BgApp "https://github.com/fairywsr/reactprojects/blob/main/bgColor/src/App.jsx"
    click BgConfig "https://github.com/fairywsr/reactprojects/blob/main/bgColor/tailwind.config.js"
    click CardIndex "https://github.com/fairywsr/reactprojects/blob/main/cardContext/index.html"
    click CardMain "https://github.com/fairywsr/reactprojects/blob/main/cardContext/src/main.jsx"
    click CardApp "https://github.com/fairywsr/reactprojects/blob/main/cardContext/src/App.jsx"
    click ThemeCtx "https://github.com/fairywsr/reactprojects/blob/main/cardContext/src/Contexts/Theme.js"
    click CardComponents "https://github.com/fairywsr/reactprojects/blob/main/cardContext/src/Components/Card.jsx"
    click CardConfig "https://github.com/fairywsr/reactprojects/blob/main/cardContext/tailwind.config.js"
    click CurrIndex "https://github.com/fairywsr/reactprojects/blob/main/currencyConverter/index.html"
    click CurrMain "https://github.com/fairywsr/reactprojects/blob/main/currencyConverter/src/main.jsx"
    click CurrApp "https://github.com/fairywsr/reactprojects/blob/main/currencyConverter/src/App.jsx"
    click UseHook "https://github.com/fairywsr/reactprojects/blob/main/currencyConverter/src/hooks/useCurrencyInfo.js"
    click CurrComponents "https://github.com/fairywsr/reactprojects/blob/main/currencyConverter/src/components/index.js"
    click CurrConfig "https://github.com/fairywsr/reactprojects/blob/main/currencyConverter/tailwind.config.js"
    click PassIndex "https://github.com/fairywsr/reactprojects/blob/main/passwordGenerator/index.html"
    click PassMain "https://github.com/fairywsr/reactprojects/blob/main/passwordGenerator/src/main.jsx"
    click PassApp "https://github.com/fairywsr/reactprojects/blob/main/passwordGenerator/src/App.jsx"
    click Assets "https://github.com/fairywsr/reactprojects/tree/main/passwordGenerator/src/assets"
    click PassConfig "https://github.com/fairywsr/reactprojects/blob/main/passwordGenerator/tailwind.config.js"

    %% Styles
    classDef developer fill:#FFD586,stroke:#933,stroke-width:2px
    classDef build fill:#E0E0E0,stroke:#888,stroke-width:1px
    classDef runtime fill:#D0E8FF,stroke:#036,stroke-width:1px
    classDef config fill:#F3E5AB,stroke:#AA7,stroke-width:1px
    classDef external fill:#C8E6C9,stroke:#256,stroke-width:1px
```
