# kapustakstepan-dev/project-casino architecture

> Architecture diagram of the GitHub repository kapustakstepan-dev/project-casino, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kapustakstepan-dev/project-casino
- Repository: https://github.com/kapustakstepan-dev/project-casino

## Overview

Project-Casino is an educational, browser-based casino simulator with a lobby, roulette, blackjack and virtual sports pages, fictional credits, age/legal gates, registration, and multilingual UI. The intended user journey is to pass the age and legal checks, register before entering a game, then play with simulated credits. The sampled code supports the access flow and wallet persistence, but the game-page implementations and HTML script wiring were not sampled, so links from games to wallet operations and page-to-script relationships are omitted.

Main entry points: [`logic/auth.js`](https://github.com/kapustakstepan-dev/project-casino/blob/main/logic/auth.js) (Access flow), [`logic/wallet.js`](https://github.com/kapustakstepan-dev/project-casino/blob/main/logic/wallet.js) (Wallet logic), [`languages/i18n.js`](https://github.com/kapustakstepan-dev/project-casino/blob/main/languages/i18n.js) (Language manager), [`index.html`](https://github.com/kapustakstepan-dev/project-casino/blob/main/index.html) (Casino lobby)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lobby["Casino experience"]
  node_lobby_page["Casino lobby<br/>[index.html]"]
  node_visuals["Lobby animations<br/>[background.js]"]
end

subgraph group_access["Access and compliance"]
  node_age_page["Age check<br/>[age.html]"]
  node_responsible_page["Underage notice<br/>[underage.html]"]
  node_responsible_link["Responsible gaming<br/>[advertense.html]"]
  node_legal_page["Legal terms<br/>[legal.html]"]
  node_login_page["Registration<br/>[login.html]"]
  node_auth["Access flow<br/>[auth.js]"]
end

subgraph group_games["Game pages"]
  node_roulette["Roulette<br/>[roulette.html]"]
  node_blackjack["Blackjack<br/>[blackjack.html]"]
  node_sports["Virtual sports<br/>[sports.html]"]
end

subgraph group_wallet["Fictional credits"]
  node_wallet_logic["Wallet logic<br/>[wallet.js]"]
  node_credit_store[("Browser credit state")]
end

subgraph group_language["Localization"]
  node_language_manager["Language manager<br/>[i18n.js]"]
  node_language_store[("Language preference")]
  node_legacy_language["Alternate translations<br/>[languages.js]"]
end

node_visitor(("Visitor"))
node_anime["Anime.js"]

node_visitor -->|"opens"| node_lobby_page
node_visitor -->|"confirms age"| node_age_page
node_visitor -->|"accepts terms"| node_legal_page
node_visitor -->|"registers"| node_login_page
node_visitor -->|"opens game"| node_roulette
node_visitor -->|"opens game"| node_blackjack
node_visitor -->|"opens game"| node_sports
node_auth -->|"reads and writes"| node_credit_store
node_auth -->|"redirects"| node_age_page
node_auth -->|"redirects"| node_responsible_page
node_auth -->|"redirects"| node_legal_page
node_auth -->|"redirects"| node_login_page
node_auth -->|"redirects"| node_lobby_page
node_auth -->|"redirects"| node_roulette
node_auth -->|"redirects"| node_blackjack
node_auth -->|"redirects"| node_sports
node_wallet_logic -->|"reads and writes"| node_credit_store
node_language_manager -->|"reads and writes"| node_language_store
node_legacy_language -->|"reads and writes"| node_language_store
node_language_manager -.->|"animates changes"| node_anime
node_wallet_logic -.->|"animates balance"| node_anime
node_visuals -.->|"animates lobby"| node_anime
node_visitor -->|"opens"| node_responsible_link

click node_lobby_page "https://github.com/kapustakstepan-dev/project-casino/blob/main/index.html"
click node_visuals "https://github.com/kapustakstepan-dev/project-casino/blob/main/background.js"
click node_age_page "https://github.com/kapustakstepan-dev/project-casino/blob/main/age.html"
click node_responsible_page "https://github.com/kapustakstepan-dev/project-casino/blob/main/underage.html"
click node_responsible_link "https://github.com/kapustakstepan-dev/project-casino/blob/main/advertense.html"
click node_legal_page "https://github.com/kapustakstepan-dev/project-casino/blob/main/legal.html"
click node_login_page "https://github.com/kapustakstepan-dev/project-casino/blob/main/login.html"
click node_auth "https://github.com/kapustakstepan-dev/project-casino/blob/main/logic/auth.js"
click node_roulette "https://github.com/kapustakstepan-dev/project-casino/blob/main/model/roulette.html"
click node_blackjack "https://github.com/kapustakstepan-dev/project-casino/blob/main/model/blackjack.html"
click node_sports "https://github.com/kapustakstepan-dev/project-casino/blob/main/model/sports.html"
click node_wallet_logic "https://github.com/kapustakstepan-dev/project-casino/blob/main/logic/wallet.js"
click node_language_manager "https://github.com/kapustakstepan-dev/project-casino/blob/main/languages/i18n.js"
click node_legacy_language "https://github.com/kapustakstepan-dev/project-casino/blob/main/languages/languages.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_lobby_page,node_visuals toneBlue
class node_age_page,node_responsible_page,node_responsible_link,node_legal_page,node_login_page,node_auth toneAmber
class node_roulette,node_blackjack,node_sports toneMint
class node_wallet_logic,node_credit_store toneRose
class node_language_manager,node_language_store,node_legacy_language,node_visitor,node_anime toneIndigo
```

## Components

### Casino experience

- [Casino lobby](https://github.com/kapustakstepan-dev/project-casino/blob/main/index.html): `index.html`
- [Lobby animations](https://github.com/kapustakstepan-dev/project-casino/blob/main/background.js): `background.js`

### Access and compliance

- [Age check](https://github.com/kapustakstepan-dev/project-casino/blob/main/age.html): `age.html`
- [Underage notice](https://github.com/kapustakstepan-dev/project-casino/blob/main/underage.html): `underage.html`
- [Responsible gaming](https://github.com/kapustakstepan-dev/project-casino/blob/main/advertense.html): `advertense.html`
- [Legal terms](https://github.com/kapustakstepan-dev/project-casino/blob/main/legal.html): `legal.html`
- [Registration](https://github.com/kapustakstepan-dev/project-casino/blob/main/login.html): `login.html`
- [Access flow](https://github.com/kapustakstepan-dev/project-casino/blob/main/logic/auth.js): `logic/auth.js`

### Game pages

- [Roulette](https://github.com/kapustakstepan-dev/project-casino/blob/main/model/roulette.html): `model/roulette.html`
- [Blackjack](https://github.com/kapustakstepan-dev/project-casino/blob/main/model/blackjack.html): `model/blackjack.html`
- [Virtual sports](https://github.com/kapustakstepan-dev/project-casino/blob/main/model/sports.html): `model/sports.html`

### Fictional credits

- [Wallet logic](https://github.com/kapustakstepan-dev/project-casino/blob/main/logic/wallet.js): `logic/wallet.js`
- **Browser credit state**

### Localization

- [Language manager](https://github.com/kapustakstepan-dev/project-casino/blob/main/languages/i18n.js): `languages/i18n.js`
- **Language preference**
- [Alternate translations](https://github.com/kapustakstepan-dev/project-casino/blob/main/languages/languages.js): `languages/languages.js`

### Other components

- **Visitor**
- **Anime.js**

## Connections

- Visitor → Casino lobby: opens
- Visitor → Age check: confirms age
- Visitor → Legal terms: accepts terms
- Visitor → Registration: registers
- Visitor → Roulette: opens game
- Visitor → Blackjack: opens game
- Visitor → Virtual sports: opens game
- Access flow → Browser credit state: reads and writes
- Access flow → Age check: redirects
- Access flow → Underage notice: redirects
- Access flow → Legal terms: redirects
- Access flow → Registration: redirects
- Access flow → Casino lobby: redirects
- Access flow → Roulette: redirects
- Access flow → Blackjack: redirects
- Access flow → Virtual sports: redirects
- Wallet logic → Browser credit state: reads and writes
- Language manager → Language preference: reads and writes
- Alternate translations → Language preference: reads and writes
- Language manager → Anime.js: animates changes
- Wallet logic → Anime.js: animates balance
- Lobby animations → Anime.js: animates lobby
- Visitor → Responsible gaming: opens
