# k0d13/steam-epic-games architecture

> Architecture diagram of the GitHub repository k0d13/steam-epic-games, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/k0d13/steam-epic-games
- Repository: https://github.com/k0d13/steam-epic-games

## Overview

Epic Games is a Millennium plugin that brings an Epic account and its games into Steam. The user signs in through the Steam Store menu, views and syncs the library in the plugin panel, then manages and launches games through Steam; the plugin also adds artwork, achievements, playtime, and purchase support. The map separates Steam integration, Epic-facing services, and shared state. Backend internals are represented by tree-supported paths; the excerpts do not establish their detailed call graph.

Main entry points: [`frontend/index.tsx`](https://github.com/k0d13/steam-epic-games/blob/main/frontend/index.tsx) (Plugin registration), [`frontend/services/steam-library.ts`](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/steam-library.ts) (Steam library sync), [`backend/legendary.lua`](https://github.com/k0d13/steam-epic-games/blob/main/backend/legendary.lua) (Legendary integration), [`frontend/components/plugin-panel.tsx`](https://github.com/k0d13/steam-epic-games/blob/main/frontend/components/plugin-panel.tsx) (Library panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin entry and UI"]
  node_plugin["Plugin registration<br/>[index.tsx]"]
  node_panel["Library panel<br/>[plugin-panel.tsx]"]
  node_settings["Settings and maintenance<br/>[settings.tsx]"]
end

subgraph group_epic["Epic account and library"]
  node_epicsession["Epic session<br/>[epic-session.ts]"]
  node_legendary["Legendary integration<br/>[legendary.lua]"]
  node_backendjobs["Install job backend<br/>[jobs.lua]"]
  node_backendlibrary["Library backend<br/>[library.lua]"]
end

subgraph group_steam["Steam integration"]
  node_storemenu["Epic Store menu<br/>[store-menu.ts]"]
  node_steamlibrary["Steam library sync<br/>[steam-library.ts]"]
  node_shortcuts["Steam shortcuts<br/>[shortcuts.ts]"]
  node_patches["Steam UI patches"]
  node_downloads["Download UI<br/>[downloads.ts]"]
end

subgraph group_features["Game features"]
  node_artwork["Artwork service<br/>[artwork.ts]"]
  node_achievements["Achievements<br/>[achievements.ts]"]
  node_playtime["Playtime tracking<br/>[playtime.ts]"]
  node_orders["Store purchases<br/>[orders.ts]"]
  node_notifications["Notifications<br/>[notifications.ts]"]
end

subgraph group_state["Shared state"]
  node_jobs["Job tracking<br/>[jobs.ts]"]
  node_achievementcache["Achievement cache<br/>[achievements.ts]"]
  node_library["Epic game library state<br/>[library.ts]"]
  node_appids["Shortcut ID mapping<br/>[app-ids.ts]"]
  node_storage[("Persistent local state<br/>[storage.ts]")]
end

node_user(("Steam user"))
node_epic(("Epic Games services"))

node_user -->|"signs in"| node_storemenu
node_user -->|"opens and syncs"| node_panel
node_plugin -->|"registers"| node_panel
node_panel -->|"requests sync"| node_steamlibrary
node_panel -.->|"uses account"| node_epicsession
node_storemenu -.->|"starts sign-in"| node_epicsession
node_epicsession -.->|"uses integration"| node_legendary
node_legendary -->|"accesses account"| node_epic
node_legendary -.->|"provides library"| node_backendlibrary
node_legendary -.->|"runs game jobs"| node_backendjobs
node_steamlibrary -->|"updates"| node_library
node_steamlibrary -->|"maps shortcuts"| node_appids
node_steamlibrary -.->|"reconciles"| node_shortcuts
node_steamlibrary -->|"applies artwork"| node_artwork
node_settings -->|"manages sync"| node_steamlibrary
node_shortcuts -->|"stores IDs"| node_appids
node_plugin -->|"registers patches"| node_patches
node_patches -.->|"includes download view"| node_downloads
node_downloads -->|"reads progress"| node_jobs
node_plugin -->|"resumes polling"| node_jobs
node_plugin -->|"notifies completion"| node_notifications
node_plugin -->|"tracks game stops"| node_playtime
node_plugin -->|"refreshes achievements"| node_achievementcache
node_achievements -->|"reads achievements"| node_achievementcache
node_orders -->|"uses session"| node_epicsession
node_orders -.->|"sends notices"| node_notifications
node_appids -->|"persists mapping"| node_storage

click node_plugin "https://github.com/k0d13/steam-epic-games/blob/main/frontend/index.tsx"
click node_panel "https://github.com/k0d13/steam-epic-games/blob/main/frontend/components/plugin-panel.tsx"
click node_settings "https://github.com/k0d13/steam-epic-games/blob/main/frontend/components/settings.tsx"
click node_storemenu "https://github.com/k0d13/steam-epic-games/blob/main/frontend/patches/store-menu.ts"
click node_epicsession "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/epic-session.ts"
click node_legendary "https://github.com/k0d13/steam-epic-games/blob/main/backend/legendary.lua"
click node_backendjobs "https://github.com/k0d13/steam-epic-games/blob/main/backend/jobs.lua"
click node_backendlibrary "https://github.com/k0d13/steam-epic-games/blob/main/backend/library.lua"
click node_steamlibrary "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/steam-library.ts"
click node_shortcuts "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/shortcuts.ts"
click node_patches "https://github.com/k0d13/steam-epic-games/tree/main/frontend/patches"
click node_downloads "https://github.com/k0d13/steam-epic-games/blob/main/frontend/patches/downloads.ts"
click node_jobs "https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/jobs.ts"
click node_artwork "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/artwork.ts"
click node_achievements "https://github.com/k0d13/steam-epic-games/blob/main/frontend/patches/achievements.ts"
click node_achievementcache "https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/achievements.ts"
click node_playtime "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/playtime.ts"
click node_orders "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/orders.ts"
click node_notifications "https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/notifications.ts"
click node_library "https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/library.ts"
click node_appids "https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/app-ids.ts"
click node_storage "https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/storage.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_panel,node_settings,node_user toneBlue
class node_epicsession,node_legendary,node_backendjobs,node_backendlibrary toneAmber
class node_storemenu,node_steamlibrary,node_shortcuts,node_patches,node_downloads toneMint
class node_artwork,node_achievements,node_playtime,node_orders,node_notifications toneRose
class node_jobs,node_achievementcache,node_library,node_appids,node_storage,node_epic toneIndigo
```

## Components

### Plugin entry and UI

- [Plugin registration](https://github.com/k0d13/steam-epic-games/blob/main/frontend/index.tsx): `frontend/index.tsx`
- [Library panel](https://github.com/k0d13/steam-epic-games/blob/main/frontend/components/plugin-panel.tsx): `frontend/components/plugin-panel.tsx`
- [Settings and maintenance](https://github.com/k0d13/steam-epic-games/blob/main/frontend/components/settings.tsx): `frontend/components/settings.tsx`

### Epic account and library

- [Epic session](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/epic-session.ts): `frontend/services/epic-session.ts`
- [Legendary integration](https://github.com/k0d13/steam-epic-games/blob/main/backend/legendary.lua): `backend/legendary.lua`
- [Install job backend](https://github.com/k0d13/steam-epic-games/blob/main/backend/jobs.lua): `backend/jobs.lua`
- [Library backend](https://github.com/k0d13/steam-epic-games/blob/main/backend/library.lua): `backend/library.lua`

### Steam integration

- [Epic Store menu](https://github.com/k0d13/steam-epic-games/blob/main/frontend/patches/store-menu.ts): `frontend/patches/store-menu.ts`
- [Steam library sync](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/steam-library.ts): `frontend/services/steam-library.ts`
- [Steam shortcuts](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/shortcuts.ts): `frontend/services/shortcuts.ts`
- [Steam UI patches](https://github.com/k0d13/steam-epic-games/tree/main/frontend/patches): `frontend/patches`
- [Download UI](https://github.com/k0d13/steam-epic-games/blob/main/frontend/patches/downloads.ts): `frontend/patches/downloads.ts`

### Game features

- [Artwork service](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/artwork.ts): `frontend/services/artwork.ts`
- [Achievements](https://github.com/k0d13/steam-epic-games/blob/main/frontend/patches/achievements.ts): `frontend/patches/achievements.ts`
- [Playtime tracking](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/playtime.ts): `frontend/services/playtime.ts`
- [Store purchases](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/orders.ts): `frontend/services/orders.ts`
- [Notifications](https://github.com/k0d13/steam-epic-games/blob/main/frontend/services/notifications.ts): `frontend/services/notifications.ts`

### Shared state

- [Job tracking](https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/jobs.ts): `frontend/state/jobs.ts`
- [Achievement cache](https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/achievements.ts): `frontend/state/achievements.ts`
- [Epic game library state](https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/library.ts): `frontend/state/library.ts`
- [Shortcut ID mapping](https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/app-ids.ts): `frontend/state/app-ids.ts`
- [Persistent local state](https://github.com/k0d13/steam-epic-games/blob/main/frontend/state/storage.ts): `frontend/state/storage.ts`

### Other components

- **Steam user**
- **Epic Games services**

## Connections

- Steam user → Epic Store menu: signs in (evidence: `README.md`)
- Steam user → Library panel: opens and syncs (evidence: `README.md`)
- Plugin registration → Library panel: registers (evidence: `frontend/index.tsx`)
- Library panel → Steam library sync: requests sync (evidence: `frontend/components/plugin-panel.tsx`)
- Library panel → Epic session: uses account
- Epic Store menu → Epic session: starts sign-in
- Epic session → Legendary integration: uses integration (evidence: `README.md`)
- Legendary integration → Epic Games services: accesses account (evidence: `README.md`)
- Legendary integration → Library backend: provides library
- Legendary integration → Install job backend: runs game jobs
- Steam library sync → Epic game library state: updates (evidence: `frontend/services/steam-library.ts`)
- Steam library sync → Shortcut ID mapping: maps shortcuts (evidence: `frontend/services/steam-library.ts`)
- Steam library sync → Steam shortcuts: reconciles (evidence: `frontend/services/steam-library.ts`)
- Steam library sync → Artwork service: applies artwork (evidence: `frontend/services/steam-library.ts`)
- Settings and maintenance → Steam library sync: manages sync (evidence: `frontend/components/settings.tsx`)
- Steam shortcuts → Shortcut ID mapping: stores IDs (evidence: `frontend/services/shortcuts.ts`)
- Plugin registration → Steam UI patches: registers patches (evidence: `frontend/index.tsx`)
- Steam UI patches → Download UI: includes download view (evidence: `frontend/patches/download-overview.ts`)
- Download UI → Job tracking: reads progress (evidence: `frontend/patches/downloads.ts`)
- Plugin registration → Job tracking: resumes polling (evidence: `frontend/index.tsx`)
- Plugin registration → Notifications: notifies completion (evidence: `frontend/index.tsx`)
- Plugin registration → Playtime tracking: tracks game stops (evidence: `frontend/index.tsx`)
- Plugin registration → Achievement cache: refreshes achievements (evidence: `frontend/index.tsx`)
- Achievements → Achievement cache: reads achievements (evidence: `frontend/patches/achievements.ts`)
- Store purchases → Epic session: uses session (evidence: `frontend/services/orders.ts`)
- Store purchases → Notifications: sends notices (evidence: `frontend/services/orders.ts`)
- Shortcut ID mapping → Persistent local state: persists mapping (evidence: `frontend/state/app-ids.ts`)
