# kaustubh-hub/dsa-query-challenge architecture

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

- Interactive diagram: https://gitdiagram.com/kaustubh-hub/dsa-query-challenge
- Repository: https://github.com/kaustubh-hub/dsa-query-challenge

## Overview

DSA Query Challenge is an offline quiz prototype with two runtimes: a browser experience and a C console application. In the browser, users sign in, choose a topic and difficulty, play a timed question run, then see results and local rankings; they can also explore the DSA Lab and a 3D concept spotlight. The C implementation provides the core challenge and in-memory player/leaderboard behavior. Source excerpts show the browser’s agent generation and scoring, but not every UI handler; README statements support the broader capability map.

Main entry points: [`app.js`](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js) (Challenge interface), [`dsa_query_challenge.c`](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c) (C registration and login), [`agents.js`](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/agents.js) (Question agents), [`visualizer3d.js`](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/visualizer3d.js) (3D structure renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser challenge"]
  node_browser_app["Challenge interface<br/>[app.js]"]
  node_question_agents["Question agents<br/>[agents.js]"]
  node_question_bank["Curated question banks<br/>[agents.js]"]
end

subgraph group_learning["Learning content"]
  node_dsa_lab["DSA Lab<br/>[app.js]"]
  node_spotlight["Concept spotlight<br/>[app.js]"]
  node_visualizer["3D structure renderer<br/>[visualizer3d.js]"]
end

subgraph group_results["Results and state"]
  node_local_rankings[("Local rankings<br/>[app.js]")]
end

subgraph group_c_core["C core"]
  node_c_player_records["In-memory player records"]
  node_c_auth["C registration and login"]
  node_c_question_flow["C question queue"]
  node_c_history["C answer history"]
  node_c_leaderboard["C sorted leaderboard"]
end

node_browser_user(("Player"))
node_console_player(("Console player"))

node_browser_user -->|"uses"| node_browser_app
node_browser_app -->|"requests questions"| node_question_agents
node_question_agents -->|"selects from"| node_question_bank
node_browser_app -->|"saves and reads"| node_local_rankings
node_browser_app -->|"opens"| node_dsa_lab
node_browser_app -->|"shows concept"| node_spotlight
node_browser_app -->|"renders topic"| node_visualizer
node_console_player -->|"registers or logs in"| node_c_auth
node_c_auth -->|"searches players"| node_c_player_records
node_c_auth -->|"starts challenge"| node_c_question_flow
node_c_question_flow -->|"records answers"| node_c_history
node_c_question_flow -.->|"updates results"| node_c_player_records
node_c_player_records -->|"ranks completed runs"| node_c_leaderboard

click node_browser_app "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js"
click node_question_agents "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/agents.js"
click node_question_bank "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/agents.js"
click node_dsa_lab "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js"
click node_spotlight "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js"
click node_visualizer "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/visualizer3d.js"
click node_local_rankings "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js"
click node_c_player_records "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c"
click node_c_auth "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c"
click node_c_question_flow "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c"
click node_c_history "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c"
click node_c_leaderboard "https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c"

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_browser_app,node_question_agents,node_question_bank toneBlue
class node_dsa_lab,node_spotlight,node_visualizer toneAmber
class node_local_rankings toneMint
class node_c_player_records,node_c_auth,node_c_question_flow,node_c_history,node_c_leaderboard toneRose
class node_browser_user,node_console_player toneIndigo
```

## Components

### Browser challenge

- [Challenge interface](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js): `app.js`
- [Question agents](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/agents.js): `agents.js`
- [Curated question banks](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/agents.js): `agents.js`

### Learning content

- [DSA Lab](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js): `app.js`
- [Concept spotlight](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js): `app.js`
- [3D structure renderer](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/visualizer3d.js): `visualizer3d.js`

### Results and state

- [Local rankings](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/app.js): `app.js`

### C core

- [In-memory player records](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c): `dsa_query_challenge.c`
- [C registration and login](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c): `dsa_query_challenge.c`
- [C question queue](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c): `dsa_query_challenge.c`
- [C answer history](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c): `dsa_query_challenge.c`
- [C sorted leaderboard](https://github.com/kaustubh-hub/dsa-query-challenge/blob/main/dsa_query_challenge.c): `dsa_query_challenge.c`

### Other components

- **Player**
- **Console player**

## Connections

- Player → Challenge interface: uses (evidence: `README.md`)
- Challenge interface → Question agents: requests questions (evidence: `app.js`)
- Question agents → Curated question banks: selects from (evidence: `agents.js`)
- Challenge interface → Local rankings: saves and reads (evidence: `app.js`)
- Challenge interface → DSA Lab: opens (evidence: `README.md`)
- Challenge interface → Concept spotlight: shows concept (evidence: `README.md`)
- Challenge interface → 3D structure renderer: renders topic (evidence: `README.md`)
- Console player → C registration and login: registers or logs in (evidence: `dsa_query_challenge.c`)
- C registration and login → In-memory player records: searches players (evidence: `dsa_query_challenge.c`)
- C registration and login → C question queue: starts challenge (evidence: `dsa_query_challenge.c`)
- C question queue → C answer history: records answers (evidence: `README.md`)
- C question queue → In-memory player records: updates results (evidence: `dsa_query_challenge.c`)
- In-memory player records → C sorted leaderboard: ranks completed runs (evidence: `dsa_query_challenge.c`)
