Architecture Overview

TK Clip Manager follows a modular service architecture using .NET’s dependency injection and the hosted-service pattern.

High-Level Data Flow

Game (Valorant / LoL)
Overwolf GEP (port 8091)
OverwolfGepService ──► GameEventRouter
  │                        │
  │                   ┌────┴────┐
  │                   ▼         ▼
  │            Valorant    LeagueOfLegends
  │            Handler     Handler
  │                   └────┬────┘
  │                        │
  ▼                        ▼
ObsWebSocketService   EventLogWriter
  (OBS markers)        (timestamped logs)
  │                        │
  ▼                        ▼
LocalAiClipAnalyzer   ClipExtractor
  (scoring)            (FFmpeg extraction)
ClipManagerService (orchestrator + WebSocket server + dashboard)

Backend Services

The backend registers seven services as singletons via Host.CreateDefaultBuilder with UseWindowsService():

ServiceInterfaceResponsibility
OverwolfGepServiceIGameEventSourceWebSocket client connecting to Overwolf GEP with auto-reconnect
ObsWebSocketServiceIObsMarkerServiceWebSocket client connecting to OBS v5 with auto-reconnect
EventLogWriterIEventLogWriterWrites timestamped logs with millisecond precision (UTF-8)
LocalAiClipAnalyzerIAiClipAnalyzerRule-based scoring + optional ONNX model inference
ClipExtractorIClipExtractorFFmpeg-based clip extraction service
GameEventRouterIGameEventRouterRoutes raw events to game-specific handlers
ClipManagerServiceIHostedServiceMain orchestrator: WebSocket server, REST settings API, dashboard

Game Event Handlers

Two concrete handlers implement a common interface:

  • ValorantEventHandler — Processes Valorant-specific events (kills, spike actions, round flow, etc.)
  • LeagueOfLegendsEventHandler — Processes LoL-specific events (kills, objectives, champion select, etc.)

Each handler maps raw GEP events into normalized internal models and applies game-specific marker templates with placeholders like {weapon}, {round_number}, {champion}.

Frontend

The frontend is a TypeScript + Vue 3 application packaged as an Overwolf app. It connects to the backend via WebSocket on port 8765 and provides:

  • Real-time event feed
  • Clip analysis results with scoring
  • Configuration UI for all settings
  • Session history

Project Structure

TKClipManager/
├── Backend/           C# backend (.NET 8.0 Windows Service)
├── Frontend/          Overwolf frontend (TypeScript + Vue 3)
├── Tests/             xUnit unit tests
├── Installer/         WiX v4 MSI installer
├── Scripts/           Build, signing, prerequisites, Python clip extraction
├── Pipeline/          Azure DevOps CI/CD (build + release)
├── DOC/               User Guide, Developer Guide, Quick Reference
├── Examples/          Sample config and event log files
├── build.ps1          Unified build script
└── TKClipManager.sln  Visual Studio solution

NuGet Dependencies

Key backend packages:

PackageVersionPurpose
Microsoft.Extensions.Hosting.WindowsServices8.0.0Windows Service hosting
Newtonsoft.Json13.0.3JSON serialization
Websocket.Client5.1.1WebSocket connectivity
Microsoft.ML.OnnxRuntime1.17.0AI model inference
NAudio2.2.1Audio processing
OpenCvSharp44.9.0Video frame analysis