# harismuneer/minesweeper-desktop-game architecture

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

- Interactive diagram: https://gitdiagram.com/harismuneer/minesweeper-desktop-game
- Repository: https://github.com/harismuneer/minesweeper-desktop-game

## Overview

This is a standalone Java Swing Minesweeper game. The player interacts with the UI; Game coordinates board updates, win/loss handling, and statistics, while Board and Score persist game state and records in the Access database. The README documents save/load, and sampled code confirms board and score database operations; omitted Game sections limit certainty about the exact save/load call sequence.

Main entry points: [`Code/src/minesweeper/Game.java`](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Game.java) (Game controller), [`Code/src/minesweeper/UI.java`](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/UI.java) (Swing interface), [`Code/src/minesweeper/Board.java`](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Board.java) (Board logic), [`Code/src/minesweeper/Score.java`](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Score.java) (Scores and times)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_ui["Swing interface<br/>[UI.java]"]
end

subgraph group_gameplay["Gameplay"]
  node_main["Launcher<br/>[Main.java]"]
  node_game["Game controller<br/>[Game.java]"]
  node_board["Board logic<br/>[Board.java]"]
  node_cell["Cell state<br/>[Cell.java]"]
end

subgraph group_persistence["Persistence"]
  node_score["Scores and times<br/>[Score.java]"]
  node_database[("Access database<br/>[db.accdb]")]
end

node_player(("Player"))

node_player -->|"plays through"| node_ui
node_main -->|"starts"| node_game
node_game -->|"creates and updates"| node_board
node_game -->|"creates and configures"| node_ui
node_ui -->|"dispatches input"| node_game
node_board -->|"stores cell state"| node_cell
node_game -->|"loads and updates"| node_score
node_board -->|"saves and loads game"| node_database
node_score -->|"reads and writes records"| node_database
node_game -->|"shows game results"| node_ui

click node_main "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Main.java"
click node_game "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Game.java"
click node_ui "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/UI.java"
click node_board "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Board.java"
click node_cell "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Cell.java"
click node_score "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Score.java"
click node_database "https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/db.accdb"

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_ui toneBlue
class node_main,node_game,node_board,node_cell toneAmber
class node_score,node_database toneMint
class node_player toneIndigo
```

## Components

### Presentation

- [Swing interface](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/UI.java): `Code/src/minesweeper/UI.java`

### Gameplay

- [Launcher](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Main.java): `Code/src/minesweeper/Main.java`
- [Game controller](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Game.java): `Code/src/minesweeper/Game.java`
- [Board logic](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Board.java): `Code/src/minesweeper/Board.java`
- [Cell state](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Cell.java): `Code/src/minesweeper/Cell.java`

### Persistence

- [Scores and times](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/minesweeper/Score.java): `Code/src/minesweeper/Score.java`
- [Access database](https://github.com/harismuneer/minesweeper-desktop-game/blob/master/Code/src/db.accdb): `Code/src/db.accdb`

### Other components

- **Player**

## Connections

- Player → Swing interface: plays through
- Launcher → Game controller: starts
- Game controller → Board logic: creates and updates
- Game controller → Swing interface: creates and configures
- Swing interface → Game controller: dispatches input
- Board logic → Cell state: stores cell state
- Game controller → Scores and times: loads and updates
- Board logic → Access database: saves and loads game
- Scores and times → Access database: reads and writes records
- Game controller → Swing interface: shows game results
