Key Modules
TypeScript Core (src/lib/)
Section titled “TypeScript Core (src/lib/)”types.ts — Shared Types
Section titled “types.ts — Shared Types”The single source of truth for all shared TypeScript types. Every other module imports from here. See the Types Reference for the full type definitions.
parser.ts — SimC String Parser
Section titled “parser.ts — SimC String Parser”Parses the SimC addon export string into a SimcProfile object.
Input: Raw text string from the SimC addon
Output: SimcProfile with character metadata, talent string, equipped gear, and bag items
Key behaviors:
- Lines starting with a class name (e.g.,
shaman="Thrall") are character declarations - Uncommented gear lines (e.g.,
head=,id=235602,...) are equipped items - Commented gear lines (e.g.,
# head=,id=229379,...) are bag items - All original lines preserved in
rawLinesfor profile reconstruction
combinator.ts — Combination Generator
Section titled “combinator.ts — Combination Generator”Pure function that takes OptimizationAxis[] and returns the cartesian product as CombinationSpec[].
Input: Array of optimization axes (gear, gems, enchants) Output: Array of combination specs, each with a unique name and override lines
Key behaviors:
- Produces the cartesian product of all axis options
- Gem axes are conditional — only included when their parent item is selected
- Enforces the 1000-combination hard cap
combo_0000is reserved for the baseline (currently equipped)
profileset-builder.ts — ProfileSet Builder
Section titled “profileset-builder.ts — ProfileSet Builder”Pure function that generates the complete .simc file content from combinations and the base profile.
Input: CombinationSpec[] + SimcProfile + SimSettings
Output: Complete .simc file string + manifest Map<string, CombinationSpec>
The generated file has four sections:
- Global options (fight_style, iterations, threads, etc.)
- Base character profile (from rawLines, unmodified)
- Enemy definitions (if >1 target)
- ProfileSet entries (one per non-baseline combination)
Also exports parseSimCResults() for parsing the json2 output back into SimResult[].
optimization-assembler.ts — Axis Collector
Section titled “optimization-assembler.ts — Axis Collector”Collects OptimizationAxis[] from all UI sections (gear, gems, enchants) and exposes the live combination count for the counter widget.
item-cache.ts — Item Name Cache
Section titled “item-cache.ts — Item Name Cache”Prefetches item names via invoke("fetch_item_data") and caches them in Tauri store with a 7-day TTL. Falls back to “Item #ID” if offline.
features.ts — Feature Flags
Section titled “features.ts — Feature Flags”Simple boolean flags for partially-built features:
export const FEATURES = { GEM_OPTIMIZATION: true, ENCHANT_OPTIMIZATION: true, EMBELLISHMENT_COMPARISON: false, TALENT_COMPARISON: false,} as const;presets/season-config.ts — Season Configuration
Section titled “presets/season-config.ts — Season Configuration”The only file edited for seasonal updates. Contains:
GEAR_TRACKS— gear tracks with bonus IDs and ilvl rangesGEM_PRESETS— current-season gemsENCHANT_PRESETS— current-season enchants per slotSOCKET_BONUS_ID— bonus ID that adds an extra socketCURRENT_SEASON— season metadata (name, start date, SimC branch)
Rust Backend (src-tauri/src/commands/)
Section titled “Rust Backend (src-tauri/src/commands/)”run_simc.rs — SimC Runner
Section titled “run_simc.rs — SimC Runner”The core Tauri command that runs simulations:
- Writes the
.simccontent to a temp file - Spawns the SimC sidecar via
app.shell().sidecar("simc") - Waits for completion — checks for json2 output file (not exit code)
- Returns the json2 content
- Cleans up temp files
config.rs — User Configuration
Section titled “config.rs — User Configuration”Reads and writes user configuration (SimC binary path override, thread count) via Tauri’s store plugin. Persists across sessions.
item_data.rs — Item Data & Search
Section titled “item_data.rs — Item Data & Search”fetch_item_data— Fetches item names from Wowhead XML APIsearch_items— Searches the bundleditems.dbSQLite database using FTS5 full-text search
React Components (src/components/)
Section titled “React Components (src/components/)”components/├── FirstRun.tsx ← First launch / binary error screen├── PasteScreen.tsx ← Main input area├── gear/│ ├── GearSlotCard.tsx ← One card per gear slot│ └── ItemSearch.tsx ← Inline unowned item search├── optimizations/│ ├── GemSelector.tsx ← Gem options per socket│ └── EnchantSelector.tsx ← Enchant options per slot├── results/│ ├── ResultsTable.tsx ← Main results display│ └── ResultRow.tsx ← Individual result row└── settings/ └── SimSettings.tsx ← Fight style, duration, etc.React Hooks (src/hooks/)
Section titled “React Hooks (src/hooks/)”useSimulation.ts— Manages simulation run state and TauriinvokecallsuseProfile.ts— Manages the parsedSimcProfilestate