# ako1122/angelako-sandylam architecture

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

- Interactive diagram: https://gitdiagram.com/ako1122/angelako-sandylam
- Repository: https://github.com/ako1122/angelako-sandylam

## Overview

Sandy Lam 鐵粉挑戰賽 is a browser-based music and album game site, with static song data and Netlify Functions-backed leaderboards. Players choose a game, play and score in the browser, and—where supported—submit scores and view rankings. The graph includes the documented tournament, quiz, cover-version, and memory games, plus additional game modules and leaderboard endpoints present in the source index. Relationships are limited to README documentation and shown source excerpts; several game-to-endpoint links are therefore omitted where the caller was not shown.

Main entry points: [`sandylam-netlify/netlify/functions/submit-score.js`](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/submit-score.js) (Quiz score API), [`sandylam-netlify/data/songs.json`](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/data/songs.json) (Song catalog), [`sandylam-netlify/js/guess-album.js`](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-album.js) (Album quiz), [`sandylam-netlify/js/guess-cover-version-song.js`](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-cover-version-song.js) (Cover song quiz)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_games["Browser games"]
  node_tournament["Song tournament<br/>[app.js]"]
  node_songquiz["Song quiz<br/>[guess.js]"]
  node_albumquiz["Album quiz<br/>[guess-album.js]"]
  node_coversong["Cover song quiz"]
  node_coveralbum["Cover album quiz"]
  node_memory["Memory match<br/>[memory-match.js]"]
  node_catch["Catch covers<br/>[catch-cover.js]"]
  node_mahjong["Mahjong<br/>[mahjong.js]"]
  node_match3["Match three<br/>[match3.js]"]
  node_whack["Whack covers<br/>[whack-cover.js]"]
end

subgraph group_catalog["Game data"]
  node_songs["Song catalog<br/>[songs.json]"]
  node_covers["Cover catalog<br/>[cover.json]"]
end

subgraph group_rankings["Leaderboards"]
  node_quizsubmit["Quiz score API<br/>[submit-score.js]"]
  node_quizget["Quiz rankings API<br/>[get-leaderboard.js]"]
  node_memorysubmit["Memory score API"]
  node_memoryget["Memory rankings API"]
  node_gameapis["Other game APIs"]
end

subgraph group_storage["Ranking storage"]
  node_redis[("Upstash Redis")]
end

node_player(("Player"))

node_player -->|"plays"| node_tournament
node_player -->|"plays"| node_songquiz
node_player -->|"plays"| node_albumquiz
node_player -->|"plays"| node_coversong
node_player -->|"plays"| node_coveralbum
node_player -->|"plays"| node_memory
node_player -.->|"plays"| node_catch
node_player -.->|"plays"| node_mahjong
node_player -.->|"plays"| node_match3
node_player -.->|"plays"| node_whack
node_tournament -->|"fetches"| node_songs
node_albumquiz -->|"fetches"| node_songs
node_catch -->|"fetches"| node_songs
node_mahjong -->|"fetches"| node_songs
node_match3 -->|"fetches"| node_songs
node_coversong -->|"uses"| node_covers
node_coveralbum -->|"uses"| node_covers
node_songquiz -.->|"submits scores"| node_quizsubmit
node_albumquiz -->|"submits scores"| node_quizsubmit
node_coversong -.->|"submits scores"| node_quizsubmit
node_coveralbum -.->|"submits scores"| node_quizsubmit
node_memory -.->|"submits scores"| node_memorysubmit
node_catch -->|"submits scores"| node_gameapis
node_quizsubmit -->|"writes"| node_redis
node_quizget -->|"reads"| node_redis
node_memorysubmit -->|"writes"| node_redis
node_memoryget -->|"reads"| node_redis
node_gameapis -.->|"reads and writes"| node_redis

