From 02fe60178a61d61792a1eab63b9c56c85f6b4fe7 Mon Sep 17 00:00:00 2001
From: "gpt-engineer-app[bot]"
<159125892+gpt-engineer-app[bot]@users.noreply.github.com>
Date: Tue, 31 Mar 2026 10:36:56 +0000
Subject: [PATCH] Added CurseForge edge proxy
Co-authored-by: felix-fx-top <253056634+felix-fx-top@users.noreply.github.com>
---
src/components/ModGrid.tsx | 1 +
src/pages/Index.tsx | 26 +++++++++++++++++++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/src/components/ModGrid.tsx b/src/components/ModGrid.tsx
index 323932a..1c8bfc3 100644
--- a/src/components/ModGrid.tsx
+++ b/src/components/ModGrid.tsx
@@ -15,6 +15,7 @@ interface Mod {
followers: number;
categories: string[];
project_type: string;
+ source?: "modrinth" | "curseforge";
}
interface ModGridProps {
diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx
index 08ff994..8bf638d 100644
--- a/src/pages/Index.tsx
+++ b/src/pages/Index.tsx
@@ -4,7 +4,7 @@ import Navbar from "@/components/Navbar";
import HeroSection from "@/components/HeroSection";
import ModGrid from "@/components/ModGrid";
import Footer from "@/components/Footer";
-import { getUserProjects, searchMods, getRandomKeyword } from "@/lib/api";
+import { getUserProjects, searchMods, searchCurseForge, getRandomKeyword } from "@/lib/api";
const Index = () => {
const randomKeyword = useMemo(() => getRandomKeyword(), []);
@@ -22,6 +22,11 @@ const Index = () => {
queryFn: () => searchMods(randomKeyword, 0, 12),
});
+ const { data: cfData, isLoading: loadingCF } = useQuery({
+ queryKey: ["curseforge-discover", randomKeyword],
+ queryFn: () => searchCurseForge(randomKeyword, 0, 12),
+ });
+
const discoverMods = discoverData?.hits?.map((hit: any) => ({
id: hit.project_id,
slug: hit.slug,
@@ -32,6 +37,20 @@ const Index = () => {
followers: hit.follows,
categories: hit.categories || [],
project_type: hit.project_type,
+ source: "modrinth" as const,
+ })) || [];
+
+ const curseForgeMods = cfData?.data?.map((mod: any) => ({
+ id: String(mod.id),
+ slug: String(mod.id),
+ title: mod.name,
+ description: mod.summary,
+ icon_url: mod.logo?.url,
+ downloads: mod.downloadCount,
+ followers: mod.thumbsUpCount || 0,
+ categories: mod.categories?.map((c: any) => c.name) || [],
+ project_type: "mod",
+ source: "curseforge" as const,
})) || [];
return (
@@ -50,6 +69,11 @@ const Index = () => {
mods={discoverMods}
isLoading={loadingDiscover}
/>
+