# redward42/theyreatenbut architecture

> Architecture diagram of the GitHub repository redward42/theyreatenbut, 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/theyreatenbut
- Repository: https://github.com/redward42/theyreatenbut

## Overview

This is a single-page React guessing game: the player starts a round, guesses a team member’s rating for a scenario, sees feedback, and can continue or reset. The central game component manages screen state and round selection; question and roster JSON provide the game data. The README documents sampling without replacement, while the excerpt shows the component’s bag logic and its optional sound and confetti effects. Source excerpts are partial, so the graph omits unverified details such as the specific photo-loading mechanism.

Main entry points: [`src/components/TheyreATenGame.tsx`](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx) (Game controller), [`src/main.tsx`](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/main.tsx) (React bootstrap), [`src/App.tsx`](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/App.tsx) (App wrapper), [`src/data/questions.json`](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/data/questions.json) (Question ratings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_bootstrap["React bootstrap<br/>[main.tsx]"]
  node_app["App wrapper<br/>[App.tsx]"]
end

subgraph group_gameplay["Game flow"]
  node_controller["Game controller<br/>[TheyreATenGame.tsx]"]
  node_start["Start screen<br/>[TheyreATenGame.tsx]"]
  node_rounds["Round sampling<br/>[TheyreATenGame.tsx]"]
  node_question["Question screen<br/>[TheyreATenGame.tsx]"]
  node_feedback["Feedback screen<br/>[TheyreATenGame.tsx]"]
  node_reset["Bag reset<br/>[TheyreATenGame.tsx]"]
end

subgraph group_content["Game content"]
  node_questions["Question ratings<br/>[questions.json]"]
  node_roster["Team roster<br/>[teamMembers.json]"]
  node_types["Game data types<br/>[game.ts]"]
end

subgraph group_effects["Feedback effects"]
  node_sound["Sound effects"]
  node_confetti["Confetti effect"]
end

node_player(("Player"))

node_player -->|"opens game"| node_bootstrap
node_bootstrap -->|"renders"| node_app
node_app -->|"renders"| node_controller
node_controller -->|"renders"| node_start
node_player -->|"starts round"| node_start
node_controller -->|"requests round"| node_rounds
node_rounds -->|"draws questions"| node_questions
node_rounds -->|"looks up member"| node_roster
node_controller -->|"renders"| node_question
node_player -->|"submits guess"| node_question
node_controller -->|"renders"| node_feedback
node_player -->|"chooses next or reset"| node_feedback
node_controller -->|"resets bags"| node_rounds
node_controller -->|"plays effects"| node_sound
node_feedback -->|"celebrates exact match"| node_confetti
node_questions -.->|"conforms to"| node_types
node_roster -.->|"conforms to"| node_types

click node_bootstrap "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/main.tsx"
click node_app "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/App.tsx"
click node_controller "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx"
click node_start "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx"
click node_rounds "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx"
click node_question "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx"
click node_feedback "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx"
click node_reset "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx"
click node_questions "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/data/questions.json"
click node_roster "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/data/teamMembers.json"
click node_types "https://github.com/RedWARd42/TheyreATenBut/blob/main/src/types/game.ts"

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_bootstrap,node_app toneBlue
class node_controller,node_start,node_rounds,node_question,node_feedback,node_reset toneAmber
class node_questions,node_roster,node_types toneMint
class node_sound,node_confetti toneRose
class node_player toneIndigo
```

## Components

### App entry

- [React bootstrap](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/main.tsx): `src/main.tsx`
- [App wrapper](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/App.tsx): `src/App.tsx`

### Game flow

- [Game controller](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx): `src/components/TheyreATenGame.tsx`
- [Start screen](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx): `src/components/TheyreATenGame.tsx`
- [Round sampling](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx): `src/components/TheyreATenGame.tsx`
- [Question screen](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx): `src/components/TheyreATenGame.tsx`
- [Feedback screen](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx): `src/components/TheyreATenGame.tsx`
- [Bag reset](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/components/TheyreATenGame.tsx): `src/components/TheyreATenGame.tsx`

### Game content

- [Question ratings](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/data/questions.json): `src/data/questions.json`
- [Team roster](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/data/teamMembers.json): `src/data/teamMembers.json`
- [Game data types](https://github.com/RedWARd42/TheyreATenBut/blob/main/src/types/game.ts): `src/types/game.ts`

### Feedback effects

- **Sound effects**
- **Confetti effect**

### Other components

- **Player**

## Connections

- Player → React bootstrap: opens game (evidence: `README.md`)
- React bootstrap → App wrapper: renders (evidence: `src/main.tsx`)
- App wrapper → Game controller: renders (evidence: `src/App.tsx`)
- Game controller → Start screen: renders (evidence: `src/components/TheyreATenGame.tsx`)
- Player → Start screen: starts round (evidence: `src/components/TheyreATenGame.tsx`)
- Game controller → Round sampling: requests round (evidence: `src/components/TheyreATenGame.tsx`)
- Round sampling → Question ratings: draws questions (evidence: `src/components/TheyreATenGame.tsx`)
- Round sampling → Team roster: looks up member (evidence: `src/components/TheyreATenGame.tsx`)
- Game controller → Question screen: renders (evidence: `src/components/TheyreATenGame.tsx`)
- Player → Question screen: submits guess (evidence: `src/components/TheyreATenGame.tsx`)
- Game controller → Feedback screen: renders (evidence: `src/components/TheyreATenGame.tsx`)
- Player → Feedback screen: chooses next or reset (evidence: `src/components/TheyreATenGame.tsx`)
- Game controller → Round sampling: resets bags (evidence: `src/components/TheyreATenGame.tsx`)
- Game controller → Sound effects: plays effects (evidence: `src/components/TheyreATenGame.tsx`)
- Feedback screen → Confetti effect: celebrates exact match (evidence: `src/components/TheyreATenGame.tsx`)
- Question ratings → Game data types: conforms to (evidence: `README.md`)
- Team roster → Game data types: conforms to (evidence: `README.md`)
