# faisal-666/odin-memory-card architecture

> Architecture diagram of the GitHub repository faisal-666/odin-memory-card, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/faisal-666/odin-memory-card
- Repository: https://github.com/faisal-666/odin-memory-card

## Overview

This is a React memory-card game: it fetches a set of Patrick Star stickers, displays them as clickable cards, and scores players for selecting each card only once. A repeated selection resets the round; selecting every image opens a win dialog. The graph includes the app’s state hooks and response transformation as internal layers. Source excerpts show the main calls and callback wiring; the README is empty, so no additional documented capabilities are available.

Main entry points: [`src/components/game/Game.jsx`](https://github.com/faisal-666/odin-memory-card/blob/main/src/components/game/Game.jsx) (Game round), [`src/App.jsx`](https://github.com/faisal-666/odin-memory-card/blob/main/src/App.jsx) (App coordinator), [`src/components/card/card.jsx`](https://github.com/faisal-666/odin-memory-card/blob/main/src/components/card/card.jsx) (Image card), [`src/components/dialog/dialog.jsx`](https://github.com/faisal-666/odin-memory-card/blob/main/src/components/dialog/dialog.jsx) (Win dialog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["React entry<br/>[index.jsx]"]
  node_app["App coordinator<br/>[App.jsx]"]
end

subgraph group_gameplay["Game UI"]
  node_game["Game round<br/>[Game.jsx]"]
  node_card["Image card<br/>[card.jsx]"]
  node_dialog["Win dialog<br/>[dialog.jsx]"]
end

subgraph group_state["Game state"]
  node_images["Image state<br/>[useListImages.js]"]
  node_score["Score state<br/>[useScore.js]"]
  node_loading["Loading state<br/>[useLoading.js]"]
end

subgraph group_integration["Image integration"]
  node_transformer["Response transformer"]
  node_giphy["Giphy service<br/>[giphyService.js]"]
end

node_player(("Player"))
node_giphy_api["Giphy API"]

node_entry -->|"renders"| node_app
node_app -->|"renders"| node_game
node_app -->|"renders"| node_dialog
node_app -->|"creates"| node_images
node_app -->|"creates"| node_score
node_app -->|"creates"| node_loading
node_game -->|"fetches images"| node_giphy
node_giphy -->|"requests stickers"| node_giphy_api
node_game -->|"transforms response"| node_transformer
node_game -->|"updates and shuffles"| node_images
node_game -->|"updates score"| node_score
node_game -->|"clears loading"| node_loading
node_game -->|"renders"| node_card
node_card -->|"reports clicks"| node_game
node_player -->|"selects"| node_card
node_game -->|"requests reset"| node_app
node_app -->|"passes win state"| node_dialog
node_dialog -->|"invokes reset"| node_app

click node_entry "https://github.com/faisal-666/odin-memory-card/blob/main/src/index.jsx"
click node_app "https://github.com/faisal-666/odin-memory-card/blob/main/src/App.jsx"
click node_game "https://github.com/faisal-666/odin-memory-card/blob/main/src/components/game/Game.jsx"
click node_card "https://github.com/faisal-666/odin-memory-card/blob/main/src/components/card/card.jsx"
click node_dialog "https://github.com/faisal-666/odin-memory-card/blob/main/src/components/dialog/dialog.jsx"
click node_images "https://github.com/faisal-666/odin-memory-card/blob/main/src/hooks/useListImages.js"
click node_score "https://github.com/faisal-666/odin-memory-card/blob/main/src/hooks/useScore.js"
click node_loading "https://github.com/faisal-666/odin-memory-card/blob/main/src/hooks/useLoading.js"
click node_transformer "https://github.com/faisal-666/odin-memory-card/blob/main/src/utils/responseTransformer.js"
click node_giphy "https://github.com/faisal-666/odin-memory-card/blob/main/src/service/giphyService.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_entry,node_app toneBlue
class node_game,node_card,node_dialog toneAmber
class node_images,node_score,node_loading,node_giphy_api toneMint
class node_transformer,node_giphy toneRose
class node_player toneIndigo
```

## Components

### App shell

- [React entry](https://github.com/faisal-666/odin-memory-card/blob/main/src/index.jsx): `src/index.jsx`
- [App coordinator](https://github.com/faisal-666/odin-memory-card/blob/main/src/App.jsx): `src/App.jsx`

### Game UI

- [Game round](https://github.com/faisal-666/odin-memory-card/blob/main/src/components/game/Game.jsx): `src/components/game/Game.jsx`
- [Image card](https://github.com/faisal-666/odin-memory-card/blob/main/src/components/card/card.jsx): `src/components/card/card.jsx`
- [Win dialog](https://github.com/faisal-666/odin-memory-card/blob/main/src/components/dialog/dialog.jsx): `src/components/dialog/dialog.jsx`

### Game state

- [Image state](https://github.com/faisal-666/odin-memory-card/blob/main/src/hooks/useListImages.js): `src/hooks/useListImages.js`
- [Score state](https://github.com/faisal-666/odin-memory-card/blob/main/src/hooks/useScore.js): `src/hooks/useScore.js`
- [Loading state](https://github.com/faisal-666/odin-memory-card/blob/main/src/hooks/useLoading.js): `src/hooks/useLoading.js`

### Image integration

- [Response transformer](https://github.com/faisal-666/odin-memory-card/blob/main/src/utils/responseTransformer.js): `src/utils/responseTransformer.js`
- [Giphy service](https://github.com/faisal-666/odin-memory-card/blob/main/src/service/giphyService.js): `src/service/giphyService.js`

### Other components

- **Player**
- **Giphy API**

## Connections

- React entry → App coordinator: renders (evidence: `src/index.jsx`)
- App coordinator → Game round: renders (evidence: `src/App.jsx`)
- App coordinator → Win dialog: renders (evidence: `src/App.jsx`)
- App coordinator → Image state: creates (evidence: `src/App.jsx`)
- App coordinator → Score state: creates (evidence: `src/App.jsx`)
- App coordinator → Loading state: creates (evidence: `src/App.jsx`)
- Game round → Giphy service: fetches images (evidence: `src/components/game/Game.jsx`)
- Giphy service → Giphy API: requests stickers (evidence: `src/service/giphyService.js`)
- Game round → Response transformer: transforms response (evidence: `src/components/game/Game.jsx`)
- Game round → Image state: updates and shuffles (evidence: `src/components/game/Game.jsx`)
- Game round → Score state: updates score (evidence: `src/components/game/Game.jsx`)
- Game round → Loading state: clears loading (evidence: `src/components/game/Game.jsx`)
- Game round → Image card: renders (evidence: `src/components/game/Game.jsx`)
- Image card → Game round: reports clicks (evidence: `src/components/card/card.jsx`)
- Player → Image card: selects (evidence: `src/components/card/card.jsx`)
- Game round → App coordinator: requests reset (evidence: `src/components/game/Game.jsx`)
- App coordinator → Win dialog: passes win state (evidence: `src/App.jsx`)
- Win dialog → App coordinator: invokes reset (evidence: `src/components/dialog/dialog.jsx`)
