Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 2.04 KB

File metadata and controls

45 lines (29 loc) · 2.04 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build & Run Commands

dotnet build
dotnet run                    # Starts on http://localhost:5089 or https://localhost:7068
dotnet watch run              # Hot-reload during development

No test projects exist in this solution.

Architecture

Blazor Web App (.NET 10.0, interactive server rendering) — a Trackmania mini-games site. Currently has one game: "Guess the Map."

Blazor Web App structure

  • App.razor — Root HTML document (replaces the old _Host.cshtml). Contains <HeadOutlet> and <Routes> with @rendermode="InteractiveServer".
  • Routes.razor — Router component that maps URLs to page components.
  • Program.cs — Registers services via AddRazorComponents().AddInteractiveServerComponents() and maps endpoints via MapRazorComponents<App>().AddInteractiveServerRenderMode().

Key layers

  • Pages/ — Razor components. GuessTheMap.razor is the main game with all game logic in its @code block (state management, clue progression, API calls).
  • TmExchangeApi/ — API clients and data models:
    • TmExchangeApiCaller — calls trackmania.exchange for map metadata
    • TrackmaniaIoApiCaller — calls trackmania.io for leaderboard data (world records)
    • StaticIds.cs — hardcoded map IDs and pack definitions (season campaigns + TMGL/World Tour)
    • MapDataModel.cs / TrackManiaMapLeaderboardModel.cs — DTOs
  • Shared/ — Layout (MainLayout.razor) and navigation (NavMenu.razor)

DI registration

Program.cs registers TmExchangeApiCaller and TrackmaniaIoApiCaller as singletons. Both use static HttpClient instances with a custom User-Agent header.

External APIs

All API calls require a User-Agent header (set in HttpClientHelpers.cs). Map thumbnails/screenshots come from trackmania.exchange URLs.

Dependencies

Key NuGet packages: ManiaAPI.* (Nadeo/Trackmania API wrappers), TmEssentials (time formatting via TimeInt32), Newtonsoft.Json.