# unknownnpasta/treasuryframe architecture

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

- Interactive diagram: https://gitdiagram.com/unknownnpasta/treasuryframe
- Repository: https://github.com/unknownnpasta/treasuryframe

## Overview

##### Project type and purpose
- This is a specialized desktop‐client application built on the Overwolf platform for the game Warframe.
- It uses modern web technologies (React + Redux + TypeScript + Vite) to provide an in-game overlay that tracks resources, parts, and fissures, and notifies the user.

##### File structure
Top-level directories:
- public – static assets and manifest.json for production
- mockup – design prototypes and sample data
- scripts – build helpers for Overwolf manifest and packaging
- src – actual application code, subdivided into:
– app – application shell, root component, global Redux store & shared constants
– components – generic, reusable UI components (e.g. Loading, ItemView)
– features – domain-specific features (rewardScreen, settings) with their hooks and components
– lib – platform integrations & utilities (Overwolf wrappers, IO, OCR, authentication)
– locales – i18n JSON files for multiple languages
– screens – three Overwolf “contexts”: background (headless processing), desktop overlay, in-game overlay, plus notification context
– types – global TypeScript definitions
- configuration – tsconfig.*, vite.config.ts, eslint.config.js, .env

##### README for additional insights
- Confirms tech stack: React, Redux, TypeScript
- Describes core features: resource/part/fissure tracking, in-game overlay
- Build process: `npm run build` → build folder with compiled app
- Run process: `npm run start` for development

a. Main components
1. Overwolf Launcher & Runtime
2. App Shell (src/app)
3. UI Screens
- Background Screen (analytics, log tailing, notifications)
- Desktop Screen (desktop overlay UI)
- In-game Screen (in-game overlay UI)
4. Redux Store & Root Reducer (shared state)
5. Services / Libraries (src/lib)
– Overwolf API wrappers
– Log tailing & OCR hooks
– Data fetching (GSFetch)
6. Localization Module (src/locales)
8. External systems
– Warframe game process & logs
– Overwolf platform APIs
– File system (for storage, traineddata)

b. Relationships and interactions
– Overwolf Launcher starts the app, injects the correct HTML/JS based on context (background, desktop, in-game).
– App Shell (index.tsx) initializes Redux store and React Router (or context dispatcher).
– Each Screen component subscribes to the Redux store, dispatches actions on user events or incoming data.
– Redux actions trigger service functions in src/lib (e.g., OCR, log tailing, Overwolf API calls).
– Services communicate with Overwolf APIs and Warframe logs, then dispatch results back into Redux.
– UI components render updated state; notifications are sent via background screen.
– Localization layer wraps text components using JSON dictionaries.

c. Architectural patterns & design principles
– Layered architecture: Presentation (React UI) → State (Redux) → Services (lib) → Platform (Overwolf/Game)
– Feature-based modules: isolated feature directories for rewardScreen and settings
– Separation of concerns: generic components vs. feature components vs. platform integration
– Single source of truth: centralized Redux store with typed actions & reducers

d. Key technologies & frameworks
– React + React-Redux + Redux Toolkit
– TypeScript
– Vite (build & dev server)
– Overwolf JavaScript API
– OCR hook (Tesseract or similar using eng.traineddata)
– Internationalization via JSON locales
– Custom build scripts (scripts/create-production-overwolf-build.js)

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Systems
    OverwolfRuntime(["Overwolf Launcher & Runtime"]):::external
    WarframeLogs(["Warframe Game Process & Logs"]):::external
    FileSystem(["File System (Storage & traineddata)"]):::external

    %% Deployment
    subgraph "Deployment & Build" 
        direction TB
        ScriptBuild(["scripts/create-production-overwolf-build.js"]):::deployment
        ScriptManifest(["scripts/update-manifest.js"]):::deployment
        ViteConfig(["vite.config.ts"]):::deployment
        MainEntry(["src/main.tsx"]):::deployment
    end

    %% Services / Platform Integrations
    subgraph "Services & Libraries" 
        direction TB
        OverwolfWrappers(["Overwolf API wrappers"]):::services
        LogOCR(["Log Tailing & OCR hooks"]):::services
        IOFetch(["I/O & Data fetching"]):::services
        AuthUtils(["Authentication & Game Utilities"]):::services
    end

    %% State Layer
    subgraph "State (Redux)" 
        direction TB
        ReduxStore(["Redux Store"]):::state
        RootReducer(["Root Reducer"]):::state
        Constants(["Shared Constants"]):::state
    end

    %% Presentation Layer
    subgraph "Presentation (React UI)" 
        direction TB
        subgraph "App Shell" 
            direction TB
            AppShellIndex(["src/app/index.ts"]):::presentation
            AppShellApp(["App.tsx"]):::presentation
            AppShellCurrent(["CurrentScreen.tsx"]):::presentation
        end

        Localization(["Localization Module"]):::presentation

        subgraph "UI Screens"
            direction TB
            subgraph "Background Screen"
                BGIndex(["src/screens/background/index.ts"]):::presentation
                BGScreen(["Screen.tsx"]):::presentation
            end
            subgraph "Desktop Screen"
                DesktopIndex(["src/screens/desktop/index.ts"]):::presentation
                DesktopScreen(["Screen.tsx"]):::presentation
            end
            subgraph "In-Game Screen"
                IngameIndex(["src/screens/ingame/index.ts"]):::presentation
                IngameScreen(["Screen.tsx"]):::presentation
            end
            NotificationContext(["Notification Context"]):::presentation
        end

        subgraph "Feature: Reward Screen"
            direction TB
            RewardIndex(["src/features/rewardScreen/index.ts"]):::presentation
            RewardComp(["rwScrn.tsx"]):::presentation
            RewardCSS(["rwScrn.css"]):::presentation
        end

        subgraph "Feature: Settings"
            direction TB
            SettingsIndex(["src/features/settings/index.ts"]):::presentation
            SettingsComp(["Settings.tsx"]):::presentation
            SettingsCSS(["settings.css"]):::presentation
        end
    end

    %% Data Flows and Interactions
    OverwolfRuntime --> AppShellIndex
    OverwolfRuntime --> BGIndex
    OverwolfRuntime --> DesktopIndex
    OverwolfRuntime --> IngameIndex

    AppShellIndex --> ReduxStore
    AppShellIndex --> AppShellApp
    AppShellApp --> AppShellCurrent

    AppShellApp --> BGIndex
    AppShellApp --> DesktopIndex
    AppShellApp --> IngameIndex
    AppShellApp --> NotificationContext

    BGIndex --> BGScreen
    DesktopIndex --> DesktopScreen
    IngameIndex --> IngameScreen

    BGScreen -->|dispatches actions| ReduxStore
    DesktopScreen -->|dispatches actions| ReduxStore
    IngameScreen -->|dispatches actions| ReduxStore

    ReduxStore --> RootReducer
    ReduxStore --> Constants

    ReduxStore --> BGScreen
    ReduxStore --> DesktopScreen
    ReduxStore --> IngameScreen
    ReduxStore --> AppShellApp

    BGScreen --> OverwolfWrappers
    BGScreen --> LogOCR
    BGScreen --> IOFetch
    BGScreen --> AuthUtils

    LogOCR --> WarframeLogs
    LogOCR --> FileSystem

    OverwolfWrappers --> OverwolfRuntime
    IOFetch --> FileSystem
    AuthUtils --> OverwolfRuntime

    Localization --> AppShellApp
    Localization --> BGScreen
    Localization --> DesktopScreen
    Localization --> IngameScreen
    Localization --> RewardComp
    Localization --> SettingsComp

    %% Build to runtime
    ScriptBuild --> ViteConfig
    ViteConfig --> MainEntry
    MainEntry --> OverwolfRuntime
    ScriptManifest --> OverwolfRuntime

    %% Click Events
    click OverwolfRuntime "https://github.com/unknownnpasta/treasuryframe/blob/main/public/manifest.json"
    click AppShellIndex "https://github.com/unknownnpasta/treasuryframe/blob/main/src/app/index.ts"
    click AppShellApp "https://github.com/unknownnpasta/treasuryframe/blob/main/src/app/components/App.tsx"
    click AppShellCurrent "https://github.com/unknownnpasta/treasuryframe/blob/main/src/app/components/CurrentScreen.tsx"
    click ReduxStore "https://github.com/unknownnpasta/treasuryframe/blob/main/src/app/shared/store.ts"
    click RootReducer "https://github.com/unknownnpasta/treasuryframe/blob/main/src/app/shared/rootReducer.ts"
    click Constants "https://github.com/unknownnpasta/treasuryframe/blob/main/src/app/shared/constants.ts"
    click BGIndex "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/background/index.ts"
    click BGScreen "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/background/components/Screen.tsx"
    click DesktopIndex "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/desktop/index.ts"
    click DesktopScreen "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/desktop/components/Screen.tsx"
    click IngameIndex "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/ingame/index.ts"
    click IngameScreen "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/ingame/components/Screen.tsx"
    click NotificationContext "https://github.com/unknownnpasta/treasuryframe/blob/main/src/screens/notification/.gitkeep"
    click OverwolfWrappers "https://github.com/unknownnpasta/treasuryframe/blob/main/src/lib/overwolf-essentials.ts"
    click LogOCR "https://github.com/unknownnpasta/treasuryframe/blob/main/src/lib/log.ts"
    click IOFetch "https://github.com/unknownnpasta/treasuryframe/blob/main/src/lib/io.ts"
    click AuthUtils "https://github.com/unknownnpasta/treasuryframe/blob/main/src/lib/auth.ts"
    click RewardIndex "https://github.com/unknownnpasta/treasuryframe/blob/main/src/features/rewardScreen/index.ts"
    click RewardComp "https://github.com/unknownnpasta/treasuryframe/blob/main/src/features/rewardScreen/components/rwScrn.tsx"
    click RewardCSS "https://github.com/unknownnpasta/treasuryframe/blob/main/src/features/rewardScreen/components/rwScrn.css"
    click SettingsIndex "https://github.com/unknownnpasta/treasuryframe/blob/main/src/features/settings/index.ts"
    click SettingsComp "https://github.com/unknownnpasta/treasuryframe/blob/main/src/features/settings/components/Settings.tsx"
    click SettingsCSS "https://github.com/unknownnpasta/treasuryframe/blob/main/src/features/settings/components/styles/settings.css"
    click Localization "https://github.com/unknownnpasta/treasuryframe/blob/main/src/locales/index.ts"
    click ScriptBuild "https://github.com/unknownnpasta/treasuryframe/blob/main/scripts/create-production-overwolf-build.js"
    click ScriptManifest "https://github.com/unknownnpasta/treasuryframe/blob/main/scripts/update-manifest.js"
    click ViteConfig "https://github.com/unknownnpasta/treasuryframe/blob/main/vite.config.ts"
    click MainEntry "https://github.com/unknownnpasta/treasuryframe/blob/main/src/main.tsx"

    %% Styles
    classDef presentation fill:#AEDFF7,stroke:#0366d6,color:#000
    classDef state fill:#C3F7A3,stroke:#228B22,color:#000
    classDef services fill:#F7C89B,stroke:#D2691E,color:#000
    classDef external fill:#D3D3D3,stroke:#696969,color:#000
    classDef deployment fill:#E8E8E8,stroke:#A9A9A9,color:#000
```
