Ship site UI checklist, move admin to /mstcontroller, and add safe taxonomy label migration.
Deploy edu.mstaut.ir / deploy (push) Has been cancelled

Production already has migrations through 008; 009 only updates four seed labels by id. Faculty sync remains upsert-by-email/name and does not wipe curated data.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
smhk1376andCursor committed 2026-10-16 16:26:21 +03:30
1 parent 3eea1c35a6
commit 2b0db26a93
171 files changed
+1477 -807

No files matched your search

+7 -1
View File
@@ -7,6 +7,7 @@ import { FormCard } from "@/components/molecules/FormCard";
import { PageHero } from "@/components/molecules/PageHero";
import { ContactInterestForm } from "@/components/organisms/ContactInterestForm";
import { getLegalPage } from "@/lib/data/site";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -20,7 +21,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const page = await getLegalPage(slug);
if (!page) return { title: "صفحه یافت نشد" };
return { title: page.title, description: page.body[0] };
const description = page.body[0] ?? page.title;
return pageMetadata({
title: page.title,
description: truncateMetaDescription(description),
path: `/${slug}`,
});
}
export default async function LegalSlugPage({ params }: Props) {
+5 -3
View File
@@ -2,14 +2,16 @@ import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { AboutTemplate } from "@/components/templates/AboutTemplate";
import { getTopics } from "@/lib/data/site";
import { pageMetadata } from "@/lib/seo/metadata";
import { aboutContent } from "@/lib/site-config";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return {
return pageMetadata({
title: t("aboutTitle"),
description: aboutContent.intro,
};
description: aboutContent.seoDescription,
path: "/about",
});
}
export default async function AboutPage() {
+11 -2
View File
@@ -8,10 +8,15 @@ import { BadgeLabel } from "@/components/atoms/BadgeLabel";
import { PageHero } from "@/components/molecules/PageHero";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { getAlumniStories } from "@/lib/data/site";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("alumniTitle"), description: t("alumniIntro") };
return pageMetadata({
title: t("alumniTitle"),
description: t("alumniIntro"),
path: "/alumni",
});
}
export default async function AlumniPage() {
@@ -20,7 +25,11 @@ export default async function AlumniPage() {
return (
<main id="main-content">
<PageHero title={t("alumniTitle")} intro={t("alumniIntro")} />
<PageHero
title={t("alumniTitle")}
intro={t("alumniIntro")}
imageUrl="/brand/graduation-cap-neural.png"
/>
<Section tone="subtle">
<Container>
<div className="grid gap-5 md:grid-cols-3">
+6 -1
View File
@@ -6,10 +6,15 @@ import { PageHero } from "@/components/molecules/PageHero";
import { ContactDetails } from "@/components/molecules/ContactDetails";
import { FormCard } from "@/components/molecules/FormCard";
import { ContactInterestForm } from "@/components/organisms/ContactInterestForm";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("contactTitle"), description: t("contactIntro") };
return pageMetadata({
title: t("contactTitle"),
description: t("contactIntro"),
path: "/contact",
});
}
export default async function ContactPage() {
+23 -1
View File
@@ -9,6 +9,12 @@ import { DetailList } from "@/components/molecules/DetailList";
import { PageHero } from "@/components/molecules/PageHero";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { getEventById } from "@/lib/data/events";
import { JsonLd } from "@/lib/seo/json-ld";
import {
absoluteUrl,
pageMetadata,
truncateMetaDescription,
} from "@/lib/seo/metadata";
type Props = { params: Promise<{ id: string }> };
@@ -22,7 +28,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
const event = await getEventById(id);
if (!event) return { title: "رویداد یافت نشد" };
return { title: event.title, description: event.summary };
return pageMetadata({
title: event.title,
description: truncateMetaDescription(event.summary),
path: `/events/${id}`,
});
}
export default async function EventDetailPage({ params }: Props) {
@@ -37,6 +47,18 @@ export default async function EventDetailPage({ params }: Props) {
return (
<main id="main-content">
<JsonLd
data={{
"@context": "https://schema.org",
"@type": "Event",
name: event.title,
description: event.summary,
startDate: event.startDate,
...(event.endDate ? { endDate: event.endDate } : {}),
location: { "@type": "Place", name: event.location },
url: absoluteUrl(`/events/${id}`),
}}
/>
<PageHero title={event.title} intro={event.summary} />
<Section tone="subtle">
<Container narrow className="space-y-6">
+6 -1
View File
@@ -5,10 +5,15 @@ import { Section } from "@/components/atoms/Section";
import { EventCard } from "@/components/molecules/Cards";
import { PageHero } from "@/components/molecules/PageHero";
import { getEvents } from "@/lib/data/events";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("eventsTitle"), description: t("eventsIntro") };
return pageMetadata({
title: t("eventsTitle"),
description: t("eventsIntro"),
path: "/events",
});
}
export default async function EventsPage() {
+2 -2
View File
@@ -1,6 +1,6 @@
import { redirect } from "next/navigation";
import { facultyNetworkUrl } from "@/lib/site-config";
/** Faculty are not introduced on this site; send visitors home. */
export default function FacultyPage() {
redirect(facultyNetworkUrl);
redirect("/");
}
+12 -1
View File
@@ -7,6 +7,11 @@ import { TextLink } from "@/components/atoms/TextLink";
import { PageHero } from "@/components/molecules/PageHero";
import { getArticleById } from "@/lib/data/articles";
import { JsonLd } from "@/lib/seo/json-ld";
import {
absoluteUrl,
pageMetadata,
truncateMetaDescription,
} from "@/lib/seo/metadata";
type Props = { params: Promise<{ id: string }> };
@@ -14,7 +19,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
const article = await getArticleById(id);
if (!article) return { title: "مقاله یافت نشد" };
return { title: article.title, description: article.excerpt };
return pageMetadata({
title: article.title,
description: truncateMetaDescription(article.excerpt),
path: `/insights/${id}`,
image: article.imageUrl,
});
}
export default async function InsightDetailPage({ params }: Props) {
@@ -35,6 +45,7 @@ export default async function InsightDetailPage({ params }: Props) {
datePublished: article.publishedAt,
author: { "@type": "Person", name: article.author },
image: article.imageUrl,
url: absoluteUrl(`/insights/${id}`),
}}
/>
<PageHero
+11 -2
View File
@@ -5,10 +5,15 @@ import { Section } from "@/components/atoms/Section";
import { ArticleCard } from "@/components/molecules/Cards";
import { PageHero } from "@/components/molecules/PageHero";
import { getArticles } from "@/lib/data/articles";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("insightsTitle"), description: t("insightsIntro") };
return pageMetadata({
title: t("insightsTitle"),
description: t("insightsIntro"),
path: "/insights",
});
}
export default async function InsightsPage() {
@@ -17,7 +22,11 @@ export default async function InsightsPage() {
return (
<main id="main-content">
<PageHero title={t("insightsTitle")} intro={t("insightsIntro")} />
<PageHero
title={t("insightsTitle")}
intro={t("insightsIntro")}
imageUrl="/brand/neural-open-book.png"
/>
<Section tone="subtle">
<Container>
<div className="mx-auto max-w-5xl">
+1 -6
View File
@@ -7,11 +7,7 @@ import { getCourses } from "@/lib/data/courses";
import { listPublishedCourseTags } from "@/lib/data/taxonomy";
import { getPrograms } from "@/lib/data/programs";
import { getCampaignBanners } from "@/lib/data/site";
import {
facultyNetworkUrl,
facultySiteUrl,
siteShortName,
} from "@/lib/site-config";
import { facultySiteUrl, siteShortName } from "@/lib/site-config";
// Public CMS pages must read Postgres at request time — static bake at Docker
// build often has no DATABASE_URL and ships empty lists.
@@ -60,7 +56,6 @@ export default async function MainLayout({
linksTitle={t("footer.links")}
links={[
{ label: t("footer.facultySite"), href: facultySiteUrl },
{ label: t("footer.facultyNetwork"), href: facultyNetworkUrl },
{ label: t("footer.press"), href: "/press" },
{ label: t("footer.careers"), href: "/careers" },
]}
+3 -3
View File
@@ -8,12 +8,12 @@ export default function NotFound() {
return (
<main id="main-content" className="bg-background">
<Container className="flex min-h-[60vh] flex-col items-start justify-center py-20">
<p className="text-sm font-bold text-primary sm:text-base">۴۰۴</p>
<p className="text-sm font-bold text-accent sm:text-base">۴۰۴</p>
<Heading as="h1" level={2} className="mt-3">
صفحه مورد نظر یافت نشد
</Heading>
<p className="mt-4 max-w-md text-base leading-8 text-muted-foreground">
ممکن است این صفحه جابه‌جا یا حذف شده باشد.
ممکن است این صفحه جابه جا یا حذف شده باشد.
</p>
<div className="mt-8 flex flex-wrap gap-3">
<Link href="/" className={cn(buttonVariants({ size: "lg" }), "font-bold")}>
@@ -23,7 +23,7 @@ export default function NotFound() {
href="/professional"
className={buttonVariants({ variant: "outline", size: "lg" })}
>
مشاهده دوره‌ها
مشاهده دوره ها
</Link>
</div>
</Container>
+19 -32
View File
@@ -1,36 +1,33 @@
import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { pageMetadata } from "@/lib/seo/metadata";
import {
HomeApproach,
HomeClosing,
HomeCourseSearch,
HomeEventsTeaser,
HomeHero,
HomeIdeas,
HomeRest,
HomeTeams,
type HomeLabels,
} from "@/components/templates/HomeTemplate";
import { getFeaturedArticle } from "@/lib/data/articles";
import { getLatestCourses } from "@/lib/data/courses";
import { getSiteStats, getTopics } from "@/lib/data/site";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("meta");
return pageMetadata({
title: t("homeTitle"),
description: t("homeDescription"),
path: "/",
absoluteTitle: true,
});
}
async function getLabels(): Promise<HomeLabels> {
const t = await getTranslations();
return {
executiveLabel: t("home.executiveLabel"),
exploreOurPrograms: t("home.exploreOurPrograms"),
ideasTitle: t("home.ideasTitle"),
eventsTitle: t("home.eventsTitle"),
seeAllEvents: t("nav.seeAllEvents"),
intersectionsTitle: t("home.intersectionsTitle"),
intersectionsSubtitle: t("home.intersectionsSubtitle"),
moreThanDegree: t("home.moreThanDegree"),
moreThanDegreeBody: t("home.moreThanDegreeBody"),
keepExploring: t("home.keepExploring"),
hireTitle: t("home.hireTitle"),
hireBody: t("home.hireBody"),
registerCta: t("nav.registerCta"),
missionTitle: t("home.missionTitle"),
findUsTitle: t("home.findUsTitle"),
ideasEyebrow: t("home.ideasEyebrow"),
linksTitle: t("footer.links"),
exploreCourses: t("nav.exploreCourses"),
};
}
@@ -59,8 +56,7 @@ async function HeroSection() {
async function CourseSearchSection() {
const data = await orFallback(
"latest courses",
() =>
Promise.all([getLatestCourses(6), getLabels()]),
() => Promise.all([getLatestCourses(6), getLabels()]),
null,
);
if (!data) return null;
@@ -73,17 +69,6 @@ async function CourseSearchSection() {
);
}
async function RestSection() {
const [intersections, stats, labels] = await Promise.all([
orFallback("topics", getTopics, []),
orFallback("site stats", getSiteStats, []),
getLabels(),
]);
return (
<HomeRest labels={labels} intersections={intersections} stats={stats} />
);
}
export default function HomePage() {
return (
<main id="main-content">
@@ -91,7 +76,9 @@ export default function HomePage() {
<HomeIdeas />
<CourseSearchSection />
<HomeApproach />
<RestSection />
<HomeEventsTeaser />
<HomeTeams />
<HomeClosing />
</main>
);
}
+7 -5
View File
@@ -15,6 +15,7 @@ import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { getCourses } from "@/lib/data/courses";
import { getProgramBySlug } from "@/lib/data/programs";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -22,10 +23,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const program = await getProgramBySlug(slug);
if (!program) return { title: "برنامه یافت نشد" };
return {
return pageMetadata({
title: program.title,
description: program.blurb,
};
description: truncateMetaDescription(program.blurb),
path: `/programs/${slug}`,
});
}
export default async function ProgramDetailPage({ params }: Props) {
@@ -72,7 +74,7 @@ export default async function ProgramDetailPage({ params }: Props) {
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "mt-6 w-full font-bold")}
>
مشاهده دوره‌ها
مشاهده دوره ها
</Link>
</SurfaceCard>
<TextLink href="/programs" className="block px-1 text-sm">
@@ -93,7 +95,7 @@ export default async function ProgramDetailPage({ params }: Props) {
<Heading
as="h3"
level={4}
className="transition-colors group-hover:text-primary"
className="transition-colors group-hover:text-accent"
>
{course.title}
</Heading>
+10 -4
View File
@@ -12,13 +12,15 @@ import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { getPrograms } from "@/lib/data/programs";
import { pageMetadata } from "@/lib/seo/metadata";
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return {
return pageMetadata({
title: t("programsTitle"),
description: t("programsIntro"),
};
path: "/programs",
});
}
export default async function ProgramsPage() {
@@ -29,7 +31,11 @@ export default async function ProgramsPage() {
return (
<main id="main-content">
<PageHero title={t("programsTitle")} intro={t("programsIntro")} />
<PageHero
title={t("programsTitle")}
intro={t("programsIntro")}
imageUrl="/brand/neural-tree-knowledge.png"
/>
<Section tone="subtle">
<Container className="space-y-16">
<ProgramGroup title={t("standardGroup")} items={standard} />
@@ -58,7 +64,7 @@ function ProgramGroup({
<BadgeLabel className="w-fit">{program.tagline}</BadgeLabel>
) : null}
<Heading as="h3" level={3} className="mt-3">
<Link href={program.href} className="transition-colors hover:text-primary">
<Link href={program.href} className="transition-colors hover:text-accent">
{program.title}
</Link>
</Heading>
+9 -3
View File
@@ -3,6 +3,7 @@ import { notFound } from "next/navigation";
import { getTranslations } from "next-intl/server";
import { CourseDetailTemplate } from "@/components/templates/CourseDetailTemplate";
import { getCourseById } from "@/lib/data/courses";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -10,10 +11,15 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const course = await getCourseById(slug);
if (!course) return { title: "دوره یافت نشد" };
return {
const pathSlug = course.slug || slug;
return pageMetadata({
title: course.title,
description: course.seoDescription || course.summary,
};
description: truncateMetaDescription(
course.seoDescription || course.summary,
),
path: `/register/${pathSlug}`,
...(course.posterImageUrl ? { image: course.posterImageUrl } : {}),
});
}
export default async function CourseRegisterPage({ params }: Props) {
+9 -3
View File
@@ -10,6 +10,7 @@ import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { getTopicBySlug } from "@/lib/data/site";
import { pageMetadata, truncateMetaDescription } from "@/lib/seo/metadata";
type Props = { params: Promise<{ slug: string }> };
@@ -17,7 +18,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const topic = await getTopicBySlug(slug);
if (!topic) return { title: "موضوع یافت نشد" };
return { title: topic.title, description: topic.description };
return pageMetadata({
title: topic.title,
description: truncateMetaDescription(topic.description),
path: `/topics/${slug}`,
image: topic.imageUrl,
});
}
export default async function TopicPage({ params }: Props) {
@@ -43,13 +49,13 @@ export default async function TopicPage({ params }: Props) {
<aside className="min-w-0 space-y-4 lg:sticky lg:top-28">
<SurfaceCard padded as="div">
<p className="text-sm leading-7 text-muted-foreground">
دوره‌های مرتبط با این موضوع را در فهرست دوره‌های کوتاه ببینید.
دوره های مرتبط با این موضوع را در فهرست دوره های کوتاه ببینید.
</p>
<Link
href="/professional"
className={cn(buttonVariants({ size: "lg" }), "mt-5 w-full font-bold")}
>
مشاهده دوره‌ها
مشاهده دوره ها
</Link>
</SurfaceCard>
<TextLink href="/" className="block px-1 text-sm">
+10 -4
View File
@@ -8,13 +8,18 @@ import { Section } from "@/components/atoms/Section";
import { PageHero } from "@/components/molecules/PageHero";
import { SectionHeader } from "@/components/molecules/SectionHeader";
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
import { pageMetadata } from "@/lib/seo/metadata";
import { valuesContent } from "@/lib/site-config";
const FA_INDEX = ["۱", "۲", "۳", "۴", "۵", "۶"] as const;
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("pages");
return { title: t("valuesTitle"), description: valuesContent.intro };
return pageMetadata({
title: t("valuesTitle"),
description: valuesContent.seoDescription,
path: "/values",
});
}
export default async function ValuesPage() {
@@ -24,6 +29,7 @@ export default async function ValuesPage() {
eyebrow={valuesContent.eyebrow}
title={valuesContent.title}
intro={valuesContent.intro}
imageUrl="/brand/collective-intelligence.png"
/>
<Section tone="subtle">
@@ -31,7 +37,7 @@ export default async function ValuesPage() {
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-3">
{valuesContent.items.map((item, index) => (
<SurfaceCard key={item.title} padded>
<p className="text-xs font-semibold text-primary/80">
<p className="text-xs font-semibold text-accent/80">
{FA_INDEX[index] ?? String(index + 1)}
</p>
<Heading as="h2" level={4} className="mt-2">
@@ -60,13 +66,13 @@ export default async function ValuesPage() {
className="group block min-w-0 rounded-xl focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50"
>
<SurfaceCard padded interactive className="h-full transition-shadow">
<Heading as="h3" level={4} className="group-hover:text-primary">
<Heading as="h3" level={4} className="group-hover:text-accent">
{example.title}
</Heading>
<p className="mt-2 text-sm leading-7 text-muted-foreground">
{example.text}
</p>
<span className="mt-4 inline-flex items-center gap-1.5 text-sm font-semibold text-primary">
<span className="mt-4 inline-flex items-center gap-1.5 text-sm font-semibold text-accent">
مشاهده دوره
<ArrowLeft className="size-3.5 transition-transform group-hover:-translate-x-0.5" />
</span>