# eduardocruzpalacios/tic-tac-toe-react architecture

> Architecture diagram of the GitHub repository eduardocruzpalacios/tic-tac-toe-react, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eduardocruzpalacios/tic-tac-toe-react
- Repository: https://github.com/eduardocruzpalacios/tic-tac-toe-react

## Overview

This React tic-tac-toe app routes users from its home page to solo play, play against a computer, or game history. Solo mode tracks turns, editable tokens, elapsed time, and move count; computer mode records completed outcomes. The app also exposes a dark/light theme switch. The graph follows calls and routing shown in excerpts or the source index; several UI and theme relationships are documented only by imports, so unsampled behavior is not inferred.

Main entry points: [`src/App.tsx`](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/App.tsx) (App routes), [`src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx`](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx) (Computer game), [`src/context/ThemeContext.ts`](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/context/ThemeContext.ts) (Theme context), [`src/components/pages/HomePage/HomePage.tsx`](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/pages/HomePage/HomePage.tsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["App routes<br/>[App.tsx]"]
  node_home["Home page<br/>[HomePage.tsx]"]
  node_nav["Navigation<br/>[Nav.tsx]"]
end

subgraph group_play["Game modes"]
  node_solo["Solo game<br/>[SoloGame.tsx]"]
  node_moves["Move counter"]
  node_computer["Computer game"]
end

subgraph group_history["Game history"]
  node_historyview["History view<br/>[GamesHistoric.tsx]"]
  node_historyreducer["History reducer"]
  node_gamefactory["Game factory"]
  node_localstorage[("Browser storage")]
end

subgraph group_theme["Theme and UI"]
  node_header["Header<br/>[Header.tsx]"]
  node_switch["Theme switch<br/>[DarkModeSwitch.tsx]"]
  node_themecontext["Theme context<br/>[ThemeContext.ts]"]
  node_atoms["UI atoms"]
  node_styleutils["Style utilities<br/>[styleUtils.ts]"]
end

node_user(("Player"))

node_user -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_solo
node_app -->|"routes to"| node_computer
node_app -->|"routes to"| node_historyview
node_home -->|"renders"| node_header
node_home -->|"renders"| node_nav
node_solo -->|"dispatches moves"| node_moves
node_solo -->|"renders controls"| node_atoms
node_computer -->|"renders controls"| node_atoms
node_computer -->|"creates result"| node_gamefactory
node_computer -->|"records result"| node_historyreducer
node_historyview -->|"loads history"| node_historyreducer
node_historyreducer -->|"reads and writes"| node_localstorage
node_header -->|"renders"| node_switch
node_switch -->|"updates theme"| node_themecontext
node_app -->|"provides theme"| node_themecontext
node_header -->|"reads theme"| node_themecontext
node_nav -->|"reads theme"| node_themecontext
node_atoms -->|"uses style values"| node_styleutils

click node_app "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/App.tsx"
click node_home "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/pages/HomePage/HomePage.tsx"
click node_solo "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/SoloGame/SoloGame.tsx"
click node_moves "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/SoloGame/movesCountReducer.tsx"
click node_computer "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx"
click node_historyview "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/GamesHistoric/GamesHistoric.tsx"
click node_historyreducer "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/reducer/gamesHistoricReducer.ts"
click node_gamefactory "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/reducer/gamesHistoricReducerFactory.ts"
click node_header "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/Header/Header.tsx"
click node_nav "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/Nav/Nav.tsx"
click node_switch "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/molecules/DarkModeSwitch/DarkModeSwitch.tsx"
click node_themecontext "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/context/ThemeContext.ts"
click node_atoms "https://github.com/eduardocruzpalacios/tic-tac-toe-react/tree/main/src/components/atoms"
click node_styleutils "https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/common/styleUtils.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_app,node_home,node_nav toneBlue
class node_solo,node_moves,node_computer toneAmber
class node_historyview,node_historyreducer,node_gamefactory,node_localstorage toneMint
class node_header,node_switch,node_themecontext,node_atoms,node_styleutils toneRose
class node_user toneIndigo
```

## Components

### App and navigation

- [App routes](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/App.tsx): `src/App.tsx`
- [Home page](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/pages/HomePage/HomePage.tsx): `src/components/pages/HomePage/HomePage.tsx`
- [Navigation](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/Nav/Nav.tsx): `src/components/organisms/Nav/Nav.tsx`

### Game modes

- [Solo game](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/SoloGame/SoloGame.tsx): `src/components/organisms/SoloGame/SoloGame.tsx`
- [Move counter](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/SoloGame/movesCountReducer.tsx): `src/components/organisms/SoloGame/movesCountReducer.tsx`
- [Computer game](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx): `src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx`

### Game history

- [History view](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/GamesHistoric/GamesHistoric.tsx): `src/components/organisms/GamesHistoric/GamesHistoric.tsx`
- [History reducer](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/reducer/gamesHistoricReducer.ts): `src/reducer/gamesHistoricReducer.ts`
- [Game factory](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/reducer/gamesHistoricReducerFactory.ts): `src/reducer/gamesHistoricReducerFactory.ts`
- **Browser storage**

### Theme and UI

- [Header](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/organisms/Header/Header.tsx): `src/components/organisms/Header/Header.tsx`
- [Theme switch](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/components/molecules/DarkModeSwitch/DarkModeSwitch.tsx): `src/components/molecules/DarkModeSwitch/DarkModeSwitch.tsx`
- [Theme context](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/context/ThemeContext.ts): `src/context/ThemeContext.ts`
- [UI atoms](https://github.com/eduardocruzpalacios/tic-tac-toe-react/tree/main/src/components/atoms): `src/components/atoms`
- [Style utilities](https://github.com/eduardocruzpalacios/tic-tac-toe-react/blob/main/src/common/styleUtils.ts): `src/common/styleUtils.ts`

### Other components

- **Player**

## Connections

- Player → App routes: opens app
- App routes → Home page: routes to (evidence: `src/App.tsx`)
- App routes → Solo game: routes to (evidence: `src/App.tsx`)
- App routes → Computer game: routes to (evidence: `src/App.tsx`)
- App routes → History view: routes to (evidence: `src/App.tsx`)
- Home page → Header: renders (evidence: `src/components/pages/HomePage/HomePage.tsx`)
- Home page → Navigation: renders (evidence: `src/components/pages/HomePage/HomePage.tsx`)
- Solo game → Move counter: dispatches moves (evidence: `src/components/organisms/SoloGame/SoloGame.tsx`)
- Solo game → UI atoms: renders controls (evidence: `src/components/organisms/SoloGame/SoloGame.tsx`)
- Computer game → UI atoms: renders controls (evidence: `src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx`)
- Computer game → Game factory: creates result (evidence: `src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx`)
- Computer game → History reducer: records result (evidence: `src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx`)
- History view → History reducer: loads history (evidence: `src/components/organisms/GamesHistoric/GamesHistoric.tsx`)
- History reducer → Browser storage: reads and writes (evidence: `src/reducer/gamesHistoricReducer.ts`)
- Header → Theme switch: renders (evidence: `src/components/organisms/Header/Header.tsx`)
- Theme switch → Theme context: updates theme (evidence: `src/components/molecules/DarkModeSwitch/DarkModeSwitch.tsx`)
- App routes → Theme context: provides theme (evidence: `src/App.tsx`)
- Header → Theme context: reads theme (evidence: `src/components/organisms/Header/Header.tsx`)
- Navigation → Theme context: reads theme (evidence: `src/components/organisms/Nav/Nav.tsx`)
- UI atoms → Style utilities: uses style values (evidence: `src/components/atoms/Tile/styled.ts`)
