From b829cb53ebd8d9b9d2047dcc29e23111389a8149 Mon Sep 17 00:00:00 2001 From: Muhammad Faheem Date: Sat, 18 Jul 2026 10:32:46 +0500 Subject: [PATCH 01/29] Add shared SEO utilities --- lib/seo.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lib/seo.js diff --git a/lib/seo.js b/lib/seo.js new file mode 100644 index 0000000..58d8cce --- /dev/null +++ b/lib/seo.js @@ -0,0 +1,64 @@ +const DEFAULT_SITE_URL = "https://study-ai.mumar.dev"; + +function normalizeSiteUrl(url) { + const cleanedUrl = String(url || DEFAULT_SITE_URL) + .trim() + .replace(/^["']|["']$/g, "") + .replace(/\/+$/g, ""); + + try { + return new URL(cleanedUrl).origin; + } catch { + return DEFAULT_SITE_URL; + } +} + +export const siteName = "StudyAI"; +export const siteUrl = normalizeSiteUrl(process.env.NEXT_PUBLIC_SITE_URL); +export const defaultTitle = + "StudyAI - AI Study Notes, Summaries, Quizzes & Flashcards"; +export const defaultDescription = + "Turn any topic into clear AI notes, concise summaries, practice quizzes, flashcards, and solved questions with StudyAI."; + +export const seoKeywords = [ + "StudyAI", + "AI study tool", + "AI notes generator", + "AI quiz generator", + "AI summary generator", + "AI flashcards", + "student study app", + "exam revision AI", + "question solver", +]; + +export const noIndexRobots = { + index: false, + follow: false, + nocache: true, + googleBot: { + index: false, + follow: false, + noimageindex: true, + }, +}; + +export function absoluteUrl(path = "/") { + const normalizedPath = path.startsWith("/") ? path : `/${path}`; + return `${siteUrl}${normalizedPath}`; +} + +export function buildNoIndexMetadata({ title, description, path }) { + return { + title, + description, + alternates: { + canonical: path, + }, + robots: noIndexRobots, + }; +} + +export function jsonLd(data) { + return JSON.stringify(data).replace(/ Date: Sat, 18 Jul 2026 10:32:46 +0500 Subject: [PATCH 02/29] Add app-wide SEO metadata --- app/layout.jsx | 58 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/app/layout.jsx b/app/layout.jsx index 31c42a2..76b3a16 100644 --- a/app/layout.jsx +++ b/app/layout.jsx @@ -1,9 +1,62 @@ import "./globals.css"; import ThemeProvider from "@/components/ThemeProvider"; +import { + defaultDescription, + defaultTitle, + seoKeywords, + siteName, + siteUrl, +} from "@/lib/seo"; export const metadata = { - title: "StudyAI - Study Smarter with AI", - description: "Generate notes, solve questions, and summarize topics instantly.", + metadataBase: new URL(siteUrl), + applicationName: siteName, + title: { + default: defaultTitle, + template: `%s | ${siteName}`, + }, + description: defaultDescription, + keywords: seoKeywords, + authors: [{ name: siteName }], + creator: siteName, + publisher: siteName, + category: "Education", + alternates: { + canonical: "/", + }, + openGraph: { + type: "website", + locale: "en_US", + url: "/", + siteName, + title: defaultTitle, + description: defaultDescription, + images: [ + { + url: "/opengraph-image", + width: 1200, + height: 630, + alt: "StudyAI AI study workspace for notes, summaries, quizzes, and flashcards", + }, + ], + }, + twitter: { + card: "summary_large_image", + title: defaultTitle, + description: defaultDescription, + images: ["/twitter-image"], + }, + robots: { + index: true, + follow: true, + googleBot: { + index: true, + follow: true, + "max-video-preview": -1, + "max-image-preview": "large", + "max-snippet": -1, + }, + }, icons: { icon: [ { url: "/icon.svg", type: "image/svg+xml" }, @@ -12,6 +65,7 @@ export const metadata = { { url: "/icon.svg", type: "image/svg+xml" }, ], }, + manifest: "/manifest.webmanifest", }; export default function RootLayout({ children }) { From f0f44e2d1bbb8767305c96d4502b4a2b46abbd74 Mon Sep 17 00:00:00 2001 From: Muhammad Faheem Date: Sat, 18 Jul 2026 10:32:47 +0500 Subject: [PATCH 03/29] Add homepage SEO schema and social metadata --- app/page.jsx | 141 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 129 insertions(+), 12 deletions(-) diff --git a/app/page.jsx b/app/page.jsx index e706e86..0a5a399 100644 --- a/app/page.jsx +++ b/app/page.jsx @@ -8,20 +8,137 @@ import HowItWorks from "@/components/HowItWorks"; import Navbar from "@/components/Navbar"; import StatsSection from "@/components/StatsSection"; import Testimonials from "@/components/Testimonials"; +import { + absoluteUrl, + defaultDescription, + defaultTitle, + jsonLd, + siteName, + siteUrl, +} from "@/lib/seo"; + +const homepageFaqs = [ + { + question: "How does StudyAI work?", + answer: + "Enter a topic, paste study material, or ask a question. StudyAI uses AI to generate clear notes, summaries, explanations, quizzes, and practice material in seconds.", + }, + { + question: "Is StudyAI free?", + answer: + "Yes. Students can start with StudyAI for free and quickly try AI notes, summaries, quizzes, flashcards, and question solving.", + }, + { + question: "Can StudyAI create quizzes and flashcards?", + answer: + "Yes. StudyAI can turn topics and pasted notes into quiz-style practice questions and interactive flashcards for revision.", + }, + { + question: "Can StudyAI help with exam revision?", + answer: + "Yes. StudyAI helps organize key ideas, definitions, formulas, summaries, and practice questions so students can review faster before exams.", + }, +]; + +const structuredData = [ + { + "@context": "https://schema.org", + "@type": "WebApplication", + name: siteName, + url: siteUrl, + applicationCategory: "EducationalApplication", + operatingSystem: "Web", + description: defaultDescription, + offers: { + "@type": "Offer", + price: "0", + priceCurrency: "USD", + }, + featureList: [ + "AI notes generator", + "AI summary generator", + "AI quiz generator", + "AI flashcards", + "Question solver", + "Saved study workspace", + ], + publisher: { + "@type": "Organization", + name: siteName, + url: siteUrl, + logo: absoluteUrl("/icon.svg"), + }, + }, + { + "@context": "https://schema.org", + "@type": "Organization", + name: siteName, + url: siteUrl, + logo: absoluteUrl("/icon.svg"), + }, + { + "@context": "https://schema.org", + "@type": "FAQPage", + mainEntity: homepageFaqs.map((item) => ({ + "@type": "Question", + name: item.question, + acceptedAnswer: { + "@type": "Answer", + text: item.answer, + }, + })), + }, +]; + +export const metadata = { + title: { + absolute: defaultTitle, + }, + description: defaultDescription, + alternates: { + canonical: "/", + }, + openGraph: { + title: defaultTitle, + description: defaultDescription, + url: "/", + siteName, + images: [ + { + url: "/opengraph-image", + width: 1200, + height: 630, + alt: "StudyAI AI study workspace for notes, summaries, quizzes, and flashcards", + }, + ], + }, + twitter: { + card: "summary_large_image", + title: defaultTitle, + description: defaultDescription, + images: ["/twitter-image"], + }, +}; export default function Home() { return ( -
- - - - - - - - - -
-
+ <> +