# mihlalimandoyi-hub/spincode2 architecture

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

- Interactive diagram: https://gitdiagram.com/mihlalimandoyi-hub/spincode2
- Repository: https://github.com/mihlalimandoyi-hub/spincode2

## Overview

SpinCode is a cross-platform MAUI code-breaking game. The main player journey is to enter a round, submit guesses for feedback, and optionally pursue hints, achievements, and leaderboard results. The graph includes those documented product areas, but the main page implementations were not excerpted, so their links to game services are shown as unverified. Local achievement and leaderboard persistence, and the spin engine’s peg-status model, are directly supported by excerpts.

Main entry points: [`SpinCode/Pages/GamePage.xaml.cs`](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/GamePage.xaml.cs) (Game Page), [`SpinCode/Services/LeaderboardService.cs`](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/LeaderboardService.cs) (Leaderboard Service), [`SpinCode/Services/AchievementService.cs`](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/AchievementService.cs) (Achievement Service), [`SpinCode/Pages/WelcomePage.xaml.cs`](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/WelcomePage.xaml.cs) (Welcome Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_maui["MAUI Bootstrap<br/>[MauiProgram.cs]"]
  node_appclass["Application<br/>[App.xaml.cs]"]
  node_shell["Navigation Shell<br/>[AppShell.xaml.cs]"]
  node_welcome["Welcome Page"]
end

subgraph group_game["Game Play"]
  node_gamepage["Game Page<br/>[GamePage.xaml.cs]"]
  node_engine["Spin Engine<br/>[SpinEngine.cs]"]
  node_hints["Hint Bank<br/>[HintBankService.cs]"]
end

subgraph group_progress["Player Progress"]
  node_leaderboardpage["Leaderboard Page"]
  node_leaderboard["Leaderboard Service"]
  node_achievements["Achievement Service"]
  node_preferences[("MAUI Preferences")]
end

subgraph group_models["Game Models"]
  node_spinresult["Guess Result<br/>[SpinResult.cs]"]
  node_pegstatus["Peg Status<br/>[PegStatus.cs]"]
  node_entry["Leaderboard Entry"]
  node_achievement["Achievement<br/>[Achievement.cs]"]
end

node_player(("Player"))

node_player -.->|"opens app"| node_welcome
node_maui -.->|"creates app"| node_appclass
node_appclass -.->|"hosts navigation"| node_shell
node_shell -.->|"routes to"| node_welcome
node_welcome -.->|"starts round"| node_gamepage
node_gamepage -.->|"evaluates guesses"| node_engine
node_gamepage -.->|"requests hints"| node_hints
node_engine -.->|"produces feedback"| node_spinresult
node_spinresult -->|"uses statuses"| node_pegstatus
node_gamepage -.->|"records wins"| node_achievements
node_achievements -->|"returns unlocks"| node_achievement
node_achievements -->|"reads and writes"| node_preferences
node_gamepage -.->|"saves wins"| node_leaderboard
node_leaderboardpage -.->|"loads rankings"| node_leaderboard
node_leaderboard -->|"stores entries"| node_entry
node_leaderboard -->|"reads and writes"| node_preferences

click node_maui "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/MauiProgram.cs"
click node_appclass "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/App.xaml.cs"
click node_shell "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/AppShell.xaml.cs"
click node_welcome "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/WelcomePage.xaml.cs"
click node_gamepage "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/GamePage.xaml.cs"
click node_engine "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/SpinEngine.cs"
click node_hints "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/HintBankService.cs"
click node_spinresult "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/SpinResult.cs"
click node_pegstatus "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/PegStatus.cs"
click node_leaderboardpage "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/LeaderboardPage.xaml.cs"
click node_leaderboard "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/LeaderboardService.cs"
click node_entry "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/LeaderboardEntry.cs"
click node_achievements "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/AchievementService.cs"
click node_achievement "https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/Achievement.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_maui,node_appclass,node_shell,node_welcome toneBlue
class node_gamepage,node_engine,node_hints toneAmber
class node_leaderboardpage,node_leaderboard,node_achievements,node_preferences toneMint
class node_spinresult,node_pegstatus,node_entry,node_achievement toneRose
class node_player toneIndigo
```

## Components

### App Shell

- [MAUI Bootstrap](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/MauiProgram.cs): `SpinCode/MauiProgram.cs`
- [Application](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/App.xaml.cs): `SpinCode/App.xaml.cs`
- [Navigation Shell](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/AppShell.xaml.cs): `SpinCode/AppShell.xaml.cs`
- [Welcome Page](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/WelcomePage.xaml.cs): `SpinCode/Pages/WelcomePage.xaml.cs`

### Game Play

- [Game Page](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/GamePage.xaml.cs): `SpinCode/Pages/GamePage.xaml.cs`
- [Spin Engine](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/SpinEngine.cs): `SpinCode/Services/SpinEngine.cs`
- [Hint Bank](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/HintBankService.cs): `SpinCode/Services/HintBankService.cs`

### Player Progress

- [Leaderboard Page](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Pages/LeaderboardPage.xaml.cs): `SpinCode/Pages/LeaderboardPage.xaml.cs`
- [Leaderboard Service](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/LeaderboardService.cs): `SpinCode/Services/LeaderboardService.cs`
- [Achievement Service](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Services/AchievementService.cs): `SpinCode/Services/AchievementService.cs`
- **MAUI Preferences**

### Game Models

- [Guess Result](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/SpinResult.cs): `SpinCode/Models/SpinResult.cs`
- [Peg Status](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/PegStatus.cs): `SpinCode/Models/PegStatus.cs`
- [Leaderboard Entry](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/LeaderboardEntry.cs): `SpinCode/Models/LeaderboardEntry.cs`
- [Achievement](https://github.com/mihlalimandoyi-hub/spincode2/blob/main/SpinCode/Models/Achievement.cs): `SpinCode/Models/Achievement.cs`

### Other components

- **Player**

## Connections

- Player → Welcome Page: opens app
- MAUI Bootstrap → Application: creates app
- Application → Navigation Shell: hosts navigation
- Navigation Shell → Welcome Page: routes to
- Welcome Page → Game Page: starts round
- Game Page → Spin Engine: evaluates guesses
- Game Page → Hint Bank: requests hints
- Spin Engine → Guess Result: produces feedback
- Guess Result → Peg Status: uses statuses (evidence: `SpinCode/Models/SpinResult.cs`)
- Game Page → Achievement Service: records wins
- Achievement Service → Achievement: returns unlocks (evidence: `SpinCode/Services/AchievementService.cs`)
- Achievement Service → MAUI Preferences: reads and writes (evidence: `SpinCode/Services/AchievementService.cs`)
- Game Page → Leaderboard Service: saves wins
- Leaderboard Page → Leaderboard Service: loads rankings
- Leaderboard Service → Leaderboard Entry: stores entries (evidence: `SpinCode/Services/LeaderboardService.cs`)
- Leaderboard Service → MAUI Preferences: reads and writes (evidence: `SpinCode/Services/LeaderboardService.cs`)
