# duskagk/docker-react-app architecture

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

- Interactive diagram: https://gitdiagram.com/duskagk/docker-react-app
- Repository: https://github.com/duskagk/docker-react-app

## Overview

##### Main Components

A. Development Environment:
- Create React App Development Server
- Hot Module Replacement (HMR)
- Development Docker Container (from Dockerfile.dev)

B. Production Environment:
- Production Build Output
- Production Docker Container (from Dockerfile)
- Static File Server

C. Application Architecture:
- React Components Layer
- Asset Pipeline
- Testing Infrastructure

**[Development] | [Application Core] | [Production]**

##### Important Relationships

- Development server → Source code (watching)
- Source code → Build process
- Build process → Production artifacts
- Test runner → Source code
- Docker containers → Application code

##### Additional Details

- Port mappings (3000 for dev)
- Volume mounts for development
- npm scripts connections
- Webpack build pipeline
- Environment-specific configurations

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Development
        DevContainer[Development Container]
        DevServer[Development Server]
        HMR[Hot Module Replacement]
        DockerDev["Docker Dev Config"]
        DockerCompose["Docker Compose"]
    end

    subgraph "Application Core"
        direction TB
        AppEntry["Index.js"]
        MainApp["App.js"]
        AppCSS["App.css"]
        IndexCSS["index.css"]
        
        subgraph "Public Assets"
            HTMLTemplate["index.html"]
            Manifest["manifest.json"]
            Robots["robots.txt"]
        end
        
        subgraph "Configuration"
            PackageJSON["package.json"]
            PackageLock["package-lock.json"]
        end
    end

    subgraph "Testing Infrastructure"
        TestRunner[Jest Test Runner]
        TestSetup["Setup Tests"]
        AppTests["App Tests"]
        WebVitals["Web Vitals Reporter"]
    end

    subgraph Production
        ProdContainer[Production Container]
        ProdBuild[Production Build]
        DockerProd["Docker Prod Config"]
        StaticServer[Static File Server]
    end

    %% Development Flow
    DevContainer --> DevServer
    DevServer --> HMR
    HMR --> AppEntry
    DockerDev --> DevContainer
    DockerCompose --> DevContainer

    %% Application Core Relationships
    AppEntry --> MainApp
    MainApp --> AppCSS
    AppEntry --> IndexCSS
    MainApp --> HTMLTemplate

    %% Testing Relationships
    TestRunner --> AppTests
    TestRunner --> TestSetup
    WebVitals --> AppEntry

    %% Production Flow
    AppEntry --> ProdBuild
    ProdBuild --> ProdContainer
    DockerProd --> ProdContainer
    ProdContainer --> StaticServer

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef development fill:#dff0ff,stroke:#1a73e8
    classDef production fill:#e6f4ea,stroke:#137333
    classDef testing fill:#fce8e6,stroke:#c5221f
    classDef config fill:#f1f3f4,stroke:#5f6368

    class DevContainer,DevServer,HMR,DockerDev,DockerCompose development
    class ProdContainer,ProdBuild,DockerProd,StaticServer production
    class TestRunner,TestSetup,AppTests,WebVitals testing
    class PackageJSON,PackageLock config

    %% Click Events
    click DockerDev "https://github.com/duskagk/docker-react-app/blob/main/Dockerfile.dev"
    click DockerCompose "https://github.com/duskagk/docker-react-app/blob/main/docker-compose.yml"
    click DockerProd "https://github.com/duskagk/docker-react-app/tree/main/Dockerfile"
    click MainApp "https://github.com/duskagk/docker-react-app/blob/main/src/App.js"
    click AppEntry "https://github.com/duskagk/docker-react-app/blob/main/src/index.js"
    click AppCSS "https://github.com/duskagk/docker-react-app/blob/main/src/App.css"
    click IndexCSS "https://github.com/duskagk/docker-react-app/blob/main/src/index.css"
    click TestSetup "https://github.com/duskagk/docker-react-app/blob/main/src/setupTests.js"
    click AppTests "https://github.com/duskagk/docker-react-app/blob/main/src/App.test.js"
    click WebVitals "https://github.com/duskagk/docker-react-app/blob/main/src/reportWebVitals.js"
    click HTMLTemplate "https://github.com/duskagk/docker-react-app/blob/main/public/index.html"
    click Manifest "https://github.com/duskagk/docker-react-app/blob/main/public/manifest.json"
    click Robots "https://github.com/duskagk/docker-react-app/blob/main/public/robots.txt"
    click PackageJSON "https://github.com/duskagk/docker-react-app/blob/main/package.json"
    click PackageLock "https://github.com/duskagk/docker-react-app/blob/main/package-lock.json"
```
