# omarsilano/memorrachare architecture

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

- Interactive diagram: https://gitdiagram.com/omarsilano/memorrachare
- Repository: https://github.com/omarsilano/memorrachare

## Overview

Memorracharé is a browser-based Neapolitan-card memory game. Players choose Classic or Memorracharé rules and play solo, locally against another player, or against a difficulty-adjustable CPU; the game manages card turns, matching, scores and results. Its presentation includes responsive layouts, animations and audio feedback. A separate service worker supports caching and network fallback. The map follows README-described capabilities and the shown game.js and sw.js excerpts; unsampled HTML and CSS details are limited to the README’s descriptions.

Main entry points: [`game.js`](https://github.com/omarsilano/memorrachare/blob/main/game.js) (Game runtime), [`index.html`](https://github.com/omarsilano/memorrachare/blob/main/index.html) (Game page), [`sw.js`](https://github.com/omarsilano/memorrachare/blob/main/sw.js) (Service worker), [`style.css`](https://github.com/omarsilano/memorrachare/blob/main/style.css) (Responsive design)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game play"]
  node_game_page["Game page<br/>[index.html]"]
  node_game_runtime["Game runtime<br/>[game.js]"]
  node_game_modes["Game modes<br/>[game.js]"]
  node_turns_scoring["Turns and scoring<br/>[game.js]"]
  node_cpu_opponent["CPU opponent<br/>[game.js]"]
end

subgraph group_experience["Player experience"]
  node_visual_design["Responsive design<br/>[style.css]"]
  node_audio_feedback["Audio feedback<br/>[game.js]"]
  node_media_assets["Game media"]
end

subgraph group_offline["Offline support"]
  node_service_worker["Service worker<br/>[sw.js]"]
  node_browser_cache[("Browser cache")]
end

node_player(("Player"))
node_network["Network"]

node_player -->|"plays"| node_game_page
node_game_runtime -->|"updates interface"| node_game_page
node_game_runtime -->|"starts mode"| node_game_modes
node_game_runtime -->|"manages turns"| node_turns_scoring
node_game_runtime -->|"simulates moves"| node_cpu_opponent
node_game_page -->|"styled by"| node_visual_design
node_game_runtime -->|"plays sounds"| node_audio_feedback
node_audio_feedback -.->|"uses"| node_media_assets
node_service_worker -->|"reads and writes"| node_browser_cache
node_service_worker -->|"fetches resources"| node_network

click node_game_page "https://github.com/omarsilano/memorrachare/blob/main/index.html"
click node_game_runtime "https://github.com/omarsilano/memorrachare/blob/main/game.js"
click node_game_modes "https://github.com/omarsilano/memorrachare/blob/main/game.js"
click node_turns_scoring "https://github.com/omarsilano/memorrachare/blob/main/game.js"
click node_cpu_opponent "https://github.com/omarsilano/memorrachare/blob/main/game.js"
click node_visual_design "https://github.com/omarsilano/memorrachare/blob/main/style.css"
click node_audio_feedback "https://github.com/omarsilano/memorrachare/blob/main/game.js"
click node_media_assets "https://github.com/omarsilano/memorrachare/tree/main/audio"
click node_service_worker "https://github.com/omarsilano/memorrachare/blob/main/sw.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_game_page,node_game_runtime,node_game_modes,node_turns_scoring,node_cpu_opponent toneBlue
class node_visual_design,node_audio_feedback,node_media_assets toneAmber
class node_service_worker,node_browser_cache toneMint
class node_player,node_network toneIndigo
```

## Components

### Game play

- [Game page](https://github.com/omarsilano/memorrachare/blob/main/index.html): `index.html`
- [Game runtime](https://github.com/omarsilano/memorrachare/blob/main/game.js): `game.js`
- [Game modes](https://github.com/omarsilano/memorrachare/blob/main/game.js): `game.js`
- [Turns and scoring](https://github.com/omarsilano/memorrachare/blob/main/game.js): `game.js`
- [CPU opponent](https://github.com/omarsilano/memorrachare/blob/main/game.js): `game.js`

### Player experience

- [Responsive design](https://github.com/omarsilano/memorrachare/blob/main/style.css): `style.css`
- [Audio feedback](https://github.com/omarsilano/memorrachare/blob/main/game.js): `game.js`
- [Game media](https://github.com/omarsilano/memorrachare/tree/main/audio): `audio`

### Offline support

- [Service worker](https://github.com/omarsilano/memorrachare/blob/main/sw.js): `sw.js`
- **Browser cache**

### Other components

- **Player**
- **Network**

## Connections

- Player → Game page: plays (evidence: `README.md`)
- Game runtime → Game page: updates interface (evidence: `game.js`)
- Game runtime → Game modes: starts mode (evidence: `game.js`)
- Game runtime → Turns and scoring: manages turns (evidence: `game.js`)
- Game runtime → CPU opponent: simulates moves (evidence: `game.js`)
- Game page → Responsive design: styled by (evidence: `README.md`)
- Game runtime → Audio feedback: plays sounds (evidence: `game.js`)
- Audio feedback → Game media: uses (evidence: `README.md`)
- Service worker → Browser cache: reads and writes (evidence: `sw.js`)
- Service worker → Network: fetches resources (evidence: `sw.js`)
