# redward42/this-or-that architecture

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

- Interactive diagram: https://gitdiagram.com/redward42/this-or-that
- Repository: https://github.com/redward42/this-or-that

## Overview

This is a React “This or That” quiz game for an ACM event. Players choose a mode on the home screen, answer a question in that mode, receive correctness feedback and a sound, then return home. The game data covers six modes, including visual and video prompts. The sampled source shows the main navigation and answer flow; Wheel is implemented but its integration is not shown, so it is represented as a standalone UI component.

Main entry points: [`src/Game.jsx`](https://github.com/redward42/this-or-that/blob/master/src/Game.jsx) (Question and Answer), [`src/App.jsx`](https://github.com/redward42/this-or-that/blob/master/src/App.jsx) (View Navigation), [`src/Home.jsx`](https://github.com/redward42/this-or-that/blob/master/src/Home.jsx) (Mode Selection), [`src/data.js`](https://github.com/redward42/this-or-that/blob/master/src/data.js) (Mode and Question Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["React Entry<br/>[main.jsx]"]
  node_app_shell["View Navigation<br/>[App.jsx]"]
end

subgraph group_gameplay["Gameplay"]
  node_home["Mode Selection<br/>[Home.jsx]"]
  node_game["Question and Answer<br/>[Game.jsx]"]
end

subgraph group_content["Game Content"]
  node_game_data["Mode and Question Data<br/>[data.js]"]
  node_sounds["Answer Sounds<br/>[sounds.js]"]
end

subgraph group_ui["UI Components"]
  node_wheel["Spin Wheel<br/>[Wheel.jsx]"]
end

node_player(("Player"))

node_entry -->|"renders"| node_app_shell
node_app_shell -->|"renders"| node_home
node_app_shell -->|"renders"| node_game
node_home -->|"reads modes"| node_game_data
node_player -->|"chooses mode"| node_home
node_home -->|"selects mode"| node_app_shell
node_game -->|"reads prompts"| node_game_data
node_player -->|"answers prompt"| node_game
node_game -->|"plays feedback"| node_sounds
node_game -->|"returns home"| node_app_shell
node_player -->|"spins wheel"| node_wheel

click node_entry "https://github.com/redward42/this-or-that/blob/master/src/main.jsx"
click node_app_shell "https://github.com/redward42/this-or-that/blob/master/src/App.jsx"
click node_home "https://github.com/redward42/this-or-that/blob/master/src/Home.jsx"
click node_game "https://github.com/redward42/this-or-that/blob/master/src/Game.jsx"
click node_game_data "https://github.com/redward42/this-or-that/blob/master/src/data.js"
click node_sounds "https://github.com/redward42/this-or-that/blob/master/src/sounds.js"
click node_wheel "https://github.com/redward42/this-or-that/blob/master/src/Wheel.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_shell toneBlue
class node_home,node_game toneAmber
class node_game_data,node_sounds toneMint
class node_wheel toneRose
class node_player toneIndigo
```

## Components

### Application

- [React Entry](https://github.com/redward42/this-or-that/blob/master/src/main.jsx): `src/main.jsx`
- [View Navigation](https://github.com/redward42/this-or-that/blob/master/src/App.jsx): `src/App.jsx`

### Gameplay

- [Mode Selection](https://github.com/redward42/this-or-that/blob/master/src/Home.jsx): `src/Home.jsx`
- [Question and Answer](https://github.com/redward42/this-or-that/blob/master/src/Game.jsx): `src/Game.jsx`

### Game Content

- [Mode and Question Data](https://github.com/redward42/this-or-that/blob/master/src/data.js): `src/data.js`
- [Answer Sounds](https://github.com/redward42/this-or-that/blob/master/src/sounds.js): `src/sounds.js`

### UI Components

- [Spin Wheel](https://github.com/redward42/this-or-that/blob/master/src/Wheel.jsx): `src/Wheel.jsx`

### Other components

- **Player**

## Connections

- React Entry → View Navigation: renders (evidence: `src/main.jsx`)
- View Navigation → Mode Selection: renders (evidence: `src/App.jsx`)
- View Navigation → Question and Answer: renders (evidence: `src/App.jsx`)
- Mode Selection → Mode and Question Data: reads modes (evidence: `src/Home.jsx`)
- Player → Mode Selection: chooses mode (evidence: `src/Home.jsx`)
- Mode Selection → View Navigation: selects mode (evidence: `src/Home.jsx`)
- Question and Answer → Mode and Question Data: reads prompts (evidence: `src/Game.jsx`)
- Player → Question and Answer: answers prompt (evidence: `src/Game.jsx`)
- Question and Answer → Answer Sounds: plays feedback (evidence: `src/Game.jsx`)
- Question and Answer → View Navigation: returns home (evidence: `src/Game.jsx`)
- Player → Spin Wheel: spins wheel (evidence: `src/Wheel.jsx`)
