# andreskasekamp/etak-andmemudel-react architecture

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

- Interactive diagram: https://gitdiagram.com/andreskasekamp/etak-andmemudel-react
- Repository: https://github.com/andreskasekamp/etak-andmemudel-react

## Overview

##### Main System Components

a) Client Layer:
- React Application (built with Vite)
- Router System (React Router)
- Internationalization System (i18n)

b) API Layer:
- Static JSON API files (organized in /api directory)
- WFS Request Handler (for external data fetching)

c) Infrastructure Layer:
- Nginx Server (production)
- Vite Development Server (development)
- Docker Container

##### Component Organization

a) Core Application Structure:
**Frontend Application**
- Router System
- Pages
- About
- Derivatives
- ThreeD
- NotFound
- Components
- Navigation
- Tables
- Data Display
- Helpers
- Shared Resources
- Translations
- Utils
- Interfaces

##### Data Flow Representation

- JSON data flow from API directory to components
- i18n translations loading
- Router navigation paths
- Component interactions

##### Key Architectural Patterns to Highlight

- Component-based architecture
- Static API integration
- Internationalization system
- Route-based code organization

##### Technical Stack Indicators
- Vite
- TypeScript
- React
- React Router
- Nginx
- Docker

- Client Browser     |

- ↓

- Nginx (Production)  |

- ↓

- React Application     |

- Router System  |  |

- Components     |  |

- API Interface  |  |

- ↓

- Static JSON API Files |

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph Infrastructure
        Nginx["Nginx Server"]:::infra
        Vite["Vite Dev Server"]:::infra
        Docker["Docker Container"]:::infra
    end

    subgraph Application
        ReactApp["React Application"]:::react
        click ReactApp "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/App.tsx"
        MainEntry["Application Entry"]:::react
        click MainEntry "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/main.tsx"

        subgraph Router
            RouterSystem["Router System"]:::router
            click RouterSystem "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/pages/router/router.tsx"
            MainWrapper["Main Wrapper"]:::router
            click MainWrapper "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/pages/router/MainWrapper.tsx"
        end

        subgraph Pages
            About["About Page"]:::page
            click About "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/pages/About.tsx"
            Derivatives["Derivatives Page"]:::page
            click Derivatives "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/pages/Derivatives.tsx"
            ThreeD["3D Page"]:::page
            click ThreeD "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/pages/ThreeD.tsx"
            NotFound["404 Page"]:::page
            click NotFound "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/pages/NotFoundPage.tsx"
        end

        subgraph Components
            Navigation["Navigation Components"]:::component
            click Navigation "https://github.com/AndresKasekamp/etak-andmemudel-react/tree/master/src/components/navbar"
            Tables["Table Components"]:::component
            click Tables "https://github.com/AndresKasekamp/etak-andmemudel-react/tree/master/src/components/table"
            DataDisplay["Data Display Components"]:::component
            click DataDisplay "https://github.com/AndresKasekamp/etak-andmemudel-react/tree/master/src/components/domains"
            Helpers["Helper Components"]:::component
            click Helpers "https://github.com/AndresKasekamp/etak-andmemudel-react/tree/master/src/components/helpers"
        end

        subgraph SharedResources
            I18N["i18n System"]:::util
            click I18N "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/utils/i18n/index.ts"
            Utils["Utilities"]:::util
            click Utils "https://github.com/AndresKasekamp/etak-andmemudel-react/tree/master/src/utils"
            Interfaces["Interfaces"]:::util
            click Interfaces "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/interfaces/interfaces.tsx"
            DataTypes["Data Types"]:::util
            click DataTypes "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/data/dataTypes.ts"
        end
    end

    subgraph APILayer
        StaticAPI["Static JSON API"]:::api
        click StaticAPI "https://github.com/AndresKasekamp/etak-andmemudel-react/tree/master/src/api"
        WFSHandler["WFS Request Handler"]:::api
        click WFSHandler "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/src/utils/wfsRequest.ts"
    end

    subgraph Translations
        EnTranslation["English Translations"]:::i18n
        click EnTranslation "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/public/locales/en/translation.json"
        EtTranslation["Estonian Translations"]:::i18n
        click EtTranslation "https://github.com/AndresKasekamp/etak-andmemudel-react/blob/master/public/locales/et/translation.json"
    end

    %% Connections
    Browser --> Nginx
    Browser --> Vite
    Nginx --> ReactApp
    Vite --> ReactApp
    Docker --> Nginx
    Docker --> Vite

    ReactApp --> MainEntry
    MainEntry --> RouterSystem
    RouterSystem --> MainWrapper
    MainWrapper --> Pages
    MainWrapper --> Components

    Components --> StaticAPI
    Components --> WFSHandler
    
    I18N --> Translations
    Components --> I18N
    Pages --> I18N

    %% Styling
    classDef react fill:#61DAFB,stroke:#000,color:#000
    classDef router fill:#CA4245,stroke:#000,color:#fff
    classDef page fill:#282c34,stroke:#000,color:#fff
    classDef component fill:#6C8EBF,stroke:#000,color:#fff
    classDef util fill:#9370DB,stroke:#000,color:#fff
    classDef api fill:#90EE90,stroke:#000,color:#000
    classDef infra fill:#FFA500,stroke:#000,color:#000
    classDef i18n fill:#FFB6C1,stroke:#000,color:#000
```
