# albericod/overwolf-modern-react-boilerplate architecture

> Architecture diagram of the GitHub repository albericod/overwolf-modern-react-boilerplate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/albericod/overwolf-modern-react-boilerplate
- Repository: https://github.com/albericod/overwolf-modern-react-boilerplate

## Overview

##### Project Type & Purpose
- The project is a boilerplate/template for developing Overwolf applications using React, Redux Toolkit, and i18next. It is tailored for Overwolf’s app distribution platform and supports the development of multi-screen apps (e.g., Desktop, InGame, Background) that run within the Overwolf ecosystem.
- The project sets up an opinionated rapid development environment (with CI/CD, remote Redux debugging, and Overwolf packaging support) by structuring the code in a feature-folder pattern to ensure high modularity and scalability.

a. Main Components of the System:
- Overwolf-specific integration layer:
- Overwolf API client and helpers (present in “src/lib/overwolf-essentials.ts” and other lib files)
- Frontend Application (React):
- Global application shell (in “src/app”)
- Generic reusable components (in “src/components”)
- Business-specific features (in “src/features”)
- Multiple App Screens:
- Background Screen (handles app process tasks)
- Desktop Screen (provides key UI elements on a desktop overlay)
- InGame Screen (offers UI for in-game interactions)
- Internationalization Module:
- “locales” folder with multiple languages support
- Build & Deployment Pipeline:
- CI/CD (GitHub Actions workflows, npm build scripts and packaging commands)
- Overwolf build scripts (e.g., create-production-overwolf-build.js)

b. Relationships and Interactions:
- The application enters through the “index.tsx” (bootstrapping react app).
- App components in the “app” folder integrate the Redux store and routing (if any).
- Feature modules communicate with shared libraries (“lib”) for common tasks like authentication, logging, and Overwolf API interactions.
- Screens are created as entry points defined in the Overwolf manifest, with each screen (background, desktop, ingame) having its own folder.
- CI/CD pipelines (defined in .github/workflows) automatically run build scripts (npm run build:overwolf) and testing, and then package the application for submission.

c. Architectural Patterns & Design Principles:
- Feature-Folder Architecture: Encourages modularity and reusability. Each feature (monetization, overview) encapsulates its components, hooks, and styles.
- Separation of Concerns: Clear division between generic UI components (in “components”) and domain-specific features (in “features”).
- Internationalization: Centralized locale files with a standardized naming format.
- CI/CD automation using GitHub actions streamlines the build and release process for Overwolf’s distribution.

d. Technologies/Frameworks/Libraries Impacting the Architecture:
- React JS: UI rendering.
- Redux Toolkit: Centralized state management.
- i18next: Internationalization support.
- Overwolf API: Integration with the Overwolf platform.
- TypeScript: Ensuring type safety in a complex code structure.
- GitHub Actions: CI/CD automation.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        entryPoint["index.tsx (Entry Point)"]:::presentation
        globalShell["Global Application Shell"]:::presentation
        uiComponents["Reusable UI Components"]:::presentation
        bgScreen["Background Screen"]:::presentation
        desktopScreen["Desktop Screen"]:::presentation
        ingameScreen["InGame Screen"]:::presentation
    end

    %% Business/Feature Layer
    subgraph "Business/Feature Layer"
        businessFeatures["Business-Specific Features"]:::business
    end

    %% Utility/Integration Layer
    subgraph "Utility/Integration Layer"
        apiInt["Overwolf API Integration"]:::integration
        i18n["Internationalization Module"]:::integration
    end

    %% CI/CD Pipeline Layer
    subgraph "CI/CD Pipeline"
        repo["Code Repository"]:::repository
        ciPipeline["CI/CD Build Pipeline"]:::cicd
        buildScripts["Overwolf Build Scripts"]:::cicd
    end

    %% Relationships in Presentation Layer
    entryPoint -->|"bootstraps"| globalShell
    globalShell -->|"renders"| uiComponents
    globalShell -->|"displays"| bgScreen
    globalShell -->|"displays"| desktopScreen
    globalShell -->|"displays"| ingameScreen
    globalShell -->|"integratesWith"| businessFeatures

    %% Relationships connecting Business and Utility Layers
    businessFeatures -->|"utilizes"| apiInt
    businessFeatures -->|"supports"| i18n

    %% Relationships for CI/CD Pipeline
    businessFeatures -->|"committedTo"| repo
    repo -->|"triggers"| ciPipeline
    ciPipeline -->|"executes"| buildScripts

    %% Click Events
    click globalShell "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/app"
    click uiComponents "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/components"
    click businessFeatures "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/features"
    click apiInt "https://github.com/albericod/overwolf-modern-react-boilerplate/blob/master/template/src/lib/overwolf-essentials.ts"
    click bgScreen "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/screens/background"
    click desktopScreen "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/screens/desktop"
    click ingameScreen "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/screens/ingame"
    click i18n "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/template/src/locales"
    click ciPipeline "https://github.com/albericod/overwolf-modern-react-boilerplate/tree/master/.github/workflows"
    click buildScripts "https://github.com/albericod/overwolf-modern-react-boilerplate/blob/master/template/scripts/create-production-overwolf-build.js"

    %% Styles
    classDef presentation fill:#d0f0fd,stroke:#333,stroke-width:2px;
    classDef business fill:#cef2d8,stroke:#333,stroke-width:2px;
    classDef integration fill:#ffdead,stroke:#333,stroke-width:2px;
    classDef cicd fill:#ffcccb,stroke:#333,stroke-width:2px;
    classDef repository fill:#e0e0e0,stroke:#333,stroke-width:2px;
```
