# tshedisob/space-invaders-game architecture

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

- Interactive diagram: https://gitdiagram.com/tshedisob/space-invaders-game
- Repository: https://github.com/tshedisob/space-invaders-game

## Overview

Space Invaders is a browser-based React game. The player enters a name, then controls a shooter to move and fire at invaders; collisions or clearing the invaders end the round, with a replay option. Redux holds player and game state, while a saga delays the game-over transition. The graph preserves the documented controls, scoring, and obstacle/monster end conditions; some of those capabilities are described in the README but are not fully visible in the sampled game code.

Main entry points: [`src/Components/Game.js`](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Game.js) (Game Loop), [`src/Components/PlayerNameForm.js`](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/PlayerNameForm.js) (Player Name Form), [`src/Components/GameOver.js`](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/GameOver.js) (Game Over), [`src/Redux/store.js`](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/store.js) (Redux Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Setup"]
  node_entrypoint["React Entry<br/>[index.js]"]
  node_app["App Shell<br/>[App.js]"]
  node_nameform["Player Name Form<br/>[PlayerNameForm.js]"]
end

subgraph group_play["Game Experience"]
  node_game["Game Loop<br/>[Game.js]"]
  node_header["Game Header<br/>[Header.js]"]
  node_sidebar["Game Sidebar<br/>[SideBar.js]"]
  node_statsdisplay["Stats Display<br/>[StatsDisplay.js]"]
  node_rules["Game Rules<br/>[GameRules.js]"]
  node_highlights["Button Highlights"]
  node_gameover["Game Over<br/>[GameOver.js]"]
  node_celebrate["Win Celebration<br/>[Celebrate.js]"]
end

subgraph group_state["State Management"]
  node_store[("Redux Store<br/>[store.js]")]
  node_saga["Game Over Saga<br/>[sagas.js]"]
  node_gameactions["Game Actions<br/>[actions.js]"]
  node_gamestate["Game State Reducer<br/>[reducer.js]"]
  node_playeractions["Player Actions<br/>[actions.js]"]
  node_playerstate["Player State Reducer<br/>[reducer.js]"]
end

subgraph group_utility["Game Utilities"]
  node_helper["Grid Helpers<br/>[helper.js]"]
end

node_player(("Player"))

node_player -->|"enters name"| node_nameform
node_player -->|"controls shooter"| node_game
node_entrypoint -->|"provides state"| node_store
node_entrypoint -->|"renders"| node_app
node_app -->|"renders"| node_nameform
node_nameform -->|"starts game"| node_game
node_nameform -->|"hides form"| node_helper
node_nameform -->|"dispatches name"| node_playeractions
node_game -->|"renders"| node_header
node_game -->|"renders"| node_sidebar
node_game -->|"renders"| node_rules
node_game -->|"shows on end"| node_gameover
node_game -->|"draws invaders"| node_helper
node_game -->|"dispatches updates"| node_gameactions
node_game -.->|"tracks game state"| node_gamestate
node_sidebar -->|"renders"| node_statsdisplay
node_sidebar -->|"renders"| node_highlights
node_gameover -->|"shows on win"| node_celebrate
node_gameover -->|"dispatches replay"| node_gameactions
node_gameover -.->|"reads outcome"| node_gamestate
node_store -->|"runs saga"| node_saga
node_store -->|"combines reducer"| node_gamestate
node_store -->|"combines reducer"| node_playerstate
node_saga -->|"dispatches delayed end"| node_gameactions

click node_entrypoint "https://github.com/tshedisob/space-invaders-game/blob/main/src/index.js"
click node_app "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/App.js"
click node_nameform "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/PlayerNameForm.js"
click node_game "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Game.js"
click node_header "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Header.js"
click node_sidebar "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/SideBar.js"
click node_statsdisplay "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/StatsDisplay.js"
click node_rules "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/GameRules.js"
click node_highlights "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/ButtonsHighlight.js"
click node_gameover "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/GameOver.js"
click node_celebrate "https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Celebrate.js"
click node_store "https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/store.js"
click node_saga "https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/sagas.js"
click node_gameactions "https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/GameStats/actions.js"
click node_gamestate "https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/GameStats/reducer.js"
click node_playeractions "https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/PlayerName/actions.js"
click node_playerstate "https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/PlayerName/reducer.js"
click node_helper "https://github.com/tshedisob/space-invaders-game/blob/main/src/utils/helper.js"

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_entrypoint,node_app,node_nameform toneBlue
class node_game,node_header,node_sidebar,node_statsdisplay,node_rules,node_highlights,node_gameover,node_celebrate toneAmber
class node_store,node_saga,node_gameactions,node_gamestate,node_playeractions,node_playerstate toneMint
class node_helper toneRose
class node_player toneIndigo
```

## Components

### Entry and Setup

- [React Entry](https://github.com/tshedisob/space-invaders-game/blob/main/src/index.js): `src/index.js`
- [App Shell](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/App.js): `src/Components/App.js`
- [Player Name Form](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/PlayerNameForm.js): `src/Components/PlayerNameForm.js`

### Game Experience

- [Game Loop](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Game.js): `src/Components/Game.js`
- [Game Header](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Header.js): `src/Components/Header.js`
- [Game Sidebar](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/SideBar.js): `src/Components/SideBar.js`
- [Stats Display](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/StatsDisplay.js): `src/Components/StatsDisplay.js`
- [Game Rules](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/GameRules.js): `src/Components/GameRules.js`
- [Button Highlights](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/ButtonsHighlight.js): `src/Components/ButtonsHighlight.js`
- [Game Over](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/GameOver.js): `src/Components/GameOver.js`
- [Win Celebration](https://github.com/tshedisob/space-invaders-game/blob/main/src/Components/Celebrate.js): `src/Components/Celebrate.js`

### State Management

- [Redux Store](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/store.js): `src/Redux/store.js`
- [Game Over Saga](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/sagas.js): `src/Redux/sagas.js`
- [Game Actions](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/GameStats/actions.js): `src/Redux/GameStats/actions.js`
- [Game State Reducer](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/GameStats/reducer.js): `src/Redux/GameStats/reducer.js`
- [Player Actions](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/PlayerName/actions.js): `src/Redux/PlayerName/actions.js`
- [Player State Reducer](https://github.com/tshedisob/space-invaders-game/blob/main/src/Redux/PlayerName/reducer.js): `src/Redux/PlayerName/reducer.js`

### Game Utilities

- [Grid Helpers](https://github.com/tshedisob/space-invaders-game/blob/main/src/utils/helper.js): `src/utils/helper.js`

### Other components

- **Player**

## Connections

- Player → Player Name Form: enters name (evidence: `README.md`)
- Player → Game Loop: controls shooter (evidence: `README.md`)
- React Entry → Redux Store: provides state (evidence: `src/index.js`)
- React Entry → App Shell: renders (evidence: `src/index.js`)
- App Shell → Player Name Form: renders (evidence: `src/Components/App.js`)
- Player Name Form → Game Loop: starts game (evidence: `src/Components/PlayerNameForm.js`)
- Player Name Form → Grid Helpers: hides form (evidence: `src/Components/PlayerNameForm.js`)
- Player Name Form → Player Actions: dispatches name (evidence: `src/Components/PlayerNameForm.js`)
- Game Loop → Game Header: renders (evidence: `src/Components/Game.js`)
- Game Loop → Game Sidebar: renders (evidence: `src/Components/Game.js`)
- Game Loop → Game Rules: renders (evidence: `src/Components/Game.js`)
- Game Loop → Game Over: shows on end (evidence: `src/Components/Game.js`)
- Game Loop → Grid Helpers: draws invaders (evidence: `src/Components/Game.js`)
- Game Loop → Game Actions: dispatches updates (evidence: `src/Components/Game.js`)
- Game Loop → Game State Reducer: tracks game state
- Game Sidebar → Stats Display: renders (evidence: `src/Components/SideBar.js`)
- Game Sidebar → Button Highlights: renders (evidence: `src/Components/SideBar.js`)
- Game Over → Win Celebration: shows on win (evidence: `src/Components/GameOver.js`)
- Game Over → Game Actions: dispatches replay (evidence: `src/Components/GameOver.js`)
- Game Over → Game State Reducer: reads outcome
- Redux Store → Game Over Saga: runs saga (evidence: `src/Redux/store.js`)
- Redux Store → Game State Reducer: combines reducer (evidence: `src/Redux/store.js`)
- Redux Store → Player State Reducer: combines reducer (evidence: `src/Redux/store.js`)
- Game Over Saga → Game Actions: dispatches delayed end (evidence: `src/Redux/sagas.js`)
