# dotrihai1907/lucky-draw architecture

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

- Interactive diagram: https://gitdiagram.com/dotrihai1907/lucky-draw
- Repository: https://github.com/dotrihai1907/lucky-draw

## Overview

Lucky Draw is a browser-based event app: participants and prizes are configured, a user starts a wheel or lottery draw, the page selects and reveals a winner, and the winner can be accepted or redrawn. The page is the central stateful orchestrator; UI components render its state and send actions back through callbacks. The sampled page shows cryptographic random selection and winner exclusion, plus spreadsheet upload and sound setup. Some component wiring is supported only by the SOURCE INDEX; unsampled internals are not inferred.

Main entry points: [`src/pages/LuckyDrawPage.tsx`](https://github.com/dotrihai1907/lucky-draw/blob/master/src/pages/LuckyDrawPage.tsx) (Lucky draw page), [`src/App.tsx`](https://github.com/dotrihai1907/lucky-draw/blob/master/src/App.tsx) (App shell), [`src/main.tsx`](https://github.com/dotrihai1907/lucky-draw/blob/master/src/main.tsx) (React entry), [`src/types/index.ts`](https://github.com/dotrihai1907/lucky-draw/blob/master/src/types/index.ts) (Draw types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["App shell<br/>[App.tsx]"]
  node_entry["React entry<br/>[main.tsx]"]
end

subgraph group_draw["Draw orchestration"]
  node_page["Lucky draw page<br/>[LuckyDrawPage.tsx]"]
  node_types["Draw types<br/>[index.ts]"]
end

subgraph group_setup["Participants and prizes"]
  node_defaults["Sample entries<br/>[dummy.ts]"]
  node_sidebar["Participant sidebar<br/>[Sidebar.tsx]"]
  node_empty_player["Empty participant prompt<br/>[EmptyPlayer.tsx]"]
  node_settings["Prize and mode settings<br/>[SettingsModal.tsx]"]
  node_empty_prize["Empty prize prompt<br/>[EmptyPrize.tsx]"]
  node_sidebar_button["Sidebar control<br/>[SidebarButton.tsx]"]
  node_settings_button["Settings control<br/>[SettingsButton.tsx]"]
end

subgraph group_experience["Draw experience"]
  node_wheel["Wheel display<br/>[LuckyWheel.tsx]"]
  node_lottery["Lottery display<br/>[Lottery.tsx]"]
  node_header["Current prize header<br/>[WheelHeader.tsx]"]
  node_action["Draw action<br/>[WheelAction.tsx]"]
  node_sound_assets["Sound effects"]
end

subgraph group_winners["Winner records"]
  node_result["Winner confirmation<br/>[ResultModal.tsx]"]
  node_winner_button["Winners control<br/>[WinnerButton.tsx]"]
  node_winners_list["Winners by prize<br/>[WinnersByPrize.tsx]"]
end

node_event_host(("Event host"))

node_event_host -->|"opens app"| node_app
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_page
node_page -->|"loads defaults"| node_defaults
node_page -->|"uses types"| node_types
node_page -->|"renders"| node_sidebar
node_page -->|"renders"| node_empty_player
node_page -->|"renders"| node_settings
node_page -->|"renders"| node_empty_prize
node_page -->|"renders"| node_sidebar_button
node_page -->|"renders"| node_wheel
node_page -->|"renders"| node_lottery
node_page -->|"renders"| node_header
node_page -->|"renders"| node_action
node_page -->|"renders"| node_result
node_page -->|"renders"| node_winner_button
node_page -->|"renders"| node_winners_list
node_page -->|"renders"| node_settings_button
node_page -->|"plays audio"| node_sound_assets

click node_app "https://github.com/dotrihai1907/lucky-draw/blob/master/src/App.tsx"
click node_entry "https://github.com/dotrihai1907/lucky-draw/blob/master/src/main.tsx"
click node_page "https://github.com/dotrihai1907/lucky-draw/blob/master/src/pages/LuckyDrawPage.tsx"
click node_types "https://github.com/dotrihai1907/lucky-draw/blob/master/src/types/index.ts"
click node_defaults "https://github.com/dotrihai1907/lucky-draw/blob/master/src/constants/dummy.ts"
click node_sidebar "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/Sidebar.tsx"
click node_empty_player "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/EmptyPlayer.tsx"
click node_settings "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/SettingsModal.tsx"
click node_empty_prize "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/EmptyPrize.tsx"
click node_sidebar_button "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/SidebarButton.tsx"
click node_wheel "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/LuckyWheel.tsx"
click node_lottery "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/Lottery.tsx"
click node_header "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WheelHeader.tsx"
click node_action "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WheelAction.tsx"
click node_result "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/ResultModal.tsx"
click node_winner_button "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WinnerButton.tsx"
click node_winners_list "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WinnersByPrize.tsx"
click node_settings_button "https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/SettingsButton.tsx"
click node_sound_assets "https://github.com/dotrihai1907/lucky-draw/tree/master/public/sounds"

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_app,node_entry toneBlue
class node_page,node_types toneAmber
class node_defaults,node_sidebar,node_empty_player,node_settings,node_empty_prize,node_sidebar_button,node_settings_button toneMint
class node_wheel,node_lottery,node_header,node_action,node_sound_assets toneRose
class node_result,node_winner_button,node_winners_list,node_event_host toneIndigo
```

## Components

### Application shell

- [App shell](https://github.com/dotrihai1907/lucky-draw/blob/master/src/App.tsx): `src/App.tsx`
- [React entry](https://github.com/dotrihai1907/lucky-draw/blob/master/src/main.tsx): `src/main.tsx`

### Draw orchestration

- [Lucky draw page](https://github.com/dotrihai1907/lucky-draw/blob/master/src/pages/LuckyDrawPage.tsx): `src/pages/LuckyDrawPage.tsx`
- [Draw types](https://github.com/dotrihai1907/lucky-draw/blob/master/src/types/index.ts): `src/types/index.ts`

### Participants and prizes

- [Sample entries](https://github.com/dotrihai1907/lucky-draw/blob/master/src/constants/dummy.ts): `src/constants/dummy.ts`
- [Participant sidebar](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`
- [Empty participant prompt](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/EmptyPlayer.tsx): `src/components/EmptyPlayer.tsx`
- [Prize and mode settings](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/SettingsModal.tsx): `src/components/SettingsModal.tsx`
- [Empty prize prompt](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/EmptyPrize.tsx): `src/components/EmptyPrize.tsx`
- [Sidebar control](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/SidebarButton.tsx): `src/components/SidebarButton.tsx`
- [Settings control](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/SettingsButton.tsx): `src/components/SettingsButton.tsx`

### Draw experience

- [Wheel display](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/LuckyWheel.tsx): `src/components/LuckyWheel.tsx`
- [Lottery display](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/Lottery.tsx): `src/components/Lottery.tsx`
- [Current prize header](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WheelHeader.tsx): `src/components/WheelHeader.tsx`
- [Draw action](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WheelAction.tsx): `src/components/WheelAction.tsx`
- [Sound effects](https://github.com/dotrihai1907/lucky-draw/tree/master/public/sounds): `public/sounds`

### Winner records

- [Winner confirmation](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/ResultModal.tsx): `src/components/ResultModal.tsx`
- [Winners control](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WinnerButton.tsx): `src/components/WinnerButton.tsx`
- [Winners by prize](https://github.com/dotrihai1907/lucky-draw/blob/master/src/components/WinnersByPrize.tsx): `src/components/WinnersByPrize.tsx`

### Other components

- **Event host**

## Connections

- Event host → App shell: opens app
- React entry → App shell: renders (evidence: `src/main.tsx`)
- App shell → Lucky draw page: renders (evidence: `src/App.tsx`)
- Lucky draw page → Sample entries: loads defaults (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Draw types: uses types (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Participant sidebar: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Empty participant prompt: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Prize and mode settings: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Empty prize prompt: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Sidebar control: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Wheel display: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Lottery display: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Current prize header: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Draw action: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Winner confirmation: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Winners control: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Winners by prize: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Settings control: renders (evidence: `src/pages/LuckyDrawPage.tsx`)
- Lucky draw page → Sound effects: plays audio (evidence: `src/pages/LuckyDrawPage.tsx`)