click node_tournament "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/app.js"
click node_songquiz "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess.js"
click node_albumquiz "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-album.js"
click node_coversong "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-cover-version-song.js"
click node_coveralbum "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-cover-version-album.js"
click node_memory "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/memory-match.js"
click node_catch "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/catch-cover.js"
click node_mahjong "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/mahjong.js"
click node_match3 "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/match3.js"
click node_whack "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/whack-cover.js"
click node_songs "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/data/songs.json"
click node_covers "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/data/cover.json"
click node_quizsubmit "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/submit-score.js"
click node_quizget "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/get-leaderboard.js"
click node_memorysubmit "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/submit-memory-score.js"
click node_memoryget "https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/get-memory-leaderboard.js"
click node_gameapis "https://github.com/ako1122/angelako-sandylam/tree/main/sandylam-netlify/netlify/functions"

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_tournament,node_songquiz,node_albumquiz,node_coversong,node_coveralbum,node_memory,node_catch,node_mahjong,node_match3,node_whack toneBlue
class node_songs,node_covers toneAmber
class node_quizsubmit,node_quizget,node_memorysubmit,node_memoryget,node_gameapis toneMint
class node_redis toneRose
class node_player toneIndigo
```

## Components

### Browser games

- [Song tournament](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/app.js): `sandylam-netlify/js/app.js`
- [Song quiz](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess.js): `sandylam-netlify/js/guess.js`
- [Album quiz](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-album.js): `sandylam-netlify/js/guess-album.js`
- [Cover song quiz](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-cover-version-song.js): `sandylam-netlify/js/guess-cover-version-song.js`
- [Cover album quiz](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/guess-cover-version-album.js): `sandylam-netlify/js/guess-cover-version-album.js`
- [Memory match](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/memory-match.js): `sandylam-netlify/js/memory-match.js`
- [Catch covers](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/catch-cover.js): `sandylam-netlify/js/catch-cover.js`
- [Mahjong](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/mahjong.js): `sandylam-netlify/js/mahjong.js`
- [Match three](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/match3.js): `sandylam-netlify/js/match3.js`
- [Whack covers](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/js/whack-cover.js): `sandylam-netlify/js/whack-cover.js`

### Game data

- [Song catalog](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/data/songs.json): `sandylam-netlify/data/songs.json`
- [Cover catalog](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/data/cover.json): `sandylam-netlify/data/cover.json`

### Leaderboards

- [Quiz score API](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/submit-score.js): `sandylam-netlify/netlify/functions/submit-score.js`
- [Quiz rankings API](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/get-leaderboard.js): `sandylam-netlify/netlify/functions/get-leaderboard.js`
- [Memory score API](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/submit-memory-score.js): `sandylam-netlify/netlify/functions/submit-memory-score.js`
- [Memory rankings API](https://github.com/ako1122/angelako-sandylam/blob/main/sandylam-netlify/netlify/functions/get-memory-leaderboard.js): `sandylam-netlify/netlify/functions/get-memory-leaderboard.js`
- [Other game APIs](https://github.com/ako1122/angelako-sandylam/tree/main/sandylam-netlify/netlify/functions): `sandylam-netlify/netlify/functions`

### Ranking storage

- **Upstash Redis**

### Other components

- **Player**

## Connections

- Player → Song tournament: plays (evidence: `README.md`)
- Player → Song quiz: plays (evidence: `README.md`)
- Player → Album quiz: plays (evidence: `README.md`)
- Player → Cover song quiz: plays (evidence: `README.md`)
- Player → Cover album quiz: plays (evidence: `README.md`)
- Player → Memory match: plays (evidence: `README.md`)
- Player → Catch covers: plays
- Player → Mahjong: plays
- Player → Match three: plays
- Player → Whack covers: plays
- Song tournament → Song catalog: fetches (evidence: `sandylam-netlify/js/app.js`)
- Album quiz → Song catalog: fetches (evidence: `sandylam-netlify/js/guess-album.js`)
- Catch covers → Song catalog: fetches (evidence: `sandylam-netlify/js/catch-cover.js`)
- Mahjong → Song catalog: fetches (evidence: `sandylam-netlify/js/mahjong.js`)
- Match three → Song catalog: fetches (evidence: `sandylam-netlify/js/match3.js`)
- Cover song quiz → Cover catalog: uses (evidence: `README.md`)
- Cover album quiz → Cover catalog: uses (evidence: `README.md`)
- Song quiz → Quiz score API: submits scores
- Album quiz → Quiz score API: submits scores (evidence: `README.md`)
- Cover song quiz → Quiz score API: submits scores
- Cover album quiz → Quiz score API: submits scores
- Memory match → Memory score API: submits scores
- Catch covers → Other game APIs: submits scores (evidence: `sandylam-netlify/js/catch-cover.js`)
- Quiz score API → Upstash Redis: writes (evidence: `README.md`)
- Quiz rankings API → Upstash Redis: reads (evidence: `README.md`)
- Memory score API → Upstash Redis: writes (evidence: `sandylam-netlify/netlify/functions/submit-memory-score.js`)
- Memory rankings API → Upstash Redis: reads (evidence: `README.md`)
- Other game APIs → Upstash Redis: reads and writes
