How dotrihai1907/lucky-draw works
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: LuckyDrawPage.tsx Lucky draw page · App.tsx App shell · main.tsx React entry · index.ts Draw types
Components 20
Application shell
- App shell
src/App.tsx - React entry
src/main.tsx
Draw orchestration
- Lucky draw page
src/pages/LuckyDrawPage.tsx - Draw types
src/types/index.ts
Participants and prizes
- Sample entries
src/constants/dummy.ts - Participant sidebar
src/components/Sidebar.tsx - Empty participant prompt
src/components/EmptyPlayer.tsx - Prize and mode settings
src/components/SettingsModal.tsx - Empty prize prompt
src/components/EmptyPrize.tsx - Sidebar control
src/components/SidebarButton.tsx - Settings control
src/components/SettingsButton.tsx
Draw experience
- Wheel display
src/components/LuckyWheel.tsx - Lottery display
src/components/Lottery.tsx - Current prize header
src/components/WheelHeader.tsx - Draw action
src/components/WheelAction.tsx - Sound effects
public/sounds
Winner records
- Winner confirmation
src/components/ResultModal.tsx - Winners control
src/components/WinnerButton.tsx - Winners by prize
src/components/WinnersByPrize.tsx
Other components
- Event host
Connections 19
- Event host → App shell: opens app
- React entry → App shell: renders
src/main.tsx - App shell → Lucky draw page: renders
src/App.tsx - Lucky draw page → Sample entries: loads defaults
src/pages/LuckyDrawPage.tsx - Lucky draw page → Draw types: uses types
src/pages/LuckyDrawPage.tsx - Lucky draw page → Participant sidebar: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Empty participant prompt: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Prize and mode settings: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Empty prize prompt: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Sidebar control: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Wheel display: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Lottery display: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Current prize header: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Draw action: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Winner confirmation: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Winners control: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Winners by prize: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Settings control: renders
src/pages/LuckyDrawPage.tsx - Lucky draw page → Sound effects: plays audio
src/pages/LuckyDrawPage.tsx