Skip to content

feat: Add AI Doubt Solver and 30-Day Python Challenge Tracker - #17

Open
Hemasri0405 wants to merge 1 commit into
vicharanashala:mainfrom
Hemasri0405:feature/ai-doubt-solver-and-challenge-tracker
Open

feat: Add AI Doubt Solver and 30-Day Python Challenge Tracker#17
Hemasri0405 wants to merge 1 commit into
vicharanashala:mainfrom
Hemasri0405:feature/ai-doubt-solver-and-challenge-tracker

Conversation

@Hemasri0405

Copy link
Copy Markdown

Summary

This PR introduces two new learning features to the PyBe platform:

  • AI-powered Doubt Solver — Paste Python code and get beginner-friendly error explanations
  • 30-Day Python Challenge — Progressive coding challenges with progress tracking and badges

Features Added

AI Doubt Solver (/doubts)

  • Paste Python code into a large text area
  • Optional question field for specific concerns
  • Explain My Error button triggers analysis
  • Detects syntax errors (mismatched brackets, missing colons, unclosed strings) and logical errors (infinite loops, undefined variables, assignment vs comparison)
  • Card layout with sections: Error Found, Simple Explanation, Hint, Corrected Code, Learn More
  • Full doubt history with reload and delete
  • Error handling for empty input and API failures

30-Day Python Challenge (/challenge)

  • 30 challenges (Days 1–30: Easy → Medium → Hard)
  • Day selector grid with difficulty color coding
  • Problem statement, example input/output, hint button per challenge
  • Solution text area and Mark as Completed button
  • Progress tracking: completed days, daily streak, percentage
  • Badge system: Beginner (1), Consistent Learner (7), Python Explorer (15), Challenge Master (30)
  • Progress persisted in backend db.json

Backend Changes

New Routes

Method Endpoint Description
POST /api/doubts Analyze Python code
GET /api/doubts List doubt history
DELETE /api/doubts/:id Delete a doubt entry
GET /api/challenges List all 30 challenges
GET /api/challenges/progress Get completion progress
POST /api/challenges/:day/complete Mark a day as completed

New Files

  • server/src/services/doubtSolver.js — Rule-based Python code analyzer
  • server/src/data/challenges.js — 30 challenge definitions
  • server/src/routes/doubts.js — Doubt solver API routes
  • server/src/routes/challenges.js — Challenge tracker API routes

Updated Files

  • server/src/index.js — Registered new routes
  • server/src/data/store.js — Added doubt/challenge CRUD operations

Frontend Changes

New Files

  • client/src/pages/DoubtSolver.jsx — Doubt Solver page
  • client/src/pages/PythonChallenge.jsx — Challenge page

Updated Files

  • client/src/main.jsx — Added react-router-dom routing + navbar
  • client/src/styles.css — Added responsive styles for new pages
  • client/package.json — Added react-router-dom dependency

Testing

  • All 6 new API endpoints verified
  • Frontend production build passes (vite build)
  • Progress tracking verified
  • Doubt history CRUD verified
  • Responsive layouts tested at 1050px and 640px breakpoints

Add two new learning features to the PyBe platform:

AI Doubt Solver (/doubts):
- Submit Python code for syntax/logical error analysis
- Beginner-friendly error explanations with hints
- Corrected code suggestions
- Related concept recommendations
- Full history with delete support

30-Day Python Challenge (/challenge):
- 30 progressive challenges (Easy/Medium/Hard)
- Day selector with difficulty color coding
- Progress tracking with streak counter
- Badge system (Beginner, Consistent Learner, Explorer, Master)
- Persistent backend storage in db.json

Backend:
- New routes: doubts, challenges
- New service: doubtSolver (rule-based Python analyzer)
- Updated store.js with doubt/challenge CRUD operations

Frontend:
- Added react-router-dom for page routing
- Navbar with Learn / Doubt Solver / Challenge navigation
- DoubtSolver and PythonChallenge pages
- Updated styles.css with responsive layouts
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