Skip to content

Architecture Overview

ApexLab is a Windows desktop application for sim-racing telemetry analysis with a companion REST API.


High-Level Diagram

┌─────────────────────────────────────────────────────────────────┐
│                     Windows Desktop App                          │
│                                                                  │
│  SimCopilot.Connectors ──► SimCopilot.Core ──► SimCopilot.App  │
│       (game I/O)            (analysis)           (WPF UI)       │
│                                                                  │
│  SimCopilot.Lmu ─── SimCopilot.Storage ─── SimCopilot.Telemetry │
│  (LMU/rF2 SHM)      (SQLite + files)          (CSV I/O)        │
└───────────────────────────┬─────────────────────────────────────┘
                            │ REST (JWT Bearer)
┌─────────────────────────────────────────────────────────────────┐
│                     SimCopilot.Api (Railway)                     │
│                                                                  │
│  AuthController  SessionsController  LeaderboardsController     │
│  AiController    FeedController      AchievementsController     │
│                                                                  │
│  Neon Postgres ─── Redis ─── Claude API                         │
└─────────────────────────────────────────────────────────────────┘

Project Layer Summary

Project Layer Role
SimCopilot.Core Analysis Pure analysis engine, zero external deps
SimCopilot.Storage Persistence SQLite + CSV, no UI
SimCopilot.Telemetry I/O CSV read/write, SharePack ZIP
SimCopilot.Lmu I/O LMU/rF2 shared memory (Windows-only)
SimCopilot.Connectors I/O Multi-game abstraction
SimCopilot.Shared Contracts DTOs shared by App + API
SimCopilot.App UI WPF desktop client
SimCopilot.Api Cloud ASP.NET Core 8 REST API

For detailed per-project documentation see the Component Map.


Key Design Principles

  • Core is dependency-free. SimCopilot.Core has zero external dependencies — no UI, no disk, no network. This keeps the analysis logic testable and reusable.
  • No raw telemetry in the cloud. Full telemetry point arrays never leave the desktop. Only summaries (lap times, quality scores) are uploaded to the API.
  • Distance-based alignment. All lap comparison uses track distance (metres) as the primary axis, not time. This makes comparisons between laps of different pace meaningful.
  • Transactional outbox. Side effects (feed entries, achievements) are triggered via an outbox table in the same DB transaction as the business entity, ensuring no events are lost on process restart.