# unicorntechnology2026/the-indian-edit-game architecture

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

- Interactive diagram: https://gitdiagram.com/unicorntechnology2026/the-indian-edit-game
- Repository: https://github.com/unicorntechnology2026/the-indian-edit-game

## Overview

The repository implements a browser-based branded game: players register, complete three interactive levels, receive a calculated result, and can share or claim a reward. A separate admin area supports sign-in, dashboard management, and analytics. The README describes setup rather than product behavior; workflow detail comes from the source index and sampled files. Some admin and game modules were not sampled in full, so their internal relationships are shown only where the index or excerpts support them.

Main entry points: [`src/App.tsx`](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/App.tsx) (Experience router), [`src/context/GameContext.tsx`](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/context/GameContext.tsx) (Game state), [`src/admin/adminApi.ts`](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/adminApi.ts) (Admin data API), [`src/components/Screens/Level1DecodeTheBottle.tsx`](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level1DecodeTheBottle.tsx) (Decode bottle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App entry and state"]
  node_main["App bootstrap<br/>[main.tsx]"]
  node_app["Experience router<br/>[App.tsx]"]
  node_context["Game state<br/>[GameContext.tsx]"]
end

subgraph group_game["Player experience"]
  node_login["Login and OTP<br/>[LoginScreen.tsx]"]
  node_welcome["Game welcome<br/>[WelcomeScreen.tsx]"]
  node_level1["Decode bottle"]
  node_level1intro["Decode intro"]
  node_level2["Master blend"]
  node_level3["Hunt the edit"]
  node_huntboard["Hunt game board<br/>[GameBoard.tsx]"]
  node_huntdata["Hunt round data<br/>[huntData.ts]"]
end

subgraph group_engagement["Results and rewards"]
  node_social["Social post"]
  node_share["Share card<br/>[ShareCard.tsx]"]
  node_upload["Screenshot upload<br/>[UploadScreen.tsx]"]
  node_scratchscreen["Scratch reward"]
  node_scratch["Scratch reveal<br/>[ScratchReveal.tsx]"]
  node_rewards["Reward catalog<br/>[rewards.ts]"]
  node_leaderboard["Leaderboard"]
end

subgraph group_admin["Admin console"]
  node_adminapp["Admin routing<br/>[AdminApp.tsx]"]
  node_adminlogin["Admin sign-in<br/>[AdminLogin.tsx]"]
  node_dashboard["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_analyticsview["Analytics overview"]
  node_analytics["Analytics calculations<br/>[analytics.ts]"]
  node_adminapi["Admin data API<br/>[adminApi.ts]"]
end

subgraph group_services["Data and utilities"]
  node_supabaseclient["Game data access<br/>[supabaseClient.ts]"]
  node_supabase[("Supabase")]
  node_personalities["Personality scoring<br/>[personalities.ts]"]
  node_audio["Sound engine<br/>[audio.ts]"]
end

node_player(("Player"))

node_player -->|"opens"| node_main
node_main -->|"routes players"| node_app
node_main -->|"routes admin"| node_adminapp
node_app -->|"provides state"| node_context
node_app -->|"renders"| node_login
node_app -->|"renders"| node_welcome
node_app -->|"renders"| node_level1
node_app -->|"renders"| node_level2
node_app -->|"renders"| node_level3
node_app -->|"renders"| node_social
node_app -->|"renders"| node_upload
node_app -->|"renders"| node_scratchscreen
node_level1 -->|"updates score"| node_context
node_level1 -->|"renders"| node_level1intro
node_level3 -->|"renders"| node_huntboard
node_level3 -->|"uses rounds"| node_huntdata
node_huntboard -->|"reads"| node_huntdata
node_social -->|"renders"| node_share
node_scratchscreen -->|"renders"| node_scratch
node_scratchscreen -->|"selects reward"| node_rewards
node_context -->|"computes result"| node_personalities
node_context -->|"selects reward"| node_rewards
node_context -->|"inserts registration"| node_supabaseclient
node_supabaseclient -->|"reads and writes"| node_supabase
node_leaderboard -->|"loads leaderboard"| node_supabaseclient
node_adminapp -->|"renders"| node_adminlogin
node_adminapp -->|"renders"| node_dashboard
node_adminlogin -->|"authenticates"| node_adminapi
node_dashboard -->|"loads and manages data"| node_adminapi
node_dashboard -->|"renders"| node_analyticsview
node_analyticsview -->|"uses calculations"| node_analytics
node_analyticsview -->|"loads data"| node_adminapi
node_analytics -->|"reads data"| node_adminapi
node_adminapi -->|"queries admin data"| node_supabase
node_level1 -->|"plays sounds"| node_audio
node_level2 -->|"plays sounds"| node_audio
node_level3 -->|"plays sounds"| node_audio

click node_main "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/main.tsx"
click node_app "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/App.tsx"
click node_context "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/context/GameContext.tsx"
click node_login "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/LoginScreen.tsx"
click node_welcome "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/WelcomeScreen.tsx"
click node_level1 "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level1DecodeTheBottle.tsx"
click node_level1intro "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/DecodeTheBottleIntro.tsx"
click node_level2 "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level2MasterTheBlend.tsx"
click node_level3 "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level3HuntTheEdit.tsx"
click node_huntboard "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/HuntTheEdit/GameBoard.tsx"
click node_huntdata "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/data/huntData.ts"
click node_social "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/SocialPostScreen.tsx"
click node_share "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/ShareCard/ShareCard.tsx"
click node_upload "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/UploadScreen.tsx"
click node_scratchscreen "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/ScratchCardScreen.tsx"
click node_scratch "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/ScratchCard/ScratchReveal.tsx"
click node_rewards "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/data/rewards.ts"
click node_leaderboard "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Modals/LeaderboardModal.tsx"
click node_supabaseclient "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/lib/supabaseClient.ts"
click node_personalities "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/data/personalities.ts"
click node_audio "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/utils/audio.ts"
click node_adminapp "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AdminApp.tsx"
click node_adminlogin "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AdminLogin.tsx"
click node_dashboard "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AdminDashboard.tsx"
click node_analyticsview "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AnalyticsOverview.tsx"
click node_analytics "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/analytics.ts"
click node_adminapi "https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/adminApi.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_main,node_app,node_context toneBlue
class node_login,node_welcome,node_level1,node_level1intro,node_level2,node_level3,node_huntboard,node_huntdata toneAmber
class node_social,node_share,node_upload,node_scratchscreen,node_scratch,node_rewards,node_leaderboard toneMint
class node_adminapp,node_adminlogin,node_dashboard,node_analyticsview,node_analytics,node_adminapi toneRose
class node_supabaseclient,node_supabase,node_personalities,node_audio,node_player toneIndigo
```

## Components

### App entry and state

- [App bootstrap](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/main.tsx): `src/main.tsx`
- [Experience router](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/App.tsx): `src/App.tsx`
- [Game state](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/context/GameContext.tsx): `src/context/GameContext.tsx`

### Player experience

- [Login and OTP](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/LoginScreen.tsx): `src/components/Screens/LoginScreen.tsx`
- [Game welcome](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/WelcomeScreen.tsx): `src/components/Screens/WelcomeScreen.tsx`
- [Decode bottle](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level1DecodeTheBottle.tsx): `src/components/Screens/Level1DecodeTheBottle.tsx`
- [Decode intro](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/DecodeTheBottleIntro.tsx): `src/components/Screens/DecodeTheBottleIntro.tsx`
- [Master blend](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level2MasterTheBlend.tsx): `src/components/Screens/Level2MasterTheBlend.tsx`
- [Hunt the edit](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/Level3HuntTheEdit.tsx): `src/components/Screens/Level3HuntTheEdit.tsx`
- [Hunt game board](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/HuntTheEdit/GameBoard.tsx): `src/components/HuntTheEdit/GameBoard.tsx`
- [Hunt round data](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/data/huntData.ts): `src/data/huntData.ts`

### Results and rewards

- [Social post](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/SocialPostScreen.tsx): `src/components/Screens/SocialPostScreen.tsx`
- [Share card](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/ShareCard/ShareCard.tsx): `src/components/ShareCard/ShareCard.tsx`
- [Screenshot upload](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/UploadScreen.tsx): `src/components/Screens/UploadScreen.tsx`
- [Scratch reward](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Screens/ScratchCardScreen.tsx): `src/components/Screens/ScratchCardScreen.tsx`
- [Scratch reveal](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/ScratchCard/ScratchReveal.tsx): `src/components/ScratchCard/ScratchReveal.tsx`
- [Reward catalog](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/data/rewards.ts): `src/data/rewards.ts`
- [Leaderboard](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/components/Modals/LeaderboardModal.tsx): `src/components/Modals/LeaderboardModal.tsx`

### Admin console

- [Admin routing](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AdminApp.tsx): `src/admin/AdminApp.tsx`
- [Admin sign-in](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AdminLogin.tsx): `src/admin/AdminLogin.tsx`
- [Admin dashboard](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AdminDashboard.tsx): `src/admin/AdminDashboard.tsx`
- [Analytics overview](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/AnalyticsOverview.tsx): `src/admin/AnalyticsOverview.tsx`
- [Analytics calculations](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/analytics.ts): `src/admin/analytics.ts`
- [Admin data API](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/admin/adminApi.ts): `src/admin/adminApi.ts`

### Data and utilities

- [Game data access](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/lib/supabaseClient.ts): `src/lib/supabaseClient.ts`
- **Supabase**
- [Personality scoring](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/data/personalities.ts): `src/data/personalities.ts`
- [Sound engine](https://github.com/unicorntechnology2026/the-indian-edit-game/blob/main/src/utils/audio.ts): `src/utils/audio.ts`

### Other components

- **Player**

## Connections

- Player → App bootstrap: opens (evidence: `src/main.tsx`)
- App bootstrap → Experience router: routes players (evidence: `src/main.tsx`)
- App bootstrap → Admin routing: routes admin (evidence: `src/main.tsx`)
- Experience router → Game state: provides state (evidence: `src/App.tsx`)
- Experience router → Login and OTP: renders (evidence: `src/App.tsx`)
- Experience router → Game welcome: renders (evidence: `src/App.tsx`)
- Experience router → Decode bottle: renders (evidence: `src/App.tsx`)
- Experience router → Master blend: renders (evidence: `src/App.tsx`)
- Experience router → Hunt the edit: renders (evidence: `src/App.tsx`)
- Experience router → Social post: renders (evidence: `src/App.tsx`)
- Experience router → Screenshot upload: renders (evidence: `src/App.tsx`)
- Experience router → Scratch reward: renders (evidence: `src/App.tsx`)
- Decode bottle → Game state: updates score (evidence: `src/components/Screens/Level1DecodeTheBottle.tsx`)
- Decode bottle → Decode intro: renders (evidence: `src/components/Screens/Level1DecodeTheBottle.tsx`)
- Hunt the edit → Hunt game board: renders (evidence: `src/components/Screens/Level3HuntTheEdit.tsx`)
- Hunt the edit → Hunt round data: uses rounds (evidence: `src/components/Screens/Level3HuntTheEdit.tsx`)
- Hunt game board → Hunt round data: reads (evidence: `src/components/HuntTheEdit/GameBoard.tsx`)
- Social post → Share card: renders (evidence: `src/components/Screens/SocialPostScreen.tsx`)
- Scratch reward → Scratch reveal: renders (evidence: `src/components/Screens/ScratchCardScreen.tsx`)
- Scratch reward → Reward catalog: selects reward (evidence: `src/components/Screens/ScratchCardScreen.tsx`)
- Game state → Personality scoring: computes result (evidence: `src/context/GameContext.tsx`)
- Game state → Reward catalog: selects reward (evidence: `src/context/GameContext.tsx`)
- Game state → Game data access: inserts registration (evidence: `src/context/GameContext.tsx`)
- Game data access → Supabase: reads and writes (evidence: `src/lib/supabaseClient.ts`)
- Leaderboard → Game data access: loads leaderboard (evidence: `src/components/Modals/LeaderboardModal.tsx`)
- Admin routing → Admin sign-in: renders (evidence: `src/admin/AdminApp.tsx`)
- Admin routing → Admin dashboard: renders (evidence: `src/admin/AdminApp.tsx`)
- Admin sign-in → Admin data API: authenticates (evidence: `src/admin/AdminLogin.tsx`)
- Admin dashboard → Admin data API: loads and manages data (evidence: `src/admin/AdminDashboard.tsx`)
- Admin dashboard → Analytics overview: renders (evidence: `src/admin/AdminDashboard.tsx`)
- Analytics overview → Analytics calculations: uses calculations (evidence: `src/admin/AnalyticsOverview.tsx`)
- Analytics overview → Admin data API: loads data (evidence: `src/admin/AnalyticsOverview.tsx`)
- Analytics calculations → Admin data API: reads data (evidence: `src/admin/analytics.ts`)
- Admin data API → Supabase: queries admin data (evidence: `src/admin/adminApi.ts`)
- Decode bottle → Sound engine: plays sounds (evidence: `src/components/Screens/Level1DecodeTheBottle.tsx`)
- Master blend → Sound engine: plays sounds (evidence: `src/components/Screens/Level2MasterTheBlend.tsx`)
- Hunt the edit → Sound engine: plays sounds (evidence: `src/components/Screens/Level3HuntTheEdit.tsx`)
