From 2b488aed4812925c15364b6e133f6b242311140c Mon Sep 17 00:00:00 2001 From: Mahek Gupta Date: Thu, 26 Feb 2026 20:02:33 +0530 Subject: [PATCH 1/4] feat: improve landing page with how-it-works section and strong CTA --- eduaid_web/src/pages/Home.jsx | 124 ++++++++++++++++++++++++++-------- 1 file changed, 96 insertions(+), 28 deletions(-) diff --git a/eduaid_web/src/pages/Home.jsx b/eduaid_web/src/pages/Home.jsx index e00a0d23..f882191f 100644 --- a/eduaid_web/src/pages/Home.jsx +++ b/eduaid_web/src/pages/Home.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import "../index.css"; -import logo_trans from "../assets/aossie_logo_transparent.png" +import logo_trans from "../assets/aossie_logo_transparent.png"; import starsImg from "../assets/stars.png"; import arrow from "../assets/arrow.png"; import gitStar from "../assets/gitStar.png"; @@ -12,7 +12,9 @@ const Home = () => { const [error, setError] = useState(""); async function fetchGitHubStars() { - const response = await fetch("https://api.github.com/repos/AOSSIE-Org/EduAid"); + const response = await fetch( + "https://api.github.com/repos/AOSSIE-Org/EduAid" + ); if (!response.ok) throw new Error("Failed to fetch stars"); const data = await response.json(); return data.stargazers_count; @@ -27,7 +29,11 @@ const Home = () => { const storedStars = localStorage.getItem("stars"); const storedTime = localStorage.getItem("fetchTime"); - if (storedStars && storedTime && !isMoreThanOneDayOld(parseInt(storedTime))) { + if ( + storedStars && + storedTime && + !isMoreThanOneDayOld(parseInt(storedTime)) + ) { setStars(parseInt(storedStars)); } else { fetchGitHubStars() @@ -41,10 +47,11 @@ const Home = () => { }, []); return ( -
+
-
- logo +
+ {/* Logo */} + logo {/* Heading */}

@@ -56,54 +63,115 @@ const Home = () => {

- {/* Subtitle */} -
-

A tool that can auto-generate short quizzes

-
-

based on user input

- stars -
+ {/* Improved Subtitle */} +
+

+ Turn your notes into interactive quizzes in seconds. +

+

+ Upload your PDF or DOC file and start practicing instantly. +

- {/* Features */} -
+ {/* Feature Highlights */} +
{[ - "Doc/Audio Input", - "In-depth questions gen", - "Dynamic Google Form Integration", + "PDF / DOC Upload", + "AI-powered Quiz Generation", + "Instant Practice Mode", ].map((feature, i) => (
-
{feature}
+
+ {feature} +
))}
- {/* Buttons */} -
+ {/* Primary Buttons */} +
- + -
+ {/* How It Works Section */} +
+

+ How It Works +

+ +
+ {[ + "Upload your PDF or DOC file", + "AI generates quiz questions instantly", + "Start practicing and test your knowledge", + ].map((step, i) => ( +
+

+ Step {i + 1} +

+

{step}

+
+ ))} +
+
+ + {/* Why EduAid Section */} +
+

+ Why EduAid? +

+ +
+ {[ + "Saves hours of manual question creation", + "Encourages active recall learning", + "Instant feedback improves retention", + "Perfect for exams and revision", + ].map((point, i) => ( +
+

{point}

+
+ ))} +
+
+ + {/* Final CTA */} +
+ + + +
+ {/* GitHub Stars */}
GitHub Star @@ -125,4 +193,4 @@ const Home = () => { ); }; -export default Home; +export default Home; \ No newline at end of file From ce79c02efff534f222824f99857e646766ed915f Mon Sep 17 00:00:00 2001 From: Mahek Gupta Date: Thu, 26 Feb 2026 20:14:56 +0530 Subject: [PATCH 2/4] feat: improve landing page with how-it-works section and strong CTA --- eduaid_web/src/pages/Home.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eduaid_web/src/pages/Home.jsx b/eduaid_web/src/pages/Home.jsx index f882191f..2781bf0e 100644 --- a/eduaid_web/src/pages/Home.jsx +++ b/eduaid_web/src/pages/Home.jsx @@ -47,7 +47,7 @@ const Home = () => { }, []); return ( -
+
{/* Logo */} From 39efd8651bf1f3e3ce07cfaadca77ef71823023a Mon Sep 17 00:00:00 2001 From: Mahek Gupta Date: Thu, 26 Feb 2026 20:32:33 +0530 Subject: [PATCH 3/4] fix: address CodeRabbit review (safe parsing + remove nested buttons) --- eduaid_web/src/pages/Home.jsx | 60 ++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/eduaid_web/src/pages/Home.jsx b/eduaid_web/src/pages/Home.jsx index 2781bf0e..60bafec3 100644 --- a/eduaid_web/src/pages/Home.jsx +++ b/eduaid_web/src/pages/Home.jsx @@ -29,17 +29,20 @@ const Home = () => { const storedStars = localStorage.getItem("stars"); const storedTime = localStorage.getItem("fetchTime"); + const cachedStars = Number(storedStars); + const cachedTime = Number(storedTime); + if ( - storedStars && - storedTime && - !isMoreThanOneDayOld(parseInt(storedTime)) + Number.isFinite(cachedStars) && + Number.isFinite(cachedTime) && + !isMoreThanOneDayOld(cachedTime) ) { - setStars(parseInt(storedStars)); + setStars(cachedStars); } else { fetchGitHubStars() .then((starCount) => { setStars(starCount); - localStorage.setItem("stars", starCount); + localStorage.setItem("stars", String(starCount)); localStorage.setItem("fetchTime", Date.now().toString()); }) .catch(() => setError("Failed to fetch stars")); @@ -50,8 +53,9 @@ const Home = () => {
+ {/* Logo */} - logo + EduAid Logo {/* Heading */}

@@ -63,11 +67,9 @@ const Home = () => {

- {/* Improved Subtitle */} + {/* Subtitle */}
-

- Turn your notes into interactive quizzes in seconds. -

+

Turn your notes into interactive quizzes in seconds.

Upload your PDF or DOC file and start practicing instantly.

@@ -94,22 +96,26 @@ const Home = () => { {/* Primary Buttons */}
- - + + + Upload & Generate Quiz + - - + + View Previous Work + +
- {/* How It Works Section */} + {/* How It Works */}

How It Works @@ -134,7 +140,7 @@ const Home = () => {

- {/* Why EduAid Section */} + {/* Why EduAid */}

Why EduAid? @@ -159,10 +165,11 @@ const Home = () => { {/* Final CTA */}
- - + + Turn Your Notes Into a Quiz Now
@@ -187,6 +194,7 @@ const Home = () => {

+
From 1449774207947bbc6cb6484d6c3c110597354ecb Mon Sep 17 00:00:00 2001 From: Mahek Gupta Date: Thu, 26 Feb 2026 20:42:36 +0530 Subject: [PATCH 4/4] fix: harden cache guard and validate GitHub API response per CodeRabbit review --- eduaid_web/src/pages/Home.jsx | 49 ++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/eduaid_web/src/pages/Home.jsx b/eduaid_web/src/pages/Home.jsx index 60bafec3..f581f7f4 100644 --- a/eduaid_web/src/pages/Home.jsx +++ b/eduaid_web/src/pages/Home.jsx @@ -15,8 +15,18 @@ const Home = () => { const response = await fetch( "https://api.github.com/repos/AOSSIE-Org/EduAid" ); - if (!response.ok) throw new Error("Failed to fetch stars"); + const data = await response.json(); + + if ( + !response.ok || + !data || + typeof data.stargazers_count !== "number" + ) { + console.error("Invalid GitHub API response:", data); + throw new Error("Invalid GitHub response"); + } + return data.stargazers_count; } @@ -29,24 +39,27 @@ const Home = () => { const storedStars = localStorage.getItem("stars"); const storedTime = localStorage.getItem("fetchTime"); - const cachedStars = Number(storedStars); - const cachedTime = Number(storedTime); - - if ( - Number.isFinite(cachedStars) && - Number.isFinite(cachedTime) && - !isMoreThanOneDayOld(cachedTime) - ) { - setStars(cachedStars); - } else { - fetchGitHubStars() - .then((starCount) => { - setStars(starCount); - localStorage.setItem("stars", String(starCount)); - localStorage.setItem("fetchTime", Date.now().toString()); - }) - .catch(() => setError("Failed to fetch stars")); + if (storedStars !== null && storedTime !== null) { + const cachedStars = Number(storedStars); + const cachedTime = Number(storedTime); + + if ( + Number.isFinite(cachedStars) && + Number.isFinite(cachedTime) && + !isMoreThanOneDayOld(cachedTime) + ) { + setStars(cachedStars); + return; + } } + + fetchGitHubStars() + .then((starCount) => { + setStars(starCount); + localStorage.setItem("stars", String(starCount)); + localStorage.setItem("fetchTime", Date.now().toString()); + }) + .catch(() => setError("Failed to fetch stars")); }, []); return (