diff --git a/frontend/admin-panel/src/routes/adminRoutes.tsx b/frontend/admin-panel/src/routes/adminRoutes.tsx
index f93a5d47..a863bcec 100644
--- a/frontend/admin-panel/src/routes/adminRoutes.tsx
+++ b/frontend/admin-panel/src/routes/adminRoutes.tsx
@@ -41,6 +41,8 @@ const Transactions = lazyWithRetry(() => import('../pages/Transactions'));
const Tickets = lazyWithRetry(() => import('../pages/Tickets'));
const Reviews = lazyWithRetry(() => import('../pages/Reviews'));
const DoctorsManager = lazyWithRetry(() => import('../pages/DoctorsManager'));
+const FAQManager = lazyWithRetry(() => import('../pages/FAQManager'));
+const MenuManager = lazyWithRetry(() => import('../pages/MenuManager'));
export interface AdminRouteConfig {
path: string;
@@ -97,6 +99,8 @@ export const router = createBrowserRouter([
{ path: 'contact/*', element:
},
{ path: 'tickets/*', element:
},
{ path: 'reviews/*', element:
},
+ { path: 'faq/*', element:
},
+ { path: 'menu/*', element:
},
],
},
],
diff --git a/frontend/application/app/HomeClient.tsx b/frontend/application/app/HomeClient.tsx
index 935cdf82..bfae7cba 100644
--- a/frontend/application/app/HomeClient.tsx
+++ b/frontend/application/app/HomeClient.tsx
@@ -6,6 +6,8 @@ import SmartAdvisor from "../components/SmartAdvisor";
import FeaturedProducts from "../components/FeaturedProducts";
import VetGallery from "../components/VetGallery";
import TestimonialsSection from "../components/TestimonialsSection";
+import BlogPreviewSection from "../components/BlogPreviewSection";
+import FAQSection from "../components/FAQSection";
import BannerPlacement from "../components/BannerPlacement";
import Link from 'next/link';
import { toPersian } from "../lib/utils";
@@ -64,6 +66,9 @@ export default function HomeClient({ initialData }: HomeClientProps) {
+
+
+
{/* Navigation to Sections */}
diff --git a/frontend/application/components/BlogPreviewSection.tsx b/frontend/application/components/BlogPreviewSection.tsx
new file mode 100644
index 00000000..a9a1dd8d
--- /dev/null
+++ b/frontend/application/components/BlogPreviewSection.tsx
@@ -0,0 +1,178 @@
+"use client";
+import React, { useEffect, useState } from "react";
+import Link from "next/link";
+import { BookOpen, Calendar, Eye, MessageSquare, ArrowLeft } from "lucide-react";
+import { motion } from "motion/react";
+import SafeImage from "./SafeImage";
+import { useSettingsStore } from "../lib/store/settingsStore";
+import api, { BASE_DOMAIN } from "../lib/services/api";
+import { toPersian } from "../lib/utils";
+
+export interface BlogPost {
+ id: string;
+ title: string;
+ slug: string;
+ content: string;
+ imageUrl?: string;
+ viewCount: number;
+ createdAt: string;
+ author?: {
+ firstName: string;
+ lastName: string;
+ };
+ _count?: {
+ comments: number;
+ };
+}
+
+export default function BlogPreviewSection() {
+ const getText = useSettingsStore((state) => state.getText);
+ const [blogs, setBlogs] = useState([]);
+ const [isLoading, setIsLoading] = useState(true);
+
+ useEffect(() => {
+ async function loadBlogs() {
+ try {
+ setIsLoading(true);
+ const res = await api.get("/blogs/homepage");
+ const list = Array.isArray(res.data?.blogs)
+ ? res.data.blogs
+ : Array.isArray(res.data)
+ ? res.data
+ : [];
+ setBlogs(list);
+ } catch (err) {
+ console.error("Failed to load homepage blogs:", err);
+ setBlogs([]);
+ } finally {
+ setIsLoading(false);
+ }
+ }
+ loadBlogs();
+ }, []);
+
+ if (!isLoading && blogs.length === 0) {
+ return null;
+ }
+
+ return (
+
+
+ {/* Header */}
+
+
+
+
+ {getText("blog_preview_badge", "آخرین مطالب تخصصی")}
+
+
+ {getText("blog_preview_title", "مجله سلامت پت کنینا")}
+
+
+ {getText(
+ "blog_preview_subtitle",
+ "مقالات علمی و تخصصی دامپزشکی برای مراقبت بهتر از حیوان خانگی شما"
+ )}
+
+
+
+
{getText("blog_preview_read_more", "مشاهده همه مقالات")}
+
+
+
+
+ {/* Blog Grid */}
+ {isLoading ? (
+
+ {[1, 2, 3].map((i) => (
+
+ ))}
+
+ ) : (
+
+ {blogs.map((blog, idx) => {
+ const image = blog.imageUrl?.startsWith("http")
+ ? blog.imageUrl
+ : blog.imageUrl
+ ? `${BASE_DOMAIN}${blog.imageUrl}`
+ : "/assets/images/blog-placeholder.png";
+
+ const authorName = blog.author
+ ? `${blog.author.firstName || ""} ${blog.author.lastName || ""}`.trim()
+ : "تحریریه کنینا";
+
+ const formattedDate = new Date(blog.createdAt).toLocaleDateString("fa-IR");
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ {toPersian(formattedDate)}
+
+
+
+ {toPersian(blog.viewCount || 0)} {getText("blog_preview_views", "بازدید")}
+
+
+
+ {toPersian(blog._count?.comments || 0)} {getText("blog_preview_comments", "نظر")}
+
+
+
+
+
+ {blog.title}
+
+
+
+
+
+
+ {authorName}
+
+
+ {getText("blog_preview_read_article", "خواندن مقاله")}
+
+
+
+
+
+ );
+ })}
+
+ )}
+
+
+ );
+}
diff --git a/frontend/application/components/FAQSection.tsx b/frontend/application/components/FAQSection.tsx
new file mode 100644
index 00000000..b244e3fe
--- /dev/null
+++ b/frontend/application/components/FAQSection.tsx
@@ -0,0 +1,132 @@
+"use client";
+import React, { useEffect, useState } from "react";
+import { HelpCircle, ChevronDown } from "lucide-react";
+import { motion, AnimatePresence } from "motion/react";
+import { useSettingsStore } from "../lib/store/settingsStore";
+import api from "../lib/services/api";
+
+export interface FAQItem {
+ id: string;
+ question: string;
+ answer: string;
+ order: number;
+}
+
+export default function FAQSection() {
+ const getText = useSettingsStore((state) => state.getText);
+ const [faqs, setFaqs] = useState([]);
+ const [openIndex, setOpenIndex] = useState(0);
+ const [isLoading, setIsLoading] = useState(true);
+
+ useEffect(() => {
+ async function loadFaqs() {
+ try {
+ setIsLoading(true);
+ const res = await api.get("/faq");
+ const list = Array.isArray(res.data) ? res.data : [];
+ setFaqs(list);
+ } catch (err) {
+ console.error("Failed to load FAQs:", err);
+ setFaqs([]);
+ } finally {
+ setIsLoading(false);
+ }
+ }
+ loadFaqs();
+ }, []);
+
+ if (!isLoading && faqs.length === 0) {
+ return null;
+ }
+
+ // Schema.org FAQPage JSON-LD structure
+ const faqSchema = {
+ "@context": "https://schema.org",
+ "@type": "FAQPage",
+ "mainEntity": faqs.map((faq) => ({
+ "@type": "Question",
+ "name": faq.question,
+ "acceptedAnswer": {
+ "@type": "Answer",
+ "text": faq.answer,
+ },
+ })),
+ };
+
+ return (
+
+ {/* Schema.org FAQPage Rich Snippet */}
+ {faqs.length > 0 && (
+
+ )}
+
+
+ {/* Header */}
+
+
+
+ {getText("faq_badge", "سوالات پرتکرار")}
+
+
+ {getText("faq_title", "سوالات متداول")}
+
+
+ {getText("faq_subtitle", "پاسخ سوالاتی که اغلب از ما میپرسید")}
+
+
+
+ {/* FAQ List */}
+ {isLoading ? (
+
+ {[1, 2, 3].map((i) => (
+
+ ))}
+
+ ) : (
+
+ {faqs.map((faq, idx) => {
+ const isOpen = openIndex === idx;
+ return (
+
+
+
+
+ {isOpen && (
+
+
+ {faq.answer}
+
+
+ )}
+
+
+ );
+ })}
+
+ )}
+
+
+ );
+}
diff --git a/frontend/application/components/TestimonialsSection.tsx b/frontend/application/components/TestimonialsSection.tsx
index 7c7a83fd..76d10521 100644
--- a/frontend/application/components/TestimonialsSection.tsx
+++ b/frontend/application/components/TestimonialsSection.tsx
@@ -26,7 +26,7 @@ export default function TestimonialsSection() {
async function loadTestimonials() {
try {
setIsLoading(true);
- const res = await api.get('/testimonials');
+ const res = await api.get('/testimonials/homepage');
const raw = res.data;
const list = Array.isArray(raw?.testimonials)
? raw.testimonials
@@ -46,6 +46,7 @@ export default function TestimonialsSection() {
}
}
loadTestimonials();
+
}, []);
if (!isLoading && testimonials.length === 0) {
diff --git a/frontend/application/components/UserDashboard.tsx b/frontend/application/components/UserDashboard.tsx
index a62408a0..f34cb7ff 100644
--- a/frontend/application/components/UserDashboard.tsx
+++ b/frontend/application/components/UserDashboard.tsx
@@ -26,7 +26,7 @@ export default function UserDashboard() {
const { pets, activePetId, setActivePet, removePet } = usePetStore();
const isWithdrawalEnabled = useSettingsStore((s) => s.getBoolean('wallet_withdrawal_enabled', false));
const isCatalogMode = useSettingsStore((s) => s.getBoolean('catalog_mode', false));
- const isWalletRechargeAllowed = !isCatalogMode && useSettingsStore((s) => s.getBoolean('wallet_recharge_enabled', true));
+ const isWalletRechargeAllowed = useSettingsStore((s) => !s.getBoolean('catalog_mode', false) && s.getBoolean('wallet_recharge_enabled', true));
React.useEffect(() => {
if (!isLoggedIn && typeof window !== "undefined") {
@@ -216,6 +216,15 @@ export default function UserDashboard() {
};
}, [profile]);
+ // Password Management State
+ const [currentPassword, setCurrentPassword] = useState("");
+ const [newPassword, setNewPassword] = useState("");
+ const [confirmPassword, setConfirmPassword] = useState("");
+ const [showCurrentPass, setShowCurrentPass] = useState(false);
+ const [showNewPass, setShowNewPass] = useState(false);
+ const [showConfirmPass, setShowConfirmPass] = useState(false);
+ const [isSavingPassword, setIsSavingPassword] = useState(false);
+
if (!isLoggedIn) {
return null;
}
@@ -240,14 +249,6 @@ export default function UserDashboard() {
}
};
- // Password Management State
- const [currentPassword, setCurrentPassword] = useState("");
- const [newPassword, setNewPassword] = useState("");
- const [confirmPassword, setConfirmPassword] = useState("");
- const [showCurrentPass, setShowCurrentPass] = useState(false);
- const [showNewPass, setShowNewPass] = useState(false);
- const [showConfirmPass, setShowConfirmPass] = useState(false);
- const [isSavingPassword, setIsSavingPassword] = useState(false);
const handleSavePassword = async (e: React.FormEvent) => {
e.preventDefault();
diff --git a/frontend/application/eslint.config.mjs b/frontend/application/eslint.config.mjs
index 05e726d1..f4ca99b3 100644
--- a/frontend/application/eslint.config.mjs
+++ b/frontend/application/eslint.config.mjs
@@ -13,6 +13,15 @@ const eslintConfig = defineConfig([
"build/**",
"next-env.d.ts",
]),
+ {
+ rules: {
+ "@typescript-eslint/no-explicit-any": "warn",
+ "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
+ "react-hooks/set-state-in-effect": "off",
+ "react-hooks/exhaustive-deps": "warn",
+ },
+ },
]);
export default eslintConfig;
+