# youssefdh840/game-world- architecture

> Architecture diagram of the GitHub repository youssefdh840/game-world-, 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/youssefdh840/game-world-
- Repository: https://github.com/youssefdh840/game-world-

## Overview

World Challenge is a social multiplayer cultural-games app. Players authenticate or enter as guests, discover countries or choose a game, find an opponent or create a private duel, play a real-time match, and earn progression such as passport stamps. The graph also includes documented daily challenges, leaderboards, badges, and admin moderation. Source excerpts show key orchestration and service dependencies; several feature implementations are unsampled, so those branches are documented capabilities rather than asserted call flows.

Main entry points: [`src/App.tsx`](https://github.com/youssefdh840/game-world-/blob/main/src/App.tsx) (App Shell), [`src/services/userService.ts`](https://github.com/youssefdh840/game-world-/blob/main/src/services/userService.ts) (User & Progress Data), [`src/services/firebase.ts`](https://github.com/youssefdh840/game-world-/blob/main/src/services/firebase.ts) (Firebase Client), [`src/context/AuthContext.tsx`](https://github.com/youssefdh840/game-world-/blob/main/src/context/AuthContext.tsx) (Authentication State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App Experience"]
  node_app["App Shell<br/>[App.tsx]"]
  node_navigation["Navigation<br/>[Navigation.tsx]"]
  node_home["Home<br/>[HomeScreen.tsx]"]
  node_explore["Country Explore<br/>[ExploreScreen.tsx]"]
  node_countrydetail["Country Details"]
  node_playview["Game Selection<br/>[PlayScreen.tsx]"]
end

subgraph group_play["Match &amp; Play"]
  node_matchmodal["Matchmaking UI"]
  node_matchmaking["Matchmaking"]
  node_gameroom["Game Room<br/>[GameRoomScreen.tsx]"]
  node_gameservice["Game Operations<br/>[gameService.ts]"]
  node_questions["Question Service<br/>[questionService.ts]"]
  node_questiondata["Question Catalog<br/>[questionData.ts]"]
end

subgraph group_domain["World &amp; Progression"]
  node_daily["Daily Challenge"]
  node_passport["Passport<br/>[PassportScreen.tsx]"]
  node_profile["Player Profile<br/>[ProfileScreen.tsx]"]
  node_leaderboard["Leaderboards"]
  node_badges["Badge Catalog<br/>[badgesData.ts]"]
  node_admin["Admin Dashboard"]
end

subgraph group_platform["Identity &amp; Data"]
  node_authui["Authentication UI<br/>[AuthModal.tsx]"]
  node_auth["Authentication State<br/>[AuthContext.tsx]"]
  node_users["User &amp; Progress Data<br/>[userService.ts]"]
  node_geo["Geolocation"]
  node_countries["Country Catalog<br/>[countryData.ts]"]
  node_firebase["Firebase Client<br/>[firebase.ts]"]
  node_sound["Sound Effects<br/>[soundEffects.ts]"]
  node_types["Game Domain Types<br/>[game.ts]"]
end

node_player(("Player"))
node_firestore[("Firestore")]

node_player -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"renders"| node_home
node_app -->|"renders"| node_explore
node_app -->|"renders"| node_playview
node_app -->|"renders"| node_passport
node_app -->|"renders"| node_profile
node_app -->|"renders"| node_leaderboard
node_app -->|"renders"| node_navigation
node_app -->|"opens"| node_matchmodal
node_app -->|"opens"| node_daily
node_app -->|"opens"| node_admin
node_app -->|"opens"| node_authui
node_player -->|"authenticates"| node_authui
node_authui -->|"uses auth"| node_auth
node_auth -->|"creates profiles"| node_users
node_auth -->|"authenticates with"| node_firebase
node_explore -->|"opens details"| node_countrydetail
node_explore -->|"reads catalog"| node_countries
node_matchmodal -->|"creates duel"| node_matchmaking
node_matchmaking -->|"fetches questions"| node_questions
node_matchmaking -->|"detects location"| node_geo
node_matchmaking -->|"resolves country"| node_countries
node_matchmaking -->|"manages rooms"| node_firebase
node_gameroom -->|"uses game operations"| node_gameservice
node_gameservice -->|"gets questions"| node_questions
node_gameservice -->|"uses database"| node_firebase
node_questions -->|"uses catalog"| node_questiondata
node_questions -->|"filters by country"| node_countries
node_questions -->|"reads community questions"| node_firebase
node_daily -->|"gets questions"| node_questions
node_daily -->|"updates rewards"| node_users
node_passport -->|"opens details"| node_countrydetail
node_passport -->|"reads catalog"| node_countries
node_app -->|"loads stamps"| node_users
node_profile -->|"reads profile data"| node_users
node_profile -->|"reads badges"| node_badges
node_leaderboard -->|"reads rankings"| node_users
node_admin -->|"uses database"| node_firebase
node_admin -->|"uses question catalog"| node_questiondata
node_users -->|"reads and writes"| node_firebase
node_users -->|"normalizes location"| node_geo
node_firebase -->|"connects"| node_firestore
node_gameroom -->|"plays effects"| node_sound
node_daily -->|"plays effects"| node_sound
node_auth -->|"uses country data"| node_countries
node_auth -->|"detects location"| node_geo

click node_app "https://github.com/youssefdh840/game-world-/blob/main/src/App.tsx"
click node_navigation "https://github.com/youssefdh840/game-world-/blob/main/src/components/Navigation.tsx"
click node_home "https://github.com/youssefdh840/game-world-/blob/main/src/views/HomeScreen.tsx"
click node_explore "https://github.com/youssefdh840/game-world-/blob/main/src/views/ExploreScreen.tsx"
click node_countrydetail "https://github.com/youssefdh840/game-world-/blob/main/src/components/CountryDetailModal.tsx"
click node_playview "https://github.com/youssefdh840/game-world-/blob/main/src/views/PlayScreen.tsx"
click node_matchmodal "https://github.com/youssefdh840/game-world-/blob/main/src/components/MatchmakingModal.tsx"
click node_matchmaking "https://github.com/youssefdh840/game-world-/blob/main/src/services/matchmakingService.ts"
click node_gameroom "https://github.com/youssefdh840/game-world-/blob/main/src/views/GameRoomScreen.tsx"
click node_gameservice "https://github.com/youssefdh840/game-world-/blob/main/src/services/gameService.ts"
click node_questions "https://github.com/youssefdh840/game-world-/blob/main/src/services/questionService.ts"
click node_questiondata "https://github.com/youssefdh840/game-world-/blob/main/src/services/questionData.ts"
click node_daily "https://github.com/youssefdh840/game-world-/blob/main/src/components/DailyChallengeModal.tsx"
click node_passport "https://github.com/youssefdh840/game-world-/blob/main/src/views/PassportScreen.tsx"
click node_profile "https://github.com/youssefdh840/game-world-/blob/main/src/views/ProfileScreen.tsx"
click node_leaderboard "https://github.com/youssefdh840/game-world-/blob/main/src/views/LeaderboardScreen.tsx"
click node_badges "https://github.com/youssefdh840/game-world-/blob/main/src/services/badgesData.ts"
click node_admin "https://github.com/youssefdh840/game-world-/blob/main/src/components/AdminPanelModal.tsx"
click node_authui "https://github.com/youssefdh840/game-world-/blob/main/src/components/AuthModal.tsx"
click node_auth "https://github.com/youssefdh840/game-world-/blob/main/src/context/AuthContext.tsx"
click node_users "https://github.com/youssefdh840/game-world-/blob/main/src/services/userService.ts"
click node_geo "https://github.com/youssefdh840/game-world-/blob/main/src/services/geolocationService.ts"
click node_countries "https://github.com/youssefdh840/game-world-/blob/main/src/services/countryData.ts"
click node_firebase "https://github.com/youssefdh840/game-world-/blob/main/src/services/firebase.ts"
click node_sound "https://github.com/youssefdh840/game-world-/blob/main/src/services/soundEffects.ts"
click node_types "https://github.com/youssefdh840/game-world-/blob/main/src/types/game.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_app,node_navigation,node_home,node_explore,node_countrydetail,node_playview toneBlue
class node_matchmodal,node_matchmaking,node_gameroom,node_gameservice,node_questions,node_questiondata,node_firestore toneAmber
class node_daily,node_passport,node_profile,node_leaderboard,node_badges,node_admin toneMint
class node_authui,node_auth,node_users,node_geo,node_countries,node_firebase,node_sound,node_types toneRose
class node_player toneIndigo
```

## Components

### App Experience

- [App Shell](https://github.com/youssefdh840/game-world-/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation](https://github.com/youssefdh840/game-world-/blob/main/src/components/Navigation.tsx): `src/components/Navigation.tsx`
- [Home](https://github.com/youssefdh840/game-world-/blob/main/src/views/HomeScreen.tsx): `src/views/HomeScreen.tsx`
- [Country Explore](https://github.com/youssefdh840/game-world-/blob/main/src/views/ExploreScreen.tsx): `src/views/ExploreScreen.tsx`
- [Country Details](https://github.com/youssefdh840/game-world-/blob/main/src/components/CountryDetailModal.tsx): `src/components/CountryDetailModal.tsx`
- [Game Selection](https://github.com/youssefdh840/game-world-/blob/main/src/views/PlayScreen.tsx): `src/views/PlayScreen.tsx`

### Match & Play

- [Matchmaking UI](https://github.com/youssefdh840/game-world-/blob/main/src/components/MatchmakingModal.tsx): `src/components/MatchmakingModal.tsx`
- [Matchmaking](https://github.com/youssefdh840/game-world-/blob/main/src/services/matchmakingService.ts): `src/services/matchmakingService.ts`
- [Game Room](https://github.com/youssefdh840/game-world-/blob/main/src/views/GameRoomScreen.tsx): `src/views/GameRoomScreen.tsx`
- [Game Operations](https://github.com/youssefdh840/game-world-/blob/main/src/services/gameService.ts): `src/services/gameService.ts`
- [Question Service](https://github.com/youssefdh840/game-world-/blob/main/src/services/questionService.ts): `src/services/questionService.ts`
- [Question Catalog](https://github.com/youssefdh840/game-world-/blob/main/src/services/questionData.ts): `src/services/questionData.ts`

### World & Progression

- [Daily Challenge](https://github.com/youssefdh840/game-world-/blob/main/src/components/DailyChallengeModal.tsx): `src/components/DailyChallengeModal.tsx`
- [Passport](https://github.com/youssefdh840/game-world-/blob/main/src/views/PassportScreen.tsx): `src/views/PassportScreen.tsx`
- [Player Profile](https://github.com/youssefdh840/game-world-/blob/main/src/views/ProfileScreen.tsx): `src/views/ProfileScreen.tsx`
- [Leaderboards](https://github.com/youssefdh840/game-world-/blob/main/src/views/LeaderboardScreen.tsx): `src/views/LeaderboardScreen.tsx`
- [Badge Catalog](https://github.com/youssefdh840/game-world-/blob/main/src/services/badgesData.ts): `src/services/badgesData.ts`
- [Admin Dashboard](https://github.com/youssefdh840/game-world-/blob/main/src/components/AdminPanelModal.tsx): `src/components/AdminPanelModal.tsx`

### Identity & Data

- [Authentication UI](https://github.com/youssefdh840/game-world-/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Authentication State](https://github.com/youssefdh840/game-world-/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [User & Progress Data](https://github.com/youssefdh840/game-world-/blob/main/src/services/userService.ts): `src/services/userService.ts`
- [Geolocation](https://github.com/youssefdh840/game-world-/blob/main/src/services/geolocationService.ts): `src/services/geolocationService.ts`
- [Country Catalog](https://github.com/youssefdh840/game-world-/blob/main/src/services/countryData.ts): `src/services/countryData.ts`
- [Firebase Client](https://github.com/youssefdh840/game-world-/blob/main/src/services/firebase.ts): `src/services/firebase.ts`
- [Sound Effects](https://github.com/youssefdh840/game-world-/blob/main/src/services/soundEffects.ts): `src/services/soundEffects.ts`
- [Game Domain Types](https://github.com/youssefdh840/game-world-/blob/main/src/types/game.ts): `src/types/game.ts`

### Other components

- **Player**
- **Firestore**

## Connections

- Player → App Shell: opens (evidence: `README.md`)
- App Shell → Authentication State: provides auth (evidence: `src/App.tsx`)
- App Shell → Home: renders (evidence: `src/App.tsx`)
- App Shell → Country Explore: renders (evidence: `src/App.tsx`)
- App Shell → Game Selection: renders (evidence: `src/App.tsx`)
- App Shell → Passport: renders (evidence: `src/App.tsx`)
- App Shell → Player Profile: renders (evidence: `src/App.tsx`)
- App Shell → Leaderboards: renders (evidence: `src/App.tsx`)
- App Shell → Navigation: renders (evidence: `src/App.tsx`)
- App Shell → Matchmaking UI: opens (evidence: `src/App.tsx`)
- App Shell → Daily Challenge: opens (evidence: `src/App.tsx`)
- App Shell → Admin Dashboard: opens (evidence: `src/App.tsx`)
- App Shell → Authentication UI: opens (evidence: `src/App.tsx`)
- Player → Authentication UI: authenticates (evidence: `README.md`)
- Authentication UI → Authentication State: uses auth (evidence: `src/components/AuthModal.tsx`)
- Authentication State → User & Progress Data: creates profiles (evidence: `src/context/AuthContext.tsx`)
- Authentication State → Firebase Client: authenticates with (evidence: `src/context/AuthContext.tsx`)
- Country Explore → Country Details: opens details (evidence: `src/views/ExploreScreen.tsx`)
- Country Explore → Country Catalog: reads catalog (evidence: `src/views/ExploreScreen.tsx`)
- Matchmaking UI → Matchmaking: creates duel (evidence: `src/components/MatchmakingModal.tsx`)
- Matchmaking → Question Service: fetches questions (evidence: `src/services/matchmakingService.ts`)
- Matchmaking → Geolocation: detects location (evidence: `src/services/matchmakingService.ts`)
- Matchmaking → Country Catalog: resolves country (evidence: `src/services/matchmakingService.ts`)
- Matchmaking → Firebase Client: manages rooms (evidence: `src/services/matchmakingService.ts`)
- Game Room → Game Operations: uses game operations (evidence: `src/views/GameRoomScreen.tsx`)
- Game Operations → Question Service: gets questions (evidence: `src/services/gameService.ts`)
- Game Operations → Firebase Client: uses database (evidence: `src/services/gameService.ts`)
- Question Service → Question Catalog: uses catalog (evidence: `src/services/questionService.ts`)
- Question Service → Country Catalog: filters by country (evidence: `src/services/questionService.ts`)
- Question Service → Firebase Client: reads community questions (evidence: `src/services/questionService.ts`)
- Daily Challenge → Question Service: gets questions (evidence: `src/components/DailyChallengeModal.tsx`)
- Daily Challenge → User & Progress Data: updates rewards (evidence: `src/components/DailyChallengeModal.tsx`)
- Passport → Country Details: opens details (evidence: `src/views/PassportScreen.tsx`)
- Passport → Country Catalog: reads catalog (evidence: `src/views/PassportScreen.tsx`)
- App Shell → User & Progress Data: loads stamps (evidence: `src/App.tsx`)
- Player Profile → User & Progress Data: reads profile data (evidence: `src/views/ProfileScreen.tsx`)
- Player Profile → Badge Catalog: reads badges (evidence: `src/views/ProfileScreen.tsx`)
- Leaderboards → User & Progress Data: reads rankings (evidence: `src/views/LeaderboardScreen.tsx`)
- Admin Dashboard → Firebase Client: uses database (evidence: `src/components/AdminPanelModal.tsx`)
- Admin Dashboard → Question Catalog: uses question catalog (evidence: `src/components/AdminPanelModal.tsx`)
- User & Progress Data → Firebase Client: reads and writes (evidence: `src/services/userService.ts`)
- User & Progress Data → Geolocation: normalizes location (evidence: `src/services/userService.ts`)
- Firebase Client → Firestore: connects (evidence: `README.md`)
- Game Room → Sound Effects: plays effects (evidence: `src/views/GameRoomScreen.tsx`)
- Daily Challenge → Sound Effects: plays effects (evidence: `src/components/DailyChallengeModal.tsx`)
- Authentication State → Country Catalog: uses country data (evidence: `src/context/AuthContext.tsx`)
- Authentication State → Geolocation: detects location (evidence: `src/context/AuthContext.tsx`)
