# epicweb-dev/react-performance architecture

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

- Interactive diagram: https://gitdiagram.com/epicweb-dev/react-performance
- Repository: https://github.com/epicweb-dev/react-performance

## Overview

##### Project type and purpose
- This is a monorepo hosting a “React Performance” workshop: a main workshop app (epicshop) plus many small React micro-apps (under /examples and /exercises) to teach specific performance topics.
- The README confirms it’s a hands-on learning environment for diagnosing and fixing React performance issues.

##### File structure
- Top-level:
- package.json, tsconfig.json, eslint.config.js, GitHub workflows (CI/CD)
- public/ (static assets)
- shared/ (reusable utilities and components)
- examples/ (reference implementations)
- exercises/ (interactive labs, each as its own React app)
- epicshop/ (the main workshop UI and orchestration)
- epicshop/ contains Dockerfile, fly.yaml, setup and test scripts, config for Playwright, TypeScript, npm – this is your host application.
- Each sub-folder in examples/ and exercises/ is a standalone Vite- or Webpack-powered React + TypeScript app with its own package.json, tsconfig.json, source, tests.

##### README for additional insights
- Confirms the need for React DevTools, Node/npm, and describes a “npm run setup” to bootstrap the workspace.
- “npm start” launches the live workshop app which dynamically loads each exercise.

- Monorepo Root (scripts & orchestrator)
- epicshop Workshop UI (dev server & production build)
- Exercise Apps (micro-frontends under /exercises)
- Example Apps (reference under /examples)
- Shared Library (/shared)
- Build & Test Infrastructure (Vite configs, Playwright, Jest)
- CI/CD Pipeline (GitHub Actions)
- Deployment Targets (Docker container, Fly.io)
- Runtime Environment (Node.js, npm, browser with devtools)

- Root → epicshop & sub-apps: “npm run setup” links and installs
- epicshop ↔ Shared Library: imports utilities/components
- epicshop → Exercise Apps: dynamic import or iframe load on navigation (micro-frontend pattern)
- Build Infrastructure → epicshop & sub-apps: “vite build” / “webpack” → static assets
- Test Infrastructure → epicshop & sub-apps: Playwright (in-browser tests), Jest (unit/spec tests)
- CI/CD → GitHub Actions: runs lint, build, tests on push
- Deployment: Dockerfile builds container → fly.yaml deploys to Fly.io

c. Architectural patterns & design principles:
- Monorepo for unified versioning & dependency management
- Micro-frontends: each exercise is an isolated React app loaded at runtime
- Shared library for DRY utilities
- CI/CD automation for quality gates
- Containerization for consistent runtime

d. Key technologies & frameworks:
- React + TypeScript + Vite (dev & build)
- Playwright & Jest (testing)
- ESLint, GitHub Actions (CI)
- Docker, Fly.io (deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Code Modules
    Root["Monorepo Root"]:::codemodule
    Host["epicshop Host App"]:::codemodule
    Exercises["Micro-Frontends (Exercises)"]:::codemodule
    Examples["Reference Examples"]:::codemodule

    %% Shared Library
    Shared["Shared Library"]:::shared

    %% Infrastructure
    Build["Build Infrastructure"]:::infra
    Test["Test Infrastructure"]:::infra
    CI["CI/CD Pipeline"]:::infra

    %% Deployment & Runtime
    Deploy["Deployment Targets"]:::deployment
    Runtime["Runtime Environment"]:::deployment

    %% Relationships
    Root -->|"bootstrap (npm run setup)"| Host
    Root -->|"bootstrap (npm run setup)"| Exercises
    Root -->|"bootstrap (npm run setup)"| Examples
    Root -->|"imports utilities/components"| Shared

    Build -->|"vite build / webpack"| Host
    Build -->|"vite build / webpack"| Exercises

    Test -->|"Jest / Playwright"| Host
    Test -->|"Jest / Playwright"| Exercises

    CI -->|"runs lint, build, tests"| Root

    Host -->|"containerize"| Deploy
    Deploy -->|"deploy to Fly.io"| Runtime
    Runtime -->|"runs in Node.js & browser"| Host

    %% Click Events for Monorepo Root
    click Root "https://github.com/epicweb-dev/react-performance/blob/main/package.json"
    click Root "https://github.com/epicweb-dev/react-performance/blob/main/tsconfig.json"
    click Root "https://github.com/epicweb-dev/react-performance/blob/main/eslint.config.js"
    click CI "https://github.com/epicweb-dev/react-performance/blob/main/.github/workflows/validate.yml"

    %% Click Events for Host Application
    click Host "https://github.com/epicweb-dev/react-performance/tree/main/epicshop/"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/package.json"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/tsconfig.json"
    click Host "https://github.com/epicweb-dev/react-performance/tree/main/epicshop/Dockerfile"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/fly.yaml"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/playwright.config.js"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/setup.js"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/setup-custom.js"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/post-set-playground.js"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/test.js"
    click Host "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/in-browser-tests.spec.js"

    %% Click Events for Exercises
    click Exercises "https://github.com/epicweb-dev/react-performance/tree/main/exercises/"

    %% Click Events for Examples
    click Examples "https://github.com/epicweb-dev/react-performance/tree/main/examples/"
    click Examples "https://github.com/epicweb-dev/react-performance/tree/main/examples/unnecessary-rerenders/"

    %% Click Events for Shared Library
    click Shared "https://github.com/epicweb-dev/react-performance/tree/main/shared/"
    click Shared "https://github.com/epicweb-dev/react-performance/blob/main/shared/utils.tsx"
    click Shared "https://github.com/epicweb-dev/react-performance/blob/main/shared/blog-posts.tsx"
    click Shared "https://github.com/epicweb-dev/react-performance/blob/main/shared/get-component-calls.tsx"
    click Shared "https://github.com/epicweb-dev/react-performance/blob/main/shared/tsconfig.json"

    %% Click Events for Build Infra
    click Build "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/.diffignore"

    %% Click Events for Runtime Environment
    click Runtime "https://github.com/epicweb-dev/react-performance/blob/main/.npmrc"
    click Runtime "https://github.com/epicweb-dev/react-performance/blob/main/epicshop/.npmrc"
    click Runtime "https://github.com/epicweb-dev/react-performance/tree/main/.vscode/"
    click Runtime "https://github.com/epicweb-dev/react-performance/blob/main/.gitignore"
    click Runtime "https://github.com/epicweb-dev/react-performance/blob/main/.gitattributes"

    %% Styles
    classDef codemodule fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef shared fill:#b3e6b3,stroke:#333,stroke-width:1px
    classDef infra fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef deployment fill:#ffdd99,stroke:#333,stroke-width:1px
```
