# aimanmughal2267-source/dsa_cca_suduko architecture

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

- Interactive diagram: https://gitdiagram.com/aimanmughal2267-source/dsa_cca_suduko
- Repository: https://github.com/aimanmughal2267-source/dsa_cca_suduko

## Overview

SudokuSerenity is a desktop Sudoku game with multiple grid sizes, daily and relaxed play, guidance and undo/redo, player profiles, saved sessions, statistics, rankings, achievements, and a garden that grows with completed puzzles. The workflow starts in the SFML UI, enters a game session, and records completed play into history, scores, and profile progress. Edges are limited to relationships visible in the supplied excerpts or SOURCE INDEX; several screen and persistence internals were not sampled, so those details are left out.

Main entry points: [`SudokuSerenity/src/UIManager.cpp`](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/UIManager.cpp) (UI manager), [`SudokuSerenity/src/Game.cpp`](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Game.cpp) (Game session), [`SudokuSerenity/include/ds`](https://github.com/aimanmughal2267-source/dsa_cca_suduko/tree/main/SudokuSerenity/include/ds) (Core data structures), [`SudokuSerenity/src/Garden.cpp`](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Garden.cpp) (Progress garden)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and screens"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_ui["UI manager<br/>[UIManager.cpp]"]
  node_home["Home screen<br/>[HomeScreen.cpp]"]
  node_newgame["New-game screen<br/>[NewGameScreen.cpp]"]
  node_gamescreen["Game screen<br/>[GameScreen.cpp]"]
  node_result["Result screen<br/>[ResultScreen.cpp]"]
  node_stats["Statistics screen<br/>[StatsScreen.cpp]"]
  node_leaderscreen["Leaderboard screen"]
  node_profilescreen["Profile screen<br/>[ProfileScreen.cpp]"]
end

subgraph group_puzzle["Puzzle play"]
  node_session["Game session<br/>[Game.cpp]"]
  node_generator["Puzzle generation"]
  node_board["Sudoku board<br/>[SudokuBoard.cpp]"]
  node_solver["Sudoku solver<br/>[SudokuSolver.cpp]"]
  node_constraints["Constraint graph"]
end

subgraph group_records["Player records"]
  node_players[("Player profiles<br/>[Player.cpp]")]
  node_history[("Game history<br/>[History.cpp]")]
  node_scores[("Score manager<br/>[ScoreManager.cpp]")]
  node_leaderboard["Leaderboard ranking<br/>[Leaderboard.cpp]"]
  node_achievements["Achievements<br/>[Achievements.cpp]"]
end

subgraph group_presentation["Visual features"]
  node_garden["Progress garden<br/>[Garden.cpp]"]
  node_drawing["Drawing helpers<br/>[Draw.cpp]"]
  node_audio["Music player<br/>[Audio.cpp]"]
end

subgraph group_structures["Data structures"]
  node_ds["Core data structures"]
end

node_player(("Player"))

node_player -->|"launches"| node_entry
node_entry -->|"runs"| node_ui
node_ui -->|"creates and routes"| node_home
node_ui -->|"creates and routes"| node_newgame
node_ui -->|"creates and routes"| node_gamescreen
node_ui -->|"creates and routes"| node_result
node_ui -->|"creates and routes"| node_stats
node_ui -->|"creates and routes"| node_leaderscreen
node_ui -->|"creates and routes"| node_profilescreen
node_ui -->|"starts and resumes"| node_session
node_ui -->|"loads and updates"| node_players
node_ui -->|"loads and records"| node_history
node_ui -->|"loads and adds scores"| node_scores
node_ui -->|"builds rankings"| node_leaderboard
node_ui -->|"records achievements"| node_achievements
node_ui -->|"calculates progress stage"| node_garden
node_ui -->|"starts music"| node_audio
node_session -->|"uses puzzles"| node_generator
node_session -->|"stores grid state"| node_board
node_session -->|"solves on give-up"| node_solver
node_session -->|"checks conflicts"| node_constraints
node_session -->|"computes score"| node_scores
node_gamescreen -.->|"handles game actions"| node_session
node_scores -->|"uses BST"| node_ds
node_players -->|"uses hash table"| node_ds
node_history -->|"uses linked list"| node_ds
node_leaderboard -.->|"uses heap"| node_ds
node_constraints -->|"uses graph"| node_ds
node_drawing -->|"draws badges"| node_achievements
node_home -->|"shows garden"| node_garden
node_profilescreen -->|"shows garden progress"| node_garden
node_stats -->|"shows garden progress"| node_garden

click node_entry "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/main.cpp"
click node_ui "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/UIManager.cpp"
click node_home "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/HomeScreen.cpp"
click node_newgame "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/NewGameScreen.cpp"
click node_gamescreen "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/GameScreen.cpp"
click node_result "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/ResultScreen.cpp"
click node_stats "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/StatsScreen.cpp"
click node_leaderscreen "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/LeaderboardScreen.cpp"
click node_profilescreen "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/ProfileScreen.cpp"
click node_session "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Game.cpp"
click node_generator "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/PuzzleGenerator.cpp"
click node_board "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/SudokuBoard.cpp"
click node_solver "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/SudokuSolver.cpp"
click node_constraints "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/ConstraintGraph.cpp"
click node_players "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Player.cpp"
click node_history "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/History.cpp"
click node_scores "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/ScoreManager.cpp"
click node_leaderboard "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Leaderboard.cpp"
click node_achievements "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Achievements.cpp"
click node_garden "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Garden.cpp"
click node_drawing "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Draw.cpp"
click node_audio "https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Audio.cpp"
click node_ds "https://github.com/aimanmughal2267-source/dsa_cca_suduko/tree/main/SudokuSerenity/include/ds"

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_entry,node_ui,node_home,node_newgame,node_gamescreen,node_result,node_stats,node_leaderscreen,node_profilescreen toneBlue
class node_session,node_generator,node_board,node_solver,node_constraints toneAmber
class node_players,node_history,node_scores,node_leaderboard,node_achievements toneMint
class node_garden,node_drawing,node_audio toneRose
class node_ds,node_player toneIndigo
```

## Components

### App and screens

- [Application entry](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/main.cpp): `SudokuSerenity/src/main.cpp`
- [UI manager](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/UIManager.cpp): `SudokuSerenity/src/UIManager.cpp`
- [Home screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/HomeScreen.cpp): `SudokuSerenity/src/screens/HomeScreen.cpp`
- [New-game screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/NewGameScreen.cpp): `SudokuSerenity/src/screens/NewGameScreen.cpp`
- [Game screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/GameScreen.cpp): `SudokuSerenity/src/screens/GameScreen.cpp`
- [Result screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/ResultScreen.cpp): `SudokuSerenity/src/screens/ResultScreen.cpp`
- [Statistics screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/StatsScreen.cpp): `SudokuSerenity/src/screens/StatsScreen.cpp`
- [Leaderboard screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/LeaderboardScreen.cpp): `SudokuSerenity/src/screens/LeaderboardScreen.cpp`
- [Profile screen](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/screens/ProfileScreen.cpp): `SudokuSerenity/src/screens/ProfileScreen.cpp`

### Puzzle play

- [Game session](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Game.cpp): `SudokuSerenity/src/Game.cpp`
- [Puzzle generation](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/PuzzleGenerator.cpp): `SudokuSerenity/src/PuzzleGenerator.cpp`
- [Sudoku board](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/SudokuBoard.cpp): `SudokuSerenity/src/SudokuBoard.cpp`
- [Sudoku solver](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/SudokuSolver.cpp): `SudokuSerenity/src/SudokuSolver.cpp`
- [Constraint graph](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/ConstraintGraph.cpp): `SudokuSerenity/src/ConstraintGraph.cpp`

### Player records

- [Player profiles](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Player.cpp): `SudokuSerenity/src/Player.cpp`
- [Game history](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/History.cpp): `SudokuSerenity/src/History.cpp`
- [Score manager](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/ScoreManager.cpp): `SudokuSerenity/src/ScoreManager.cpp`
- [Leaderboard ranking](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Leaderboard.cpp): `SudokuSerenity/src/Leaderboard.cpp`
- [Achievements](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Achievements.cpp): `SudokuSerenity/src/Achievements.cpp`

### Visual features

- [Progress garden](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Garden.cpp): `SudokuSerenity/src/Garden.cpp`
- [Drawing helpers](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Draw.cpp): `SudokuSerenity/src/Draw.cpp`
- [Music player](https://github.com/aimanmughal2267-source/dsa_cca_suduko/blob/main/SudokuSerenity/src/Audio.cpp): `SudokuSerenity/src/Audio.cpp`

### Data structures

- [Core data structures](https://github.com/aimanmughal2267-source/dsa_cca_suduko/tree/main/SudokuSerenity/include/ds): `SudokuSerenity/include/ds`

### Other components

- **Player**

## Connections

- Player → Application entry: launches (evidence: `SudokuSerenity/src/main.cpp`)
- Application entry → UI manager: runs (evidence: `SudokuSerenity/src/main.cpp`)
- UI manager → Home screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → New-game screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Game screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Result screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Statistics screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Leaderboard screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Profile screen: creates and routes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Game session: starts and resumes (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Player profiles: loads and updates (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Game history: loads and records (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Score manager: loads and adds scores (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Leaderboard ranking: builds rankings (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Achievements: records achievements (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Progress garden: calculates progress stage (evidence: `SudokuSerenity/src/UIManager.cpp`)
- UI manager → Music player: starts music (evidence: `SudokuSerenity/src/UIManager.cpp`)
- Game session → Puzzle generation: uses puzzles
- Game session → Sudoku board: stores grid state
- Game session → Sudoku solver: solves on give-up (evidence: `SudokuSerenity/src/Game.cpp`)
- Game session → Constraint graph: checks conflicts (evidence: `SudokuSerenity/src/Game.cpp`)
- Game session → Score manager: computes score (evidence: `SudokuSerenity/src/Game.cpp`)
- Game screen → Game session: handles game actions
- Score manager → Core data structures: uses BST
- Player profiles → Core data structures: uses hash table
- Game history → Core data structures: uses linked list
- Leaderboard ranking → Core data structures: uses heap
- Constraint graph → Core data structures: uses graph (evidence: `SudokuSerenity/include/ds/Graph.h`)
- Drawing helpers → Achievements: draws badges (evidence: `SudokuSerenity/src/Draw.cpp`)
- Home screen → Progress garden: shows garden (evidence: `SudokuSerenity/src/screens/HomeScreen.cpp`)
- Profile screen → Progress garden: shows garden progress (evidence: `SudokuSerenity/src/screens/ProfileScreen.cpp`)
- Statistics screen → Progress garden: shows garden progress (evidence: `SudokuSerenity/src/screens/StatsScreen.cpp`)
