# crf1810/codequestpoo architecture

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

- Interactive diagram: https://gitdiagram.com/crf1810/codequestpoo
- Repository: https://github.com/crf1810/codequestpoo

## Overview

CodeQuest is a gamified programming-learning application: learners enter through account and dashboard pages, select maps and challenges, execute Python exercises, receive feedback, and accumulate progress. Its backend provides authentication, challenge and learner APIs, research-session tracking, and supporting social, reporting, and administration capabilities. The tree establishes those product areas, while sampled source confirms the exercise execution and research-event path. Many backend modules and frontend pages were not sampled, so their internal call relationships are not asserted here.

Main entry points: [`Frontend-CodeQuestPOO/src/main.jsx`](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/main.jsx) (App routes), [`Backend-CodeQuestPOO/src/Models`](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Models) (Domain models), [`Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js`](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js) (Code execution flow), [`Frontend-CodeQuestPOO/src/Services/api/axios.js`](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/api/axios.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_app["App routes<br/>[main.jsx]"]
  node_accounts["Account pages<br/>[criarConta.jsx]"]
  node_dashboard["Learning dashboard<br/>[dashBoard.jsx]"]
  node_profile["Profile and rewards<br/>[Perfil.jsx]"]
  node_leaderboard["Leaderboard<br/>[leaderBoard.jsx]"]
end

subgraph group_gameplay["Challenge gameplay"]
  node_maps["Learning maps"]
  node_challenge["Challenge interface<br/>[CodeComponent.jsx]"]
  node_codehook["Code execution flow<br/>[useCode.js]"]
  node_python["Python runtime<br/>[pyodideEngine.js]"]
  node_feedback["AI feedback"]
  node_metrics["Research metrics client"]
end

subgraph group_backend["Backend services"]
  node_api["API client<br/>[axios.js]"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_learnerapi["Learner management"]
  node_challenges["Challenge services"]
  node_progress["Progress and performance"]
  node_research["Research event API<br/>[research.routes.ts]"]
  node_support["Social and reporting"]
  node_admin["Administration"]
end

subgraph group_data["Persistence and integrations"]
  node_models["Domain models"]
  node_database[("Relational database<br/>[sequelize.ts]")]
  node_storage["Session storage<br/>[authStorage.js]"]
end

node_learner(("Learner"))
node_external{{"Backend API"}}

node_learner -->|"opens"| node_app
node_app -->|"routes to"| node_accounts
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_leaderboard
node_app -->|"routes to"| node_maps
node_maps -.->|"presents"| node_challenge
node_challenge -.->|"uses"| node_codehook
node_codehook -->|"loads runtime"| node_python
node_codehook -->|"requests feedback"| node_feedback
node_codehook -->|"records events"| node_metrics
node_metrics -->|"posts events"| node_api
node_api -->|"reads token"| node_storage
node_api -->|"sends requests"| node_external
node_external -->|"routes research calls"| node_research
node_research -->|"reads and writes"| node_models
node_auth -->|"reads and writes"| node_models
node_auth -.->|"persists sessions"| node_database
node_learnerapi -->|"uses models"| node_models
node_challenges -.->|"uses models"| node_models
node_progress -.->|"uses models"| node_models

click node_app "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/main.jsx"
click node_accounts "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/Auth/criarConta.jsx"
click node_dashboard "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/UserPage/dashBoard.jsx"
click node_profile "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/UserPage/Perfil.jsx"
click node_leaderboard "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/UserPage/leaderBoard.jsx"
click node_maps "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Mapas/FlorestaDosAlgoritmos-Mapa1/FlorestaDosAlgoritmos.jsx"
click node_challenge "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Components/Code/CodeComponent.jsx"
click node_codehook "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js"
click node_python "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Python/pyodideEngine.js"
click node_feedback "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/gameplay/feedbackAiService.js"
click node_metrics "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/gameplay/researchMetricsService.js"
click node_api "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/api/axios.js"
click node_auth "https://github.com/crf1810/codequestpoo/blob/main/Backend-CodeQuestPOO/src/Modules/auth/auth.service.ts"
click node_learnerapi "https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/alunos"
click node_challenges "https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/desafio"
click node_progress "https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/progressao"
click node_research "https://github.com/crf1810/codequestpoo/blob/main/Backend-CodeQuestPOO/src/Modules/research/research.routes.ts"
click node_support "https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules"
click node_admin "https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/admin"
click node_models "https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Models"
click node_database "https://github.com/crf1810/codequestpoo/blob/main/Backend-CodeQuestPOO/src/Config/sequelize.ts"
click node_storage "https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/auth/authStorage.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,node_accounts,node_dashboard,node_profile,node_leaderboard toneBlue
class node_maps,node_challenge,node_codehook,node_python,node_feedback,node_metrics toneAmber
class node_api,node_auth,node_learnerapi,node_challenges,node_progress,node_research,node_support,node_admin,node_external toneMint
class node_models,node_database,node_storage toneRose
class node_learner toneIndigo
```

## Components

### Learner experience

- [App routes](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/main.jsx): `Frontend-CodeQuestPOO/src/main.jsx`
- [Account pages](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/Auth/criarConta.jsx): `Frontend-CodeQuestPOO/src/Pages/Auth/criarConta.jsx`
- [Learning dashboard](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/UserPage/dashBoard.jsx): `Frontend-CodeQuestPOO/src/Pages/UserPage/dashBoard.jsx`
- [Profile and rewards](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/UserPage/Perfil.jsx): `Frontend-CodeQuestPOO/src/Pages/UserPage/Perfil.jsx`
- [Leaderboard](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Pages/UserPage/leaderBoard.jsx): `Frontend-CodeQuestPOO/src/Pages/UserPage/leaderBoard.jsx`

### Challenge gameplay

- [Learning maps](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Mapas/FlorestaDosAlgoritmos-Mapa1/FlorestaDosAlgoritmos.jsx): `Frontend-CodeQuestPOO/src/Game/Mapas/FlorestaDosAlgoritmos-Mapa1/FlorestaDosAlgoritmos.jsx`
- [Challenge interface](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Components/Code/CodeComponent.jsx): `Frontend-CodeQuestPOO/src/Game/Components/Code/CodeComponent.jsx`
- [Code execution flow](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js): `Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js`
- [Python runtime](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Python/pyodideEngine.js): `Frontend-CodeQuestPOO/src/Python/pyodideEngine.js`
- [AI feedback](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/gameplay/feedbackAiService.js): `Frontend-CodeQuestPOO/src/Services/gameplay/feedbackAiService.js`
- [Research metrics client](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/gameplay/researchMetricsService.js): `Frontend-CodeQuestPOO/src/Services/gameplay/researchMetricsService.js`

### Backend services

- [API client](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/api/axios.js): `Frontend-CodeQuestPOO/src/Services/api/axios.js`
- [Authentication](https://github.com/crf1810/codequestpoo/blob/main/Backend-CodeQuestPOO/src/Modules/auth/auth.service.ts): `Backend-CodeQuestPOO/src/Modules/auth/auth.service.ts`
- [Learner management](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/alunos): `Backend-CodeQuestPOO/src/Modules/alunos`
- [Challenge services](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/desafio): `Backend-CodeQuestPOO/src/Modules/desafio`
- [Progress and performance](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/progressao): `Backend-CodeQuestPOO/src/Modules/progressao`
- [Research event API](https://github.com/crf1810/codequestpoo/blob/main/Backend-CodeQuestPOO/src/Modules/research/research.routes.ts): `Backend-CodeQuestPOO/src/Modules/research/research.routes.ts`
- [Social and reporting](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules): `Backend-CodeQuestPOO/src/Modules`
- [Administration](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Modules/admin): `Backend-CodeQuestPOO/src/Modules/admin`

### Persistence and integrations

- [Domain models](https://github.com/crf1810/codequestpoo/tree/main/Backend-CodeQuestPOO/src/Models): `Backend-CodeQuestPOO/src/Models`
- [Relational database](https://github.com/crf1810/codequestpoo/blob/main/Backend-CodeQuestPOO/src/Config/sequelize.ts): `Backend-CodeQuestPOO/src/Config/sequelize.ts`
- [Session storage](https://github.com/crf1810/codequestpoo/blob/main/Frontend-CodeQuestPOO/src/Services/auth/authStorage.js): `Frontend-CodeQuestPOO/src/Services/auth/authStorage.js`

### Other components

- **Learner**
- **Backend API**

## Connections

- Learner → App routes: opens (evidence: `Frontend-CodeQuestPOO/src/main.jsx`)
- App routes → Account pages: routes to (evidence: `Frontend-CodeQuestPOO/src/main.jsx`)
- App routes → Learning dashboard: routes to (evidence: `Frontend-CodeQuestPOO/src/main.jsx`)
- App routes → Profile and rewards: routes to (evidence: `Frontend-CodeQuestPOO/src/main.jsx`)
- App routes → Leaderboard: routes to (evidence: `Frontend-CodeQuestPOO/src/main.jsx`)
- App routes → Learning maps: routes to (evidence: `Frontend-CodeQuestPOO/src/main.jsx`)
- Learning maps → Challenge interface: presents
- Challenge interface → Code execution flow: uses
- Code execution flow → Python runtime: loads runtime (evidence: `Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js`)
- Code execution flow → AI feedback: requests feedback (evidence: `Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js`)
- Code execution flow → Research metrics client: records events (evidence: `Frontend-CodeQuestPOO/src/Game/Hooks/useCode.js`)
- Research metrics client → API client: posts events (evidence: `Frontend-CodeQuestPOO/src/Services/gameplay/researchMetricsService.js`)
- API client → Session storage: reads token (evidence: `Frontend-CodeQuestPOO/src/Services/api/axios.js`)
- API client → Backend API: sends requests (evidence: `Frontend-CodeQuestPOO/src/Services/api/axios.js`)
- Backend API → Research event API: routes research calls (evidence: `Backend-CodeQuestPOO/src/Modules/research/research.routes.ts`)
- Research event API → Domain models: reads and writes (evidence: `Backend-CodeQuestPOO/src/Modules/research/research.routes.ts`)
- Authentication → Domain models: reads and writes (evidence: `Backend-CodeQuestPOO/src/Modules/auth/auth.service.ts`)
- Authentication → Relational database: persists sessions
- Learner management → Domain models: uses models (evidence: `Backend-CodeQuestPOO/src/Modules/alunos/alunos.service.ts`)
- Challenge services → Domain models: uses models (evidence: `Backend-CodeQuestPOO/src/Modules/desafio/desafio.service.ts`)
- Progress and performance → Domain models: uses models
