# meghana-m-revankar/piggy-bank-toy architecture

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

- Interactive diagram: https://gitdiagram.com/meghana-m-revankar/piggy-bank-toy
- Repository: https://github.com/meghana-m-revankar/piggy-bank-toy

## Overview

Piggy Bank Toy is a small browser-based interactive game: the player drops coins into a piggy bank, fills it to 20, watches the hammer smash it, then restarts. The React app owns input handling, game state, animation, and canvas drawing; it invokes a small synthesized-sound module for interaction and impact effects. The README documents the fill limit, smash, and restart; the sampled code shows those behaviors within one app module, so they are not represented as separate cooperating modules.

Main entry points: [`src/App.tsx`](https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/App.tsx) (Piggy bank toy), [`src/audio.ts`](https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/audio.ts) (Synthesized sounds), [`src/main.tsx`](https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/main.tsx) (React bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Toy application"]
  node_bootstrap["React bootstrap<br/>[main.tsx]"]
  node_toy["Piggy bank toy<br/>[App.tsx]"]
end

subgraph group_media["Audio effects"]
  node_audio["Synthesized sounds<br/>[audio.ts]"]
end

node_player(("Player"))
node_browser["Browser APIs"]

node_bootstrap -->|"renders"| node_toy
node_player -->|"interacts"| node_toy
node_toy -->|"triggers effects"| node_audio
node_toy -->|"uses canvas and events"| node_browser
node_audio -->|"uses Web Audio"| node_browser

click node_bootstrap "https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/main.tsx"
click node_toy "https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/App.tsx"
click node_audio "https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/audio.ts"

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_bootstrap,node_toy,node_browser toneBlue
class node_audio toneAmber
class node_player toneIndigo
```

## Components

### Toy application

- [React bootstrap](https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/main.tsx): `src/main.tsx`
- [Piggy bank toy](https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/App.tsx): `src/App.tsx`

### Audio effects

- [Synthesized sounds](https://github.com/meghana-m-revankar/piggy-bank-toy/blob/main/src/audio.ts): `src/audio.ts`

### Other components

- **Player**
- **Browser APIs**

## Connections

- React bootstrap → Piggy bank toy: renders (evidence: `src/main.tsx`)
- Player → Piggy bank toy: interacts (evidence: `src/App.tsx`)
- Piggy bank toy → Synthesized sounds: triggers effects (evidence: `src/App.tsx`)
- Piggy bank toy → Browser APIs: uses canvas and events (evidence: `src/App.tsx`)
- Synthesized sounds → Browser APIs: uses Web Audio (evidence: `src/audio.ts`)
