# andr3wsw/cash architecture

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

- Interactive diagram: https://gitdiagram.com/andr3wsw/cash
- Repository: https://github.com/andr3wsw/cash

## Overview

Cash Clicker is a browser-based idle game with account-backed progress and several social and game features. A player interacts with the page to earn and spend money, play casino games, and manage a stock portfolio; the app stores player data in Firebase. The single large script also handles authentication, leaderboards, and chat. The README is empty, and the source excerpt is partial, so this map includes only capabilities and relationships visible in the supplied tree and excerpt.

Main entry points: [`index.html`](https://github.com/andr3wsw/cash/blob/main/index.html) (Game page), [`script.js`](https://github.com/andr3wsw/cash/blob/main/script.js) (Account authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game play"]
  node_page["Game page<br/>[index.html]"]
  node_clicker["Clicking and upgrades<br/>[script.js]"]
  node_casino["Casino games<br/>[script.js]"]
end

subgraph group_accounts["Accounts and state"]
  node_auth["Account authentication<br/>[script.js]"]
  node_playerdata["Player data<br/>[script.js]"]
end

subgraph group_social["Social features"]
  node_leaderboard["Leaderboard<br/>[script.js]"]
  node_chat["Player chat<br/>[script.js]"]
end

subgraph group_market["Stock market"]
  node_stocks["Stock market<br/>[script.js]"]
end

node_player(("Player"))
node_firebaseauth["Firebase Authentication"]
node_firestore[("Cloud Firestore")]

node_player -->|"interacts with"| node_page
node_page -->|"triggers"| node_clicker
node_page -->|"opens games"| node_casino
node_page -->|"submits credentials"| node_auth
node_clicker -->|"saves progress"| node_playerdata
node_auth -->|"authenticates"| node_firebaseauth
node_auth -->|"creates player record"| node_firestore
node_playerdata -->|"reads and writes"| node_firestore
node_page -->|"opens tab"| node_leaderboard
node_leaderboard -->|"queries scores"| node_firestore
node_page -->|"sends messages"| node_chat
node_chat -->|"reads and writes"| node_firestore
node_page -->|"uses market"| node_stocks
node_stocks -->|"reads and writes"| node_firestore

click node_page "https://github.com/andr3wsw/cash/blob/main/index.html"
click node_clicker "https://github.com/andr3wsw/cash/blob/main/script.js"
click node_casino "https://github.com/andr3wsw/cash/blob/main/script.js"
click node_auth "https://github.com/andr3wsw/cash/blob/main/script.js"
click node_playerdata "https://github.com/andr3wsw/cash/blob/main/script.js"
click node_leaderboard "https://github.com/andr3wsw/cash/blob/main/script.js"
click node_chat "https://github.com/andr3wsw/cash/blob/main/script.js"
click node_stocks "https://github.com/andr3wsw/cash/blob/main/script.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_page,node_clicker,node_casino toneBlue
class node_auth,node_playerdata,node_firestore toneAmber
class node_leaderboard,node_chat toneMint
class node_stocks toneRose
class node_player,node_firebaseauth toneIndigo
```

## Components

### Game play

- [Game page](https://github.com/andr3wsw/cash/blob/main/index.html): `index.html`
- [Clicking and upgrades](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`
- [Casino games](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`

### Accounts and state

- [Account authentication](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`
- [Player data](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`

### Social features

- [Leaderboard](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`
- [Player chat](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`

### Stock market

- [Stock market](https://github.com/andr3wsw/cash/blob/main/script.js): `script.js`

### Other components

- **Player**
- **Firebase Authentication**
- **Cloud Firestore**

## Connections

- Player → Game page: interacts with
- Game page → Clicking and upgrades: triggers (evidence: `script.js`)
- Game page → Casino games: opens games (evidence: `script.js`)
- Game page → Account authentication: submits credentials (evidence: `script.js`)
- Clicking and upgrades → Player data: saves progress (evidence: `script.js`)
- Account authentication → Firebase Authentication: authenticates (evidence: `script.js`)
- Account authentication → Cloud Firestore: creates player record (evidence: `script.js`)
- Player data → Cloud Firestore: reads and writes (evidence: `script.js`)
- Game page → Leaderboard: opens tab (evidence: `script.js`)
- Leaderboard → Cloud Firestore: queries scores (evidence: `script.js`)
- Game page → Player chat: sends messages (evidence: `script.js`)
- Player chat → Cloud Firestore: reads and writes (evidence: `script.js`)
- Game page → Stock market: uses market (evidence: `script.js`)
- Stock market → Cloud Firestore: reads and writes (evidence: `script.js`)
