From 2ded9e8718dc566196f31d8ee6af1efcdb30505b Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Mon, 6 Jul 2026 15:11:27 +0530 Subject: [PATCH 1/9] fix: add cursor pointer to buttons for better UX --- frontend/src/LandingPage.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/LandingPage.jsx b/frontend/src/LandingPage.jsx index b3aa246..d1729be 100644 --- a/frontend/src/LandingPage.jsx +++ b/frontend/src/LandingPage.jsx @@ -387,7 +387,7 @@ const LandingPage = () => { @@ -404,7 +404,7 @@ const LandingPage = () => { {/* Login – outlined dark button (like opensox "Contribute") */} + + ); + } + + return ( +
+ {/* Level progress */} +
+ {LEVELS.map((_, i) => ( +
+ ))} +
+ + {/* Stats */} +
+ {[["Mistakes", `${mistakes}/3`], ["Remaining", remaining], ["Score", score], ["Time", `${timeLeft}s`]].map(([label, val]) => ( +
+ {label} {val} +
+ ))} +
+ Level {level + 1} / {LEVELS.length} +
+
+ + {/* Timer bar */} + {(phase === "playing" || phase === "preview") && ( +
+
+
+ )} + + {/* Phase label */} +

+ {phase === "preview" ? "Memorise the purple cells…" : phase === "playing" ? "Click all the purple cells!" : ""} +

+ + {/* Grid */} +
+ {grid.map((c, i) => ( +
handleCellClick(i)} + className={`rounded-lg transition-all duration-150 ${cellClass(c)} ${c.clicked ? "cursor-default" : ""}`} + style={{ width: CELL, height: CELL }} + /> + ))} +
+ + {/* Result overlay */} + {(phase === "won" || phase === "lost" || phase === "timeup") && ( +
+
+ {phase === "won" ? (isLast ? "🏆" : "🎉") : phase === "lost" ? "❌" : "⏰"} +
+

+ {phase === "won" + ? isLast ? "All levels complete!" : `Level ${level + 1} complete!` + : phase === "lost" ? "Too many mistakes!" : "Time's up!"} +

+

+ {phase === "won" + ? `Found all ${lvl.colored} cells with ${mistakes} mistake${mistakes !== 1 ? "s" : ""}. Score: ${score}` + : phase === "lost" + ? `You made 3 mistakes on Level ${level + 1}. Study the pattern and try again.` + : `Ran out of time on Level ${level + 1}. ${remaining} cell${remaining !== 1 ? "s" : ""} left to find.`} +

+
+ {phase === "won" && !isLast && ( + + )} + {phase === "won" && isLast && ( + + )} + + {phase !== "won" && ( + + )} +
+
+ )} +
+ ); +}; + +export default GridMemoryGame; diff --git a/frontend/src/components/Layouts/Sidebar.jsx b/frontend/src/components/Layouts/Sidebar.jsx index 1381458..1dcf1ca 100644 --- a/frontend/src/components/Layouts/Sidebar.jsx +++ b/frontend/src/components/Layouts/Sidebar.jsx @@ -27,6 +27,7 @@ import { BookMarked, CalendarDays, ScrollText, + Grid3x3, } from "lucide-react"; const Sidebar = () => { @@ -62,6 +63,19 @@ const Sidebar = () => { }, ], }, + { + id: "cognitive-skills", + title: "Cognitive Skills", + isHeader: true, + items: [ + { + id: "cognitive-games", + title: "Cognitive Games", + path: "/cognitive-games", + icon: Grid3x3, + }, + ], + }, { id: "dsa", title: "DSA", @@ -199,7 +213,7 @@ const Sidebar = () => { ]; const handleServiceClick = (item) => { - if (item.title === "Cognitive Builder" && !user) { + if ((item.title === "Cognitive Builder" || item.title === "Cognitive Games") && !user) { setShowLoginModal(true); } else { navigate(item.path); diff --git a/frontend/src/pages/CognitiveGames/CognitiveGamesPage.jsx b/frontend/src/pages/CognitiveGames/CognitiveGamesPage.jsx new file mode 100644 index 0000000..fcc9dc5 --- /dev/null +++ b/frontend/src/pages/CognitiveGames/CognitiveGamesPage.jsx @@ -0,0 +1,98 @@ +import React, { useState, useContext } from "react"; +import { useNavigate } from "react-router-dom"; +import { UserContext } from "../../context/userContext"; +import GridMemoryGame from "../../components/GridMemoryGame"; +import { Grid3x3 } from "lucide-react"; + +// ─── Games data ──────────────────────────────────────────────────────────────── +// Add more brain-training games here in the future — each just needs a +// name/icon/desc and a matching component rendered below. +const gamesData = [ + { + name: "Grid Memory", + icon: Grid3x3, + desc: "Train spatial recall by memorising and clicking coloured cell patterns.", + component: GridMemoryGame, + }, +]; + +// ─── CognitiveGamesPage ──────────────────────────────────────────────────────── +const CognitiveGamesPage = () => { + const [selectedGame, setSelectedGame] = useState(null); + const { user } = useContext(UserContext); + const navigate = useNavigate(); + + const handleGameClick = (game) => { + if (!user) { navigate("/login"); return; } + setSelectedGame(game); + }; + + const handleBack = () => setSelectedGame(null); + + const ActiveGame = selectedGame?.component; + + return ( +
+
+ + {/* Hero — hidden when a game is selected */} +
+

+ Cognitive Games +

+

+ Sharpen your memory, focus, and spatial recall with quick, playful brain-training games. +

+
+ + {/* Games grid */} + {!selectedGame && ( +
+ {gamesData.map((game) => { + const Icon = game.icon; + return ( + + ); + })} +
+ )} + + {/* Active game header */} + {selectedGame && ( +
+

+ Playing: {selectedGame.name} +

+ +
+ )} + + {/* Active game — inline, no modal */} + {selectedGame && ActiveGame && } +
+
+ ); +}; + +export default CognitiveGamesPage; diff --git a/frontend/src/pages/InterviewPrep/components/PracticePage.jsx b/frontend/src/pages/InterviewPrep/components/PracticePage.jsx index c21a2f9..c1616d7 100644 --- a/frontend/src/pages/InterviewPrep/components/PracticePage.jsx +++ b/frontend/src/pages/InterviewPrep/components/PracticePage.jsx @@ -8,57 +8,17 @@ import axiosInstance from "../../../utils/axiosinstance"; import { API_PATHS } from "../../../utils/apiPaths"; import { BrainCircuit, LineChart, Calculator, Dices, BookOpen, Puzzle } from "lucide-react"; +// ─── Topic data ──────────────────────────────────────────────────────────────── const topicsData = [ - { - name: "Logical Reasoning", - icon: BrainCircuit, - desc: "Test your analytical and logical thinking abilities.", - color: "from-blue-500 to-cyan-500", - bg: "bg-blue-50 dark:bg-blue-900/20", - text: "text-blue-600 dark:text-blue-400" - }, - { - name: "Data Interpretation", - icon: LineChart, - desc: "Analyze and interpret data from charts and graphs.", - color: "from-emerald-500 to-teal-500", - bg: "bg-emerald-50 dark:bg-emerald-900/20", - text: "text-emerald-600 dark:text-emerald-400" - }, - { - name: "Quantitative Aptitude", - icon: Calculator, - desc: "Sharpen your mathematical and numerical calculation skills.", - color: "from-violet-500 to-purple-500", - bg: "bg-violet-50 dark:bg-violet-900/20", - text: "text-violet-600 dark:text-violet-400" - }, - { - name: "Probability", - icon: Dices, - desc: "Master the concepts of chance, odds, and likelihood.", - color: "from-rose-500 to-pink-500", - bg: "bg-rose-50 dark:bg-rose-900/20", - text: "text-rose-600 dark:text-rose-400" - }, - { - name: "Verbal ability", - icon: BookOpen, - desc: "Improve your grammar, vocabulary, and comprehension.", - color: "from-amber-500 to-orange-500", - bg: "bg-amber-50 dark:bg-amber-900/20", - text: "text-amber-600 dark:text-amber-400" - }, - { - name: "Puzzles", - icon: Puzzle, - desc: "Solve complex brain teasers and lateral thinking puzzles.", - color: "from-indigo-500 to-blue-500", - bg: "bg-indigo-50 dark:bg-indigo-900/20", - text: "text-indigo-600 dark:text-indigo-400" - }, + { name: "Logical Reasoning", icon: BrainCircuit, desc: "Test your analytical and logical thinking abilities." }, + { name: "Data Interpretation", icon: LineChart, desc: "Analyze and interpret data from charts and graphs." }, + { name: "Quantitative Aptitude", icon: Calculator, desc: "Sharpen your mathematical and numerical calculation skills." }, + { name: "Probability", icon: Dices, desc: "Master the concepts of chance, odds, and likelihood." }, + { name: "Verbal ability", icon: BookOpen, desc: "Improve your grammar, vocabulary, and comprehension." }, + { name: "Puzzles", icon: Puzzle, desc: "Solve complex brain teasers and lateral thinking puzzles." }, ]; +// ─── PracticePage ────────────────────────────────────────────────────────────── const PracticePage = () => { const [selectedTopic, setSelectedTopic] = useState(null); const [questions, setQuestions] = useState([]); @@ -67,137 +27,111 @@ const PracticePage = () => { const navigate = useNavigate(); const handleTopicClick = async (topic) => { - if (!user) { - navigate("/login"); - return; - } - if (topic === "Career Specific Roadmap") { - navigate("/dashboard"); - return; - } + if (!user) { navigate("/login"); return; } setSelectedTopic(topic); setLoading(true); setQuestions([]); - try { - const res = await axiosInstance.get( - `${API_PATHS.APTITUDE.GENERATE}?topic=${topic}` - ); + const res = await axiosInstance.get(`${API_PATHS.APTITUDE.GENERATE}?topic=${topic.name}`); setQuestions(res.data); } catch (error) { console.error("Error fetching questions:", error); alert("Failed to generate questions."); } - setLoading(false); }; + const handleBack = () => { setSelectedTopic(null); setQuestions([]); }; + return ( - <> -
-
-
-

- Practice Cognitive Skills +
+
+ + {/* Hero — hidden when a topic is selected */} +
+

+ Practice Cognitive Skills +

+

+ Sharpen your logical reasoning, quantitative, and verbal skills with curated aptitude tests and exercises. +

+
+ + {/* Topics grid */} + {!selectedTopic && ( +
+ {topicsData.map((topic) => { + const Icon = topic.icon; + return ( + + ); + })} +
+ )} + + {/* Active topic header */} + {selectedTopic && ( +
+

+ Practicing: {selectedTopic.name}

-

- Sharpen your logical reasoning, quantitative, and verbal skills - with curated aptitude tests and exercises. -

+
+ )} - {/* Topics Grid */} - {!selectedTopic && ( -
- {topicsData.map((topic) => { - const Icon = topic.icon; - return ( - - ); - })} + {/* Quiz loading & questions */} + {loading && } + {questions.length > 0 && ( + <> +
+ {questions.map((q, idx) => ( + + ))}
- )} - - {/* Active Quiz Header */} - {selectedTopic && ( -
-

- Practicing: {selectedTopic} -

+
- )} - - {/* Loading */} - {loading && } - - {/* Questions */} - {questions.length > 0 && ( - <> -
- {questions.map((q, idx) => ( - - ))} -
- - {/* Load More */} -
- -
- - )} -
-
- + + )} +

+
); }; diff --git a/frontend/src/pages/OpenSource/OSSBlog.jsx b/frontend/src/pages/OpenSource/OSSBlog.jsx index e784a7f..485e41f 100644 --- a/frontend/src/pages/OpenSource/OSSBlog.jsx +++ b/frontend/src/pages/OpenSource/OSSBlog.jsx @@ -17,6 +17,25 @@ const OSSBlog = () => { const [error, setError] = useState(""); const [searchQuery, setSearchQuery] = useState(""); const [filteredArticles, setFilteredArticles] = useState([]); + const [showScrollTop, setShowScrollTop] = useState(false); + const scrollRef = React.useRef(null); + useEffect(() => { + const el = scrollRef.current; + + const handleScroll = () => { + setShowScrollTop(el.scrollTop > 100); + }; + + el.addEventListener("scroll", handleScroll); + return () => el.removeEventListener("scroll", handleScroll); +}, []); +const scrollToTop = () => { + scrollRef.current.scrollTo({ + top: 0, + behavior: "smooth", + }); +}; + useEffect(() => { fetchArticles(); @@ -86,7 +105,29 @@ const OSSBlog = () => { }; return ( -
+
+ {showScrollTop && ( + + )}
{/* Header */} { const [searchQuery, setSearchQuery] = useState(""); const [monthFilter, setMonthFilter] = useState("all"); const [modeFilter, setModeFilter] = useState("all"); + const [showScrollTop, setShowScrollTop] = useState(false); + const scrollRef = useRef(null); + useEffect(() => { + const el = scrollRef.current; + if (!el) return; + + const handleScroll = () => { + setShowScrollTop(el.scrollTop > 200); + }; + + el.addEventListener("scroll", handleScroll); + return () => el.removeEventListener("scroll", handleScroll); + }, []); + const scrollToTop = () => { + scrollRef.current?.scrollTo({ top: 0, behavior: "smooth" }); + }; + + useEffect(() => { const fetchEvents = async () => { setLoading(true); @@ -261,7 +279,33 @@ const OpenSourceEvents = () => { ]; return ( -
+
+ {showScrollTop && ( + + )}
Date: Mon, 6 Jul 2026 15:35:13 +0530 Subject: [PATCH 3/9] feat: implement signup modal and update button actions on LandingPage --- frontend/src/LandingPage.jsx | 49 +++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/frontend/src/LandingPage.jsx b/frontend/src/LandingPage.jsx index d1729be..2147b9d 100644 --- a/frontend/src/LandingPage.jsx +++ b/frontend/src/LandingPage.jsx @@ -242,6 +242,7 @@ const LandingPage = () => { const [pendingRoute, setPendingRoute] = useState(null); const [activeStep, setActiveStep] = useState(1); const [showScrollTop, setShowScrollTop] = useState(false); + const [openSignupModal, setOpenSignupModal] = useState(false); const [visibleCards, setVisibleCards] = useState(3); const [currentIndex, setCurrentIndex] = useState(0); @@ -305,6 +306,14 @@ const LandingPage = () => { } }; + const handleSignup = () => { + if (!user) { + setOpenSignupModal(true); + } else { + navigate("/dashboard"); + } + }; + const navRoutes = [ { label: "AI-Assistance", route: "/ai-helper" }, { label: "Cognitive Skills", route: "/practice" }, @@ -321,6 +330,7 @@ const LandingPage = () => { navigate(route); } }; + useEffect(() => { const handleScroll = () => { setShowScrollTop(window.scrollY > 300); @@ -415,7 +425,7 @@ const LandingPage = () => { {/* Get Started – solid violet pill */}
+ + { + setOpenSignupModal(false); + setPendingRoute(null); + }} + hideHeader + > +
+
+ { + setOpenAuthModal(false); + + if (pendingRoute) { + navigate(pendingRoute); + setPendingRoute(null); + } else { + navigate("/dashboard"); + } + }} + /> +
+ +
+ +
+
+
); }; From af2f773ee5aa81f98dc9345f222b6667722d99ae Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Tue, 7 Jul 2026 15:14:01 +0530 Subject: [PATCH 4/9] fix: update README to reflect latest backend folder structure and input validators --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ea92f02..7ac7fe1 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,15 @@ PrepPilot/ │ │ ├── resumeController.js # Resume operations │ │ ├── sessionController.js # Session management │ │ └── userSheetProgressController.js # Progress tracking +| | +│ ├── 📂 Input_Validators/ # Extract the logic for Input validations +│ │ ├── ValidateAchievement.js # Validate and check input for Achievement Controller +│ │ ├── ValidateAi.js # Validate and check input for Ai/Gemini Controller +│ │ ├── ValidateAuth.js # Validate and check input for Authentication Controller +│ │ ├── ValidateQuestions.js # Validate and check input for Question Management Controller +│ │ ├── ValidateResume.js # Validate and check input for Resume Controller +│ │ ├── ValidateSession.js # Validate and check input for Session Controller Controller +│ │ └── ValidateUserSheetProgess.js # Validate and check input for UserSheetProgress Controller │ │ │ ├── 📂 middlewares/ # Express middlewares │ │ ├── authMiddleware.js # JWT verification From 33c92b14ea2eab62e3d0fa383cb00de312d69662 Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Tue, 7 Jul 2026 15:23:42 +0530 Subject: [PATCH 5/9] fix: update README to include new controllers in backend folder structure --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ac7fe1..5aa99a3 100644 --- a/README.md +++ b/README.md @@ -214,11 +214,13 @@ docker-compose up --build ``` PrepPilot/ │ -├── 📂 backend/ # Express.js REST API Server +├── 📂 backend/ # Express.js REST API Server │ ├── 📂 config/ # Database & environment configuration │ ├── 📂 controllers/ # Business logic & request handlers │ │ ├── aiController.js # AI/Gemini API integration │ │ ├── authController.js # Authentication logic +| | ├── achievementController.js # Achievement logic +| | ├── jobController.js # Job Adzuna Logic │ │ ├── questionController.js # Question management │ │ ├── resumeController.js # Resume operations │ │ ├── sessionController.js # Session management From 5bcdfb2befcd70d7f3fb590182e4b00997814b14 Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Thu, 9 Jul 2026 13:18:49 +0530 Subject: [PATCH 6/9] Revert "fix: update README to include new controllers in backend folder structure" This reverts commit 33c92b14ea2eab62e3d0fa383cb00de312d69662. solving pr issue --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5aa99a3..7ac7fe1 100644 --- a/README.md +++ b/README.md @@ -214,13 +214,11 @@ docker-compose up --build ``` PrepPilot/ │ -├── 📂 backend/ # Express.js REST API Server +├── 📂 backend/ # Express.js REST API Server │ ├── 📂 config/ # Database & environment configuration │ ├── 📂 controllers/ # Business logic & request handlers │ │ ├── aiController.js # AI/Gemini API integration │ │ ├── authController.js # Authentication logic -| | ├── achievementController.js # Achievement logic -| | ├── jobController.js # Job Adzuna Logic │ │ ├── questionController.js # Question management │ │ ├── resumeController.js # Resume operations │ │ ├── sessionController.js # Session management From ac8a2155c6c4d967962d2e32c19a2f5abe41a103 Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Thu, 9 Jul 2026 13:20:22 +0530 Subject: [PATCH 7/9] Reapply "fix: update README to include new controllers in backend folder structure" This reverts commit 5bcdfb2befcd70d7f3fb590182e4b00997814b14. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ac7fe1..5aa99a3 100644 --- a/README.md +++ b/README.md @@ -214,11 +214,13 @@ docker-compose up --build ``` PrepPilot/ │ -├── 📂 backend/ # Express.js REST API Server +├── 📂 backend/ # Express.js REST API Server │ ├── 📂 config/ # Database & environment configuration │ ├── 📂 controllers/ # Business logic & request handlers │ │ ├── aiController.js # AI/Gemini API integration │ │ ├── authController.js # Authentication logic +| | ├── achievementController.js # Achievement logic +| | ├── jobController.js # Job Adzuna Logic │ │ ├── questionController.js # Question management │ │ ├── resumeController.js # Resume operations │ │ ├── sessionController.js # Session management From 1e2243b29c7769b1a17360d8edd1806b64cfc4ed Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Thu, 9 Jul 2026 13:21:06 +0530 Subject: [PATCH 8/9] Revert "feat: implement signup modal and update button actions on LandingPage" This reverts commit ac7c7c3fed4c79c857ca31fbe21ce744b796bcb9. --- frontend/src/LandingPage.jsx | 49 +++--------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/frontend/src/LandingPage.jsx b/frontend/src/LandingPage.jsx index 2147b9d..d1729be 100644 --- a/frontend/src/LandingPage.jsx +++ b/frontend/src/LandingPage.jsx @@ -242,7 +242,6 @@ const LandingPage = () => { const [pendingRoute, setPendingRoute] = useState(null); const [activeStep, setActiveStep] = useState(1); const [showScrollTop, setShowScrollTop] = useState(false); - const [openSignupModal, setOpenSignupModal] = useState(false); const [visibleCards, setVisibleCards] = useState(3); const [currentIndex, setCurrentIndex] = useState(0); @@ -306,14 +305,6 @@ const LandingPage = () => { } }; - const handleSignup = () => { - if (!user) { - setOpenSignupModal(true); - } else { - navigate("/dashboard"); - } - }; - const navRoutes = [ { label: "AI-Assistance", route: "/ai-helper" }, { label: "Cognitive Skills", route: "/practice" }, @@ -330,7 +321,6 @@ const LandingPage = () => { navigate(route); } }; - useEffect(() => { const handleScroll = () => { setShowScrollTop(window.scrollY > 300); @@ -425,7 +415,7 @@ const LandingPage = () => { {/* Get Started – solid violet pill */}
- - { - setOpenSignupModal(false); - setPendingRoute(null); - }} - hideHeader - > -
-
- { - setOpenAuthModal(false); - - if (pendingRoute) { - navigate(pendingRoute); - setPendingRoute(null); - } else { - navigate("/dashboard"); - } - }} - /> -
- -
- -
-
-
); }; From 843fd67d85c1c2fb60af4ea3dfa89cbd4d476da5 Mon Sep 17 00:00:00 2001 From: anandayush005 Date: Thu, 9 Jul 2026 13:27:34 +0530 Subject: [PATCH 9/9] Revert "fix: add cursor pointer to buttons for better UX" This reverts commit 2ded9e8718dc566196f31d8ee6af1efcdb30505b. --- frontend/src/LandingPage.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/LandingPage.jsx b/frontend/src/LandingPage.jsx index d1729be..b3aa246 100644 --- a/frontend/src/LandingPage.jsx +++ b/frontend/src/LandingPage.jsx @@ -387,7 +387,7 @@ const LandingPage = () => { @@ -404,7 +404,7 @@ const LandingPage = () => { {/* Login – outlined dark button (like opensox "Contribute") */}