# lokavishal021/codelingo architecture

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

- Interactive diagram: https://gitdiagram.com/lokavishal021/codelingo
- Repository: https://github.com/lokavishal021/codelingo

## Overview

CodeLingo is a browser-based coding-learning app with account sign-in, language courses, interactive lessons, progress tracking, daily challenges, and social/progress views. The main path is to enter through the app, authenticate or continue as a guest, choose a course, complete exercises, and update learning progress. The excerpts confirm routing, authentication and progress persistence, and the daily-challenge flow. Other pages and course-data modules are present in the tree, but their internal connections are not fully shown, so those links are marked unverified or omitted.

Main entry points: [`client/src/App.tsx`](https://github.com/lokavishal021/codelingo/blob/main/client/src/App.tsx) (App shell), [`client/src/lib/game-context.tsx`](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/game-context.tsx) (Game progress), [`client/src/lib/auth-context.tsx`](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/auth-context.tsx) (Auth context), [`client/src/pages/daily-challenge.tsx`](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/daily-challenge.tsx) (Daily challenge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_mount["React mount<br/>[main.tsx]"]
  node_app["App shell<br/>[App.tsx]"]
end

subgraph group_identity["Identity and progress"]
  node_authpage["Sign-in page<br/>[auth-page.tsx]"]
  node_auth["Auth context<br/>[auth-context.tsx]"]
  node_firebase["Firebase access<br/>[firebase.ts]"]
  node_progress["Game progress<br/>[game-context.tsx]"]
  node_name["Name prompt<br/>[name-prompt.tsx]"]
  node_schema["Progress schema<br/>[schema.ts]"]
end

subgraph group_learning["Learning experience"]
  node_course["Course page<br/>[course.tsx]"]
  node_exercise["Exercise runner<br/>[exercise-view.tsx]"]
  node_coursecontent["Course content"]
  node_daily["Daily challenge"]
  node_questions["Daily questions<br/>[daily-questions.ts]"]
  node_practice["Practice page<br/>[practice.tsx]"]
end

subgraph group_engagement["Progress and discovery"]
  node_home["Home dashboard<br/>[home.tsx]"]
  node_dashboard["Dashboard view<br/>[dashboard-view.tsx]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.tsx]"]
  node_profile["Learner profile<br/>[profile.tsx]"]
end

node_learner(("Learner"))
node_storage[("Firestore")]
node_google(("Google sign-in"))

node_learner -->|"opens app"| node_mount
node_mount -->|"renders"| node_app
node_app -->|"shows sign-in"| node_authpage
node_authpage -->|"uses auth"| node_auth
node_auth -->|"authenticates"| node_firebase
node_auth -->|"signs in"| node_google
node_app -->|"provides game state"| node_progress
node_progress -->|"reads user"| node_auth
node_progress -->|"loads and saves"| node_firebase
node_firebase -->|"reads and writes"| node_storage
node_firebase -->|"types progress"| node_schema
node_app -->|"renders prompt"| node_name
node_name -->|"updates display name"| node_progress
node_name -->|"checks user"| node_auth
node_app -->|"routes to course"| node_course
node_app -->|"routes to practice"| node_practice
node_app -->|"routes to leaderboard"| node_leaderboard
node_app -->|"routes to profile"| node_profile
node_app -->|"routes to challenge"| node_daily
node_daily -->|"records completion"| node_progress
node_daily -->|"renders exercise"| node_exercise
node_daily -->|"gets sprint"| node_questions
node_course -.->|"starts lesson"| node_exercise
node_course -.->|"loads curriculum"| node_coursecontent
node_exercise -.->|"records results"| node_progress
node_app -.->|"routes to home"| node_home
node_home -.->|"shows overview"| node_dashboard
node_practice -.->|"offers practice"| node_exercise

click node_mount "https://github.com/lokavishal021/codelingo/blob/main/client/src/main.tsx"
click node_app "https://github.com/lokavishal021/codelingo/blob/main/client/src/App.tsx"
click node_authpage "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/auth-page.tsx"
click node_auth "https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/auth-context.tsx"
click node_firebase "https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/firebase.ts"
click node_progress "https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/game-context.tsx"
click node_name "https://github.com/lokavishal021/codelingo/blob/main/client/src/components/name-prompt.tsx"
click node_schema "https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/schema.ts"
click node_course "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/course.tsx"
click node_exercise "https://github.com/lokavishal021/codelingo/blob/main/client/src/components/exercise-view.tsx"
click node_coursecontent "https://github.com/lokavishal021/codelingo/tree/main/client/src/lib/courses"
click node_daily "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/daily-challenge.tsx"
click node_questions "https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/daily-questions.ts"
click node_practice "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/practice.tsx"
click node_home "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/home.tsx"
click node_dashboard "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/dashboard-view.tsx"
click node_leaderboard "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/leaderboard.tsx"
click node_profile "https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/profile.tsx"

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_mount,node_app toneBlue
class node_authpage,node_auth,node_firebase,node_progress,node_name,node_schema,node_storage toneAmber
class node_course,node_exercise,node_coursecontent,node_daily,node_questions,node_practice toneMint
class node_home,node_dashboard,node_leaderboard,node_profile toneRose
class node_learner,node_google toneIndigo
```

## Components

### App entry

- [React mount](https://github.com/lokavishal021/codelingo/blob/main/client/src/main.tsx): `client/src/main.tsx`
- [App shell](https://github.com/lokavishal021/codelingo/blob/main/client/src/App.tsx): `client/src/App.tsx`

### Identity and progress

- [Sign-in page](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/auth-page.tsx): `client/src/pages/auth-page.tsx`
- [Auth context](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/auth-context.tsx): `client/src/lib/auth-context.tsx`
- [Firebase access](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/firebase.ts): `client/src/lib/firebase.ts`
- [Game progress](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/game-context.tsx): `client/src/lib/game-context.tsx`
- [Name prompt](https://github.com/lokavishal021/codelingo/blob/main/client/src/components/name-prompt.tsx): `client/src/components/name-prompt.tsx`
- [Progress schema](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/schema.ts): `client/src/lib/schema.ts`

### Learning experience

- [Course page](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/course.tsx): `client/src/pages/course.tsx`
- [Exercise runner](https://github.com/lokavishal021/codelingo/blob/main/client/src/components/exercise-view.tsx): `client/src/components/exercise-view.tsx`
- [Course content](https://github.com/lokavishal021/codelingo/tree/main/client/src/lib/courses): `client/src/lib/courses`
- [Daily challenge](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/daily-challenge.tsx): `client/src/pages/daily-challenge.tsx`
- [Daily questions](https://github.com/lokavishal021/codelingo/blob/main/client/src/lib/daily-questions.ts): `client/src/lib/daily-questions.ts`
- [Practice page](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/practice.tsx): `client/src/pages/practice.tsx`

### Progress and discovery

- [Home dashboard](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/home.tsx): `client/src/pages/home.tsx`
- [Dashboard view](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/dashboard-view.tsx): `client/src/pages/dashboard-view.tsx`
- [Leaderboard](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/leaderboard.tsx): `client/src/pages/leaderboard.tsx`
- [Learner profile](https://github.com/lokavishal021/codelingo/blob/main/client/src/pages/profile.tsx): `client/src/pages/profile.tsx`

### Other components

- **Learner**
- **Firestore**
- **Google sign-in**

## Connections

- Learner → React mount: opens app (evidence: `client/src/main.tsx`)
- React mount → App shell: renders (evidence: `client/src/main.tsx`)
- App shell → Sign-in page: shows sign-in (evidence: `client/src/App.tsx`)
- Sign-in page → Auth context: uses auth (evidence: `client/src/pages/auth-page.tsx`)
- Auth context → Firebase access: authenticates (evidence: `client/src/lib/auth-context.tsx`)
- Auth context → Google sign-in: signs in (evidence: `client/src/lib/auth-context.tsx`)
- App shell → Game progress: provides game state (evidence: `client/src/App.tsx`)
- Game progress → Auth context: reads user (evidence: `client/src/lib/game-context.tsx`)
- Game progress → Firebase access: loads and saves (evidence: `client/src/lib/game-context.tsx`)
- Firebase access → Firestore: reads and writes (evidence: `client/src/lib/firebase.ts`)
- Firebase access → Progress schema: types progress (evidence: `client/src/lib/firebase.ts`)
- App shell → Name prompt: renders prompt (evidence: `client/src/App.tsx`)
- Name prompt → Game progress: updates display name (evidence: `client/src/components/name-prompt.tsx`)
- Name prompt → Auth context: checks user (evidence: `client/src/components/name-prompt.tsx`)
- App shell → Course page: routes to course (evidence: `client/src/App.tsx`)
- App shell → Practice page: routes to practice (evidence: `client/src/App.tsx`)
- App shell → Leaderboard: routes to leaderboard (evidence: `client/src/App.tsx`)
- App shell → Learner profile: routes to profile (evidence: `client/src/App.tsx`)
- App shell → Daily challenge: routes to challenge (evidence: `client/src/App.tsx`)
- Daily challenge → Game progress: records completion (evidence: `client/src/pages/daily-challenge.tsx`)
- Daily challenge → Exercise runner: renders exercise (evidence: `client/src/pages/daily-challenge.tsx`)
- Daily challenge → Daily questions: gets sprint (evidence: `client/src/pages/daily-challenge.tsx`)
- Course page → Exercise runner: starts lesson
- Course page → Course content: loads curriculum
- Exercise runner → Game progress: records results
- App shell → Home dashboard: routes to home
- Home dashboard → Dashboard view: shows overview
- Practice page → Exercise runner: offers practice
