# code-the-dream-school/summer-26-js-practicum-team2 architecture

> Architecture diagram of the GitHub repository code-the-dream-school/summer-26-js-practicum-team2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/code-the-dream-school/summer-26-js-practicum-team2
- Repository: https://github.com/code-the-dream-school/summer-26-js-practicum-team2

## Overview

Sprout is a gamified money-basics learning app: learners authenticate, choose a learning path, complete short lessons and quizzes, and see progress and rewards. The frontend routes users through learning and account experiences and communicates with an Express REST API; backend controllers coordinate content, progress, quiz results, and reward state. The README documents the REST integration and MongoDB stack. Some route and feature implementations were not sampled, so uncertain links are omitted or marked dashed rather than inferred as direct calls.

Main entry points: [`frontend/src/services/api.js`](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/services/api.js) (API client), [`backend/src/models/UserProgress.model.js`](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/UserProgress.model.js) (User progress), [`frontend/src/app/router/AppRouter.jsx`](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/app/router/AppRouter.jsx) (App routing), [`backend/src/controllers/quiz.controller.js`](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/quiz.controller.js) (Quiz handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Learner experience"]
  node_app_router["App routing<br/>[AppRouter.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_dashboard_page["Dashboard<br/>[DashboardPage.jsx]"]
  node_admin_dashboard["Admin dashboard"]
end

subgraph group_learning["Learning journey"]
  node_learning_path["Learning path"]
  node_learn_page["Lesson experience<br/>[LearnPage.jsx]"]
  node_lesson_flow["Lesson flow"]
  node_lesson_renderer["Lesson renderer"]
  node_quiz_hook["Quiz interaction<br/>[useQuiz.js]"]
  node_lesson_content["Lesson content<br/>[content.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth_context["Auth context<br/>[AuthContext.jsx]"]
  node_auth_hook["Auth actions<br/>[useAuth.js]"]
  node_user_controller["Account handling<br/>[user.controller.js]"]
  node_oauth_routes["OAuth routes<br/>[oauth.routes.js]"]
  node_oauth_service["OAuth user service"]
end

subgraph group_api["Backend API"]
  node_quiz_controller["Quiz handling<br/>[quiz.controller.js]"]
  node_lesson_controller["Lesson handling"]
  node_dashboard_controller["Dashboard assembly"]
  node_admin_controller["Admin operations"]
end

subgraph group_state["Progress and rewards"]
  node_dashboard_data["Dashboard data"]
  node_lesson_store[("Lesson modules")]
  node_progress_store[("User progress")]
  node_quiz_store[("Quiz attempts")]
  node_user_store[("User accounts<br/>[User.model.js]")]
  node_xp_service["XP rewards<br/>[xp.service.js]"]
  node_streak_service["Streak rewards<br/>[streak.service.js]"]
  node_badge_service["Badge rewards<br/>[badge.service.js]"]
end

node_learner(("Learner"))
node_mongo[("MongoDB")]

node_learner -->|"uses"| node_app_router
node_app_router -->|"checks auth"| node_auth_context
node_app_router -->|"routes to"| node_dashboard_page
node_app_router -->|"routes to"| node_learning_path
node_app_router -->|"routes to"| node_learn_page
node_app_router -->|"routes to"| node_admin_dashboard
node_auth_context -->|"uses"| node_auth_hook
node_auth_hook -->|"requests"| node_api_client
node_dashboard_page -.->|"loads data"| node_dashboard_data
node_learning_path -.->|"loads path"| node_api_client
node_learn_page -.->|"renders"| node_lesson_flow
node_lesson_flow -.->|"renders content"| node_lesson_renderer
node_quiz_hook -->|"submits quizzes"| node_api_client
node_api_client -.->|"calls API"| node_lesson_controller
node_api_client -.->|"calls API"| node_quiz_controller
node_api_client -.->|"calls API"| node_dashboard_controller
node_api_client -.->|"calls API"| node_user_controller
node_api_client -.->|"calls API"| node_admin_controller
node_oauth_routes -->|"delegates"| node_oauth_service
node_lesson_controller -->|"loads content"| node_lesson_content
node_lesson_controller -->|"reads modules"| node_lesson_store
node_lesson_controller -->|"updates progress"| node_progress_store
node_lesson_controller -->|"checks attempts"| node_quiz_store
node_quiz_controller -->|"records attempts"| node_quiz_store
node_quiz_controller -->|"updates progress"| node_progress_store
node_quiz_controller -->|"awards XP"| node_xp_service
node_quiz_controller -->|"updates streak"| node_streak_service
node_quiz_controller -->|"awards badges"| node_badge_service
node_dashboard_controller -->|"reads progress"| node_progress_store
node_dashboard_controller -->|"reads attempts"| node_quiz_store
node_dashboard_controller -->|"reads modules"| node_lesson_store
node_dashboard_controller -->|"reads XP"| node_xp_service
node_user_controller -->|"manages accounts"| node_user_store
node_admin_controller -->|"manages users"| node_user_store
node_admin_controller -->|"reads progress"| node_progress_store
node_admin_controller -->|"manages modules"| node_lesson_store
node_xp_service -->|"updates XP"| node_progress_store
node_xp_service -->|"updates totals"| node_user_store
node_streak_service -->|"updates streak"| node_user_store
node_badge_service -->|"stores badges"| node_user_store
node_badge_service -->|"stores badges"| node_progress_store
node_api_client -->|"integrates REST"| node_lesson_controller
node_lesson_store -->|"persists in"| node_mongo
node_progress_store -->|"persists in"| node_mongo
node_quiz_store -->|"persists in"| node_mongo
node_user_store -->|"persists in"| node_mongo

click node_app_router "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/app/router/AppRouter.jsx"
click node_auth_context "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/context/AuthContext.jsx"
click node_auth_hook "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/hooks/useAuth.js"
click node_api_client "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/services/api.js"
click node_dashboard_page "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/DashboardPage.jsx"
click node_dashboard_data "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/hooks/useDashboardData.js"
click node_learning_path "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/LearningPathPage.jsx"
click node_learn_page "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/LearnPage.jsx"
click node_lesson_flow "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/features/learn/LearnFlow/LearnFlow.component.jsx"
click node_lesson_renderer "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/features/learn/Lesson/LessonRenderer/LessonRenderer.component.jsx"
click node_quiz_hook "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/hooks/useQuiz.js"
click node_quiz_controller "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/quiz.controller.js"
click node_lesson_controller "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/lesson.controller.js"
click node_dashboard_controller "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/dashboard.controller.js"
click node_user_controller "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/user.controller.js"
click node_oauth_routes "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/routes/oauth.routes.js"
click node_oauth_service "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/oauthUser.service.js"
click node_admin_dashboard "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/AdminDashboardPage.jsx"
click node_admin_controller "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/admin.controller.js"
click node_lesson_content "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/utils/content.js"
click node_lesson_store "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/LessonModule.model.js"
click node_progress_store "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/UserProgress.model.js"
click node_quiz_store "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/QuizAttempt.model.js"
click node_user_store "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/User.model.js"
click node_xp_service "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/xp.service.js"
click node_streak_service "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/streak.service.js"
click node_badge_service "https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/badge.service.js"

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_router,node_api_client,node_dashboard_page,node_admin_dashboard toneBlue
class node_learning_path,node_learn_page,node_lesson_flow,node_lesson_renderer,node_quiz_hook,node_lesson_content,node_mongo toneAmber
class node_auth_context,node_auth_hook,node_user_controller,node_oauth_routes,node_oauth_service toneMint
class node_quiz_controller,node_lesson_controller,node_dashboard_controller,node_admin_controller toneRose
class node_dashboard_data,node_lesson_store,node_progress_store,node_quiz_store,node_user_store,node_xp_service,node_streak_service,node_badge_service,node_learner toneIndigo
```

## Components

### Learner experience

- [App routing](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/app/router/AppRouter.jsx): `frontend/src/app/router/AppRouter.jsx`
- [API client](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Dashboard](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Admin dashboard](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/AdminDashboardPage.jsx): `frontend/src/pages/AdminDashboardPage.jsx`

### Learning journey

- [Learning path](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/LearningPathPage.jsx): `frontend/src/pages/LearningPathPage.jsx`
- [Lesson experience](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/pages/LearnPage.jsx): `frontend/src/pages/LearnPage.jsx`
- [Lesson flow](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/features/learn/LearnFlow/LearnFlow.component.jsx): `frontend/src/features/learn/LearnFlow/LearnFlow.component.jsx`
- [Lesson renderer](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/features/learn/Lesson/LessonRenderer/LessonRenderer.component.jsx): `frontend/src/features/learn/Lesson/LessonRenderer/LessonRenderer.component.jsx`
- [Quiz interaction](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/hooks/useQuiz.js): `frontend/src/hooks/useQuiz.js`
- [Lesson content](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/utils/content.js): `backend/src/utils/content.js`

### Identity and access

- [Auth context](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Auth actions](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/hooks/useAuth.js): `frontend/src/hooks/useAuth.js`
- [Account handling](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/user.controller.js): `backend/src/controllers/user.controller.js`
- [OAuth routes](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/routes/oauth.routes.js): `backend/src/routes/oauth.routes.js`
- [OAuth user service](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/oauthUser.service.js): `backend/src/services/oauthUser.service.js`

### Backend API

- [Quiz handling](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/quiz.controller.js): `backend/src/controllers/quiz.controller.js`
- [Lesson handling](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/lesson.controller.js): `backend/src/controllers/lesson.controller.js`
- [Dashboard assembly](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/dashboard.controller.js): `backend/src/controllers/dashboard.controller.js`
- [Admin operations](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/controllers/admin.controller.js): `backend/src/controllers/admin.controller.js`

### Progress and rewards

- [Dashboard data](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/frontend/src/hooks/useDashboardData.js): `frontend/src/hooks/useDashboardData.js`
- [Lesson modules](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/LessonModule.model.js): `backend/src/models/LessonModule.model.js`
- [User progress](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/UserProgress.model.js): `backend/src/models/UserProgress.model.js`
- [Quiz attempts](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/QuizAttempt.model.js): `backend/src/models/QuizAttempt.model.js`
- [User accounts](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/models/User.model.js): `backend/src/models/User.model.js`
- [XP rewards](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/xp.service.js): `backend/src/services/xp.service.js`
- [Streak rewards](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/streak.service.js): `backend/src/services/streak.service.js`
- [Badge rewards](https://github.com/code-the-dream-school/summer-26-js-practicum-team2/blob/development/backend/src/services/badge.service.js): `backend/src/services/badge.service.js`

### Other components

- **Learner**
- **MongoDB**

## Connections

- Learner → App routing: uses (evidence: `frontend/src/app/router/AppRouter.jsx`)
- App routing → Auth context: checks auth (evidence: `frontend/src/app/router/AppRouter.jsx`)
- App routing → Dashboard: routes to (evidence: `frontend/src/app/router/AppRouter.jsx`)
- App routing → Learning path: routes to (evidence: `frontend/src/app/router/AppRouter.jsx`)
- App routing → Lesson experience: routes to (evidence: `frontend/src/app/router/AppRouter.jsx`)
- App routing → Admin dashboard: routes to (evidence: `frontend/src/app/router/AppRouter.jsx`)
- Auth context → Auth actions: uses (evidence: `frontend/src/context/AuthContext.jsx`)
- Auth actions → API client: requests (evidence: `frontend/src/hooks/useAuth.js`)
- Dashboard → Dashboard data: loads data
- Learning path → API client: loads path
- Lesson experience → Lesson flow: renders
- Lesson flow → Lesson renderer: renders content
- Quiz interaction → API client: submits quizzes (evidence: `frontend/src/hooks/useQuiz.js`)
- API client → Lesson handling: calls API
- API client → Quiz handling: calls API
- API client → Dashboard assembly: calls API
- API client → Account handling: calls API
- API client → Admin operations: calls API
- OAuth routes → OAuth user service: delegates
- Lesson handling → Lesson content: loads content (evidence: `backend/src/controllers/lesson.controller.js`)
- Lesson handling → Lesson modules: reads modules (evidence: `backend/src/controllers/lesson.controller.js`)
- Lesson handling → User progress: updates progress (evidence: `backend/src/controllers/lesson.controller.js`)
- Lesson handling → Quiz attempts: checks attempts (evidence: `backend/src/controllers/lesson.controller.js`)
- Quiz handling → Quiz attempts: records attempts (evidence: `backend/src/controllers/quiz.controller.js`)
- Quiz handling → User progress: updates progress (evidence: `backend/src/controllers/quiz.controller.js`)
- Quiz handling → XP rewards: awards XP (evidence: `backend/src/controllers/quiz.controller.js`)
- Quiz handling → Streak rewards: updates streak (evidence: `backend/src/controllers/quiz.controller.js`)
- Quiz handling → Badge rewards: awards badges (evidence: `backend/src/controllers/quiz.controller.js`)
- Dashboard assembly → User progress: reads progress (evidence: `backend/src/controllers/dashboard.controller.js`)
- Dashboard assembly → Quiz attempts: reads attempts (evidence: `backend/src/controllers/dashboard.controller.js`)
- Dashboard assembly → Lesson modules: reads modules (evidence: `backend/src/controllers/dashboard.controller.js`)
- Dashboard assembly → XP rewards: reads XP (evidence: `backend/src/controllers/dashboard.controller.js`)
- Account handling → User accounts: manages accounts (evidence: `backend/src/controllers/user.controller.js`)
- Admin operations → User accounts: manages users (evidence: `backend/src/controllers/admin.controller.js`)
- Admin operations → User progress: reads progress (evidence: `backend/src/controllers/admin.controller.js`)
- Admin operations → Lesson modules: manages modules (evidence: `backend/src/controllers/admin.controller.js`)
- XP rewards → User progress: updates XP (evidence: `backend/src/services/xp.service.js`)
- XP rewards → User accounts: updates totals (evidence: `backend/src/services/xp.service.js`)
- Streak rewards → User accounts: updates streak (evidence: `backend/src/services/streak.service.js`)
- Badge rewards → User accounts: stores badges (evidence: `backend/src/services/badge.service.js`)
- Badge rewards → User progress: stores badges (evidence: `backend/src/services/badge.service.js`)
- API client → Lesson handling: integrates REST (evidence: `README.md`)
- Lesson modules → MongoDB: persists in (evidence: `README.md`)
- User progress → MongoDB: persists in (evidence: `README.md`)
- Quiz attempts → MongoDB: persists in (evidence: `README.md`)
- User accounts → MongoDB: persists in (evidence: `README.md`)
