From fda731ca0b768b94e275227aa738453762383e47 Mon Sep 17 00:00:00 2001 From: Soundcreates Date: Fri, 29 May 2026 17:37:31 +0530 Subject: [PATCH] feat: add text-based course generation, enhance quiz answer validation, and update infrastructure configuration --- client/src/components/AddCourseModal.tsx | 58 ++++++++++++------ client/src/components/QuizModal.tsx | 77 ++++++++++++++++++------ client/src/pages/Login.tsx | 16 ++--- client/src/pages/Signup.tsx | 16 ++--- client/src/service/baseUrl.ts | 8 ++- client/vite.config.ts | 7 +++ python/app/rag/loaders/youtube.py | 3 +- python/requirements.txt | 16 ++--- server/cmd/server/main.go | 1 + server/db/initDB.go | 54 +++++++++-------- server/db/models/userModel.go | 6 +- server/docker-compose.dev.yml | 31 +++++++++- server/internal/services/authService.go | 2 +- 13 files changed, 197 insertions(+), 98 deletions(-) diff --git a/client/src/components/AddCourseModal.tsx b/client/src/components/AddCourseModal.tsx index 7c4eded..b4d82ad 100755 --- a/client/src/components/AddCourseModal.tsx +++ b/client/src/components/AddCourseModal.tsx @@ -51,6 +51,12 @@ const AddCourseModal: React.FC = ({ onClose, refreshData }) }; }, []); + useEffect(() => { + if (activeTab === "text" && currentStep === 3) { + setCurrentStep(2); + } + }, [activeTab, currentStep]); + useEffect(() => { let isCancelled = false; @@ -190,6 +196,11 @@ const AddCourseModal: React.FC = ({ onClose, refreshData }) return; } + if (activeTab === "text") { + handleSubmit(); + return; + } + setSubmitError(""); setCurrentStep(3); }; @@ -205,8 +216,13 @@ const AddCourseModal: React.FC = ({ onClose, refreshData }) return; } - if (!goalValue.trim()) { - setSubmitError("Please add what you want to achieve from this roadmap."); + const userGoalPayload = activeTab === "text" ? textValue.trim() : goalValue.trim(); + if (!userGoalPayload) { + setSubmitError( + activeTab === "text" + ? "Please enter your topic description." + : "Please add what you want to achieve from this roadmap." + ); return; } @@ -227,7 +243,7 @@ const AddCourseModal: React.FC = ({ onClose, refreshData }) } payload.append("time_query", durationValue.trim()); - payload.append("user_goal", goalValue.trim()); + payload.append("user_goal", userGoalPayload); setIsSubmitting(true); setSubmitError(""); @@ -297,24 +313,26 @@ const AddCourseModal: React.FC = ({ onClose, refreshData }) > Duration - + {activeTab !== "text" && ( + + )} - Step {currentStep} of 3 + Step {currentStep} of {activeTab === "text" ? 2 : 3} @@ -559,7 +577,7 @@ const AddCourseModal: React.FC = ({ onClose, refreshData }) > {currentStep === 1 ? "Cancel" : "Back"} - {currentStep === 3 ? ( + {currentStep === (activeTab === "text" ? 2 : 3) ? (