# 2026oss-team-project/vite architecture

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

- Interactive diagram: https://gitdiagram.com/2026oss-team-project/vite
- Repository: https://github.com/2026oss-team-project/vite

## Overview

Memory Puzzle is a browser-based matching game: a player flips tiles, matches pairs, and completes the board to win. The React entry point mounts the app, which owns game state and coordinates tile input, move counts, reset/new-game actions, and win detection. New games are built from a logo catalogue using random selection; the board renders interactive tiles, while header and statistics components expose controls and status. Source excerpts show the main wiring and game logic; styling and some helper implementations were not inspected, so the graph focuses on evidenced runtime relationships.

Main entry points: [`src/App.jsx`](https://github.com/2026oss-team-project/vite/blob/master/src/App.jsx) (Game state), [`src/TileGrid.jsx`](https://github.com/2026oss-team-project/vite/blob/master/src/TileGrid.jsx) (Tile grid), [`src/GameStats.jsx`](https://github.com/2026oss-team-project/vite/blob/master/src/GameStats.jsx) (Win status), [`src/tile-factory.js`](https://github.com/2026oss-team-project/vite/blob/master/src/tile-factory.js) (Game factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Game orchestration"]
  node_entry["React entry<br/>[index.jsx]"]
  node_app["Game state<br/>[App.jsx]"]
  node_states["Game states<br/>[game-states.js]"]
end

subgraph group_play["Gameplay interface"]
  node_grid["Tile grid<br/>[TileGrid.jsx]"]
  node_tile["Interactive tile<br/>[Tile.jsx]"]
  node_stats["Win status<br/>[GameStats.jsx]"]
  node_restart["Play again<br/>[RestartButton.jsx]"]
end

subgraph group_setup["Game setup"]
  node_factory["Game factory<br/>[tile-factory.js]"]
  node_logos["Logo catalogue<br/>[logos.js]"]
  node_random["Random selection<br/>[random-subarray.js]"]
end

subgraph group_chrome["App chrome"]
  node_header["Game controls<br/>[AppHeader.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_github["GitHub icon<br/>[GitHubIcon.jsx]"]
end

node_player(("Player"))

node_player -.->|"opens game"| node_entry
node_entry -->|"mounts"| node_app
node_app -->|"creates game"| node_factory
node_factory -->|"selects from"| node_logos
node_factory -->|"randomizes"| node_random
node_app -->|"sets state"| node_states
node_app -->|"renders controls"| node_header
node_app -->|"renders status"| node_stats
node_app -->|"renders board"| node_grid
node_grid -->|"renders tiles"| node_tile
node_tile -->|"reports flips"| node_grid
node_grid -->|"forwards input"| node_app
node_header -->|"invokes controls"| node_app
node_stats -->|"checks status"| node_states
node_stats -->|"renders action"| node_restart
node_footer -->|"renders icon"| node_github
node_app -->|"renders footer"| node_footer

click node_entry "https://github.com/2026oss-team-project/vite/blob/master/src/index.jsx"
click node_app "https://github.com/2026oss-team-project/vite/blob/master/src/App.jsx"
click node_states "https://github.com/2026oss-team-project/vite/blob/master/src/game-states.js"
click node_grid "https://github.com/2026oss-team-project/vite/blob/master/src/TileGrid.jsx"
click node_tile "https://github.com/2026oss-team-project/vite/blob/master/src/Tile.jsx"
click node_stats "https://github.com/2026oss-team-project/vite/blob/master/src/GameStats.jsx"
click node_restart "https://github.com/2026oss-team-project/vite/blob/master/src/RestartButton.jsx"
click node_factory "https://github.com/2026oss-team-project/vite/blob/master/src/tile-factory.js"
click node_logos "https://github.com/2026oss-team-project/vite/blob/master/src/logos.js"
click node_random "https://github.com/2026oss-team-project/vite/blob/master/src/random-subarray.js"
click node_header "https://github.com/2026oss-team-project/vite/blob/master/src/AppHeader.jsx"
click node_footer "https://github.com/2026oss-team-project/vite/blob/master/src/Footer.jsx"
click node_github "https://github.com/2026oss-team-project/vite/blob/master/src/GitHubIcon.jsx"

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_app,node_states toneBlue
class node_grid,node_tile,node_stats,node_restart toneAmber
class node_factory,node_logos,node_random toneMint
class node_header,node_footer,node_github toneRose
class node_player toneIndigo
```

## Components

### Game orchestration

- [React entry](https://github.com/2026oss-team-project/vite/blob/master/src/index.jsx): `src/index.jsx`
- [Game state](https://github.com/2026oss-team-project/vite/blob/master/src/App.jsx): `src/App.jsx`
- [Game states](https://github.com/2026oss-team-project/vite/blob/master/src/game-states.js): `src/game-states.js`

### Gameplay interface

- [Tile grid](https://github.com/2026oss-team-project/vite/blob/master/src/TileGrid.jsx): `src/TileGrid.jsx`
- [Interactive tile](https://github.com/2026oss-team-project/vite/blob/master/src/Tile.jsx): `src/Tile.jsx`
- [Win status](https://github.com/2026oss-team-project/vite/blob/master/src/GameStats.jsx): `src/GameStats.jsx`
- [Play again](https://github.com/2026oss-team-project/vite/blob/master/src/RestartButton.jsx): `src/RestartButton.jsx`

### Game setup

- [Game factory](https://github.com/2026oss-team-project/vite/blob/master/src/tile-factory.js): `src/tile-factory.js`
- [Logo catalogue](https://github.com/2026oss-team-project/vite/blob/master/src/logos.js): `src/logos.js`
- [Random selection](https://github.com/2026oss-team-project/vite/blob/master/src/random-subarray.js): `src/random-subarray.js`

### App chrome

- [Game controls](https://github.com/2026oss-team-project/vite/blob/master/src/AppHeader.jsx): `src/AppHeader.jsx`
- [Footer](https://github.com/2026oss-team-project/vite/blob/master/src/Footer.jsx): `src/Footer.jsx`
- [GitHub icon](https://github.com/2026oss-team-project/vite/blob/master/src/GitHubIcon.jsx): `src/GitHubIcon.jsx`

### Other components

- **Player**

## Connections

- Player → React entry: opens game
- React entry → Game state: mounts (evidence: `src/index.jsx`)
- Game state → Game factory: creates game (evidence: `src/App.jsx`)
- Game factory → Logo catalogue: selects from (evidence: `src/tile-factory.js`)
- Game factory → Random selection: randomizes (evidence: `src/tile-factory.js`)
- Game state → Game states: sets state (evidence: `src/App.jsx`)
- Game state → Game controls: renders controls (evidence: `src/App.jsx`)
- Game state → Win status: renders status (evidence: `src/App.jsx`)
- Game state → Tile grid: renders board (evidence: `src/App.jsx`)
- Tile grid → Interactive tile: renders tiles (evidence: `src/TileGrid.jsx`)
- Interactive tile → Tile grid: reports flips (evidence: `src/Tile.jsx`)
- Tile grid → Game state: forwards input (evidence: `src/TileGrid.jsx`)
- Game controls → Game state: invokes controls (evidence: `src/App.jsx`)
- Win status → Game states: checks status (evidence: `src/GameStats.jsx`)
- Win status → Play again: renders action (evidence: `src/GameStats.jsx`)
- Footer → GitHub icon: renders icon (evidence: `src/Footer.jsx`)
- Game state → Footer: renders footer (evidence: `src/App.jsx`)
