# samfarah/ratingcalculator architecture

> Architecture diagram of the GitHub repository samfarah/ratingcalculator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/samfarah/ratingcalculator
- Repository: https://github.com/samfarah/ratingcalculator

## Overview

RatingCalculator is a World of Warcraft Mythic+ planner: users provide a character and target rating, and it calculates dungeon-run options and minimum key levels to reach that rating. The web controller and Discord bot are separate entry points into the same rating service. That service combines Raider.IO character and season data with Blizzard expansion and realm data, using an in-memory cache for selected lookups. The graph follows the sampled controller, service, and provider calls; unsampled view and calculation details are not expanded.

Main entry points: [`RatingCalculator/RcLibrary/Servcies/RatingCalculatorServices/RcService.cs`](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/RatingCalculatorServices/RcService.cs) (Rating planner), [`RatingCalculator/MythicPlanner/BackgroundServices/DiscordBotService.cs`](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/BackgroundServices/DiscordBotService.cs) (Discord bot), [`RatingCalculator/MythicPlanner/Controllers/HomeController.cs`](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/Controllers/HomeController.cs) (Planner controller), [`RatingCalculator/RcLibrary/Helpers/ApiHelper.cs`](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Helpers/ApiHelper.cs) (HTTP API helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_home["Planner controller<br/>[HomeController.cs]"]
  node_discord_bot["Discord bot"]
  node_web_models["Planner view models"]
end

subgraph group_planning["Rating planning"]
  node_rating_service["Rating planner<br/>[RcService.cs]"]
  node_character_result["Character results"]
end

subgraph group_providers["Game data providers"]
  node_raider_service["Raider.IO provider<br/>[RaiderIoService.cs]"]
  node_blizzard_service["Blizzard provider<br/>[BlizzardService.cs]"]
end

subgraph group_infrastructure["Shared infrastructure"]
  node_api_helper["HTTP API helper<br/>[ApiHelper.cs]"]
  node_cache_service["Cache service"]
  node_memory_cache[("In-memory cache")]
end

node_web_user(("Web user"))
node_discord_user(("Discord user"))
node_discord_platform(("Discord"))
node_raider_api(("Raider.IO API"))
node_blizzard_api(("Blizzard API"))

node_web_user -->|"submits search"| node_home
node_home -->|"requests plan"| node_rating_service
node_rating_service -->|"returns result"| node_home
node_home -->|"maps result"| node_web_models
node_discord_user -->|"invokes /plan"| node_discord_platform
node_discord_platform -->|"dispatches command"| node_discord_bot
node_discord_bot -->|"requests plan"| node_rating_service
node_rating_service -->|"returns result"| node_discord_bot
node_discord_bot -->|"maps result"| node_web_models
node_discord_bot -->|"sends response"| node_discord_platform
node_rating_service -->|"fetches character and season data"| node_raider_service
node_rating_service -->|"fetches expansion and realm data"| node_blizzard_service
node_rating_service -->|"gets cached lookups"| node_cache_service
node_blizzard_service -->|"gets token cache"| node_cache_service
node_raider_service -->|"requests API data"| node_api_helper
node_blizzard_service -->|"requests API data"| node_api_helper
node_api_helper -->|"sends requests"| node_raider_api
node_api_helper -->|"sends requests"| node_blizzard_api
node_cache_service -->|"reads and writes"| node_memory_cache

click node_home "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/Controllers/HomeController.cs"
click node_discord_bot "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/BackgroundServices/DiscordBotService.cs"
click node_rating_service "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/RatingCalculatorServices/RcService.cs"
click node_character_result "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Models/ProcessedCharacter.cs"
click node_raider_service "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/RaiderIoServices/RaiderIoService.cs"
click node_blizzard_service "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/BlizzardServices/BlizzardService.cs"
click node_api_helper "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Helpers/ApiHelper.cs"
click node_cache_service "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/MemoryCacheServices/MemoryCacheService.cs"
click node_web_models "https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/Models/WowCharacterViewModel.cs"

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_home,node_discord_bot,node_web_models,node_web_user,node_discord_user toneBlue
class node_rating_service,node_character_result toneAmber
class node_raider_service,node_blizzard_service,node_raider_api,node_blizzard_api toneMint
class node_api_helper,node_cache_service,node_memory_cache toneRose
class node_discord_platform toneIndigo
```

## Components

### User entry points

- [Planner controller](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/Controllers/HomeController.cs): `RatingCalculator/MythicPlanner/Controllers/HomeController.cs`
- [Discord bot](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/BackgroundServices/DiscordBotService.cs): `RatingCalculator/MythicPlanner/BackgroundServices/DiscordBotService.cs`
- [Planner view models](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/MythicPlanner/Models/WowCharacterViewModel.cs): `RatingCalculator/MythicPlanner/Models/WowCharacterViewModel.cs`

### Rating planning

- [Rating planner](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/RatingCalculatorServices/RcService.cs): `RatingCalculator/RcLibrary/Servcies/RatingCalculatorServices/RcService.cs`
- [Character results](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Models/ProcessedCharacter.cs): `RatingCalculator/RcLibrary/Models/ProcessedCharacter.cs`

### Game data providers

- [Raider.IO provider](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/RaiderIoServices/RaiderIoService.cs): `RatingCalculator/RcLibrary/Servcies/RaiderIoServices/RaiderIoService.cs`
- [Blizzard provider](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/BlizzardServices/BlizzardService.cs): `RatingCalculator/RcLibrary/Servcies/BlizzardServices/BlizzardService.cs`

### Shared infrastructure

- [HTTP API helper](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Helpers/ApiHelper.cs): `RatingCalculator/RcLibrary/Helpers/ApiHelper.cs`
- [Cache service](https://github.com/samfarah/ratingcalculator/blob/main/RatingCalculator/RcLibrary/Servcies/MemoryCacheServices/MemoryCacheService.cs): `RatingCalculator/RcLibrary/Servcies/MemoryCacheServices/MemoryCacheService.cs`
- **In-memory cache**

### Other components

- **Web user**
- **Discord user**
- **Discord**
- **Raider.IO API**
- **Blizzard API**

## Connections

- Web user → Planner controller: submits search
- Planner controller → Rating planner: requests plan
- Rating planner → Planner controller: returns result
- Planner controller → Planner view models: maps result
- Discord user → Discord: invokes /plan
- Discord → Discord bot: dispatches command
- Discord bot → Rating planner: requests plan
- Rating planner → Discord bot: returns result
- Discord bot → Planner view models: maps result
- Discord bot → Discord: sends response
- Rating planner → Raider.IO provider: fetches character and season data
- Rating planner → Blizzard provider: fetches expansion and realm data
- Rating planner → Cache service: gets cached lookups
- Blizzard provider → Cache service: gets token cache
- Raider.IO provider → HTTP API helper: requests API data
- Blizzard provider → HTTP API helper: requests API data
- HTTP API helper → Raider.IO API: sends requests
- HTTP API helper → Blizzard API: sends requests
- Cache service → In-memory cache: reads and writes
