Skip to content

Add HTTP endpoint for weak-topic-detection (GET /weak-topics, JWT-aut… - #107

Merged
Matee-ur-Rehman merged 1 commit into
QuantumLogicsLabs:mainfrom
Matee-ur-Rehman:feature/weak-topic-detection-api
Sep 2, 2026
Merged

Matee-ur-Rehman merged 1 commit into
QuantumLogicsLabs:mainfrom
Matee-ur-Rehman:feature/weak-topic-detection-api

Conversation

@Matee-ur-Rehman

Copy link
Copy Markdown
Collaborator

Overview

Exposes Weak Topic Detection over HTTP so Team Pluto's frontend can call it (previously only usable as internal Python code — no route existed despite the file being named weak_topic_api.py).

What was added
weak_topic_detection/app/main.py (new) — FastAPI app with GET /health and GET /weak-topics
GET /weak-topics requires Authorization: Bearer , reusing the same auth dependency already built for quiz_generator (no duplicated auth logic)
Fixed broken imports across 4 files (from app.... → from weak_topic_detection.app....) — same class of bug found and fixed earlier in quiz_generator
Added pyjwt to requirements.txt (was missing despite being a real dependency)
Known limitation (documented in code)

WeakTopicService currently reads from a static demo dataset (data/quiz_results.json), not live per-user quiz submissions. Auth/user_id is correctly enforced and returned, but results aren't filtered by user yet — that requires real quiz-result ingestion, which is separate follow-up work.

Testing

Verified locally end-to-end: server starts cleanly, /health returns 200 {"status": "ok"} via the interactive /docs page.

Note

Currently tested on port 8003 locally — not yet an officially confirmed port. Needs sign-off before docs/api-contracts.md is updated.

…h'd); fix import paths; add pyjwt to requirements
@Matee-ur-Rehman
Matee-ur-Rehman merged commit 9832f46 into QuantumLogicsLabs:main Sep 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant