diff --git a/src/app/page.tsx b/src/app/page.tsx index d3be96c..9343a8d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,36 +1,17 @@ -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; -import { Separator } from "@/components/ui/separator"; -import { getNews, getSkills, getMcpServers, getLlmsTxtEntries, getAgents, getFeaturedAgents, formatAgentHandle, getAcpAgents, getRecentSubmissions, getCreators, type Skill } from "@/lib/data"; -import { getSupabase } from "@/lib/supabase"; import Link from "next/link"; -import { MobileNav } from "@/components/mobile-nav"; -import { ThemeToggle } from "@/components/theme-toggle"; -import { NewsFeed } from "@/components/news-feed"; -import { RecentSubmissions } from "@/components/recent-submissions"; -import { AnnouncementBanner } from "@/components/announcement-banner"; -import { Footer } from "@/components/footer"; -import { ResumeSection } from "@/components/recently-viewed/ResumeSection"; -import { AgentBootstrapPanel } from "@/components/agent-bootstrap-panel"; -import { NewsletterSignup } from "@/components/newsletter-signup"; -import { InstallCount } from "@/components/InstallCount"; -import { TestimonialCarousel } from "@/components/TestimonialCarousel"; +import { getNews, getMcpServers } from "@/lib/data"; +import { getSupabase } from "@/lib/supabase"; export const revalidate = 300; export const metadata = { title: "forAgents.dev — The MCP Server Registry", - description: "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", + description: + "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", openGraph: { title: "forAgents.dev — The MCP Server Registry", - description: "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", + description: + "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", url: "https://foragents.dev", siteName: "forAgents.dev", type: "website", @@ -38,26 +19,42 @@ export const metadata = { twitter: { card: "summary_large_image", title: "forAgents.dev — The MCP Server Registry", - description: "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", + description: + "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", }, }; -// Simple trending score algorithm (same as /trending page) -function calculateTrendingScore(skill: Skill): number { - let score = 0; - score += skill.tags.length * 10; - if (skill.author === "Team Reflectt") { - score += 20; - } - score += Math.max(0, 50 - skill.name.length); - score += Math.random() * 15; - return score; +function formatCompact(value?: number): string { + if (!value) return "—"; + if (value >= 1000000) return `${(value / 1000000).toFixed(1)}m`; + if (value >= 1000) return `${(value / 1000).toFixed(1)}k`; + return `${value}`; +} + +function prettifyCategory(category: string): string { + return category + .split("-") + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" "); +} + +function categoryIcon(category: string): string { + const icons: Record = { + "file-system": "📁", + web: "🌐", + "dev-tools": "🔧", + productivity: "⚡", + communication: "💬", + data: "🗄️", + }; + + return icons[category] ?? "🧩"; } export default async function Home() { - // Prefer Supabase-backed news when available; fall back to bundled JSON. let news = getNews(); const supabase = getSupabase(); + if (supabase) { const { data, error } = await supabase .from("news") @@ -66,894 +63,246 @@ export default async function Home() { .limit(100); if (!error && data && data.length > 0) { - // Supabase shape matches NewsItem. news = data as typeof news; } } - const skills = getSkills(); + const mcpServers = getMcpServers(); - const llmsTxtEntries = getLlmsTxtEntries(); - const agents = getAgents(); - const featuredAgents = getFeaturedAgents(); - const acpAgents = getAcpAgents(); - const recentSubmissions = await getRecentSubmissions(5); - const creators = getCreators(); - const topCreators = creators.slice(0, 6); - const trendingSkills = skills - .map(skill => ({ ...skill, trendingScore: calculateTrendingScore(skill) })) - .sort((a, b) => b.trendingScore - a.trendingScore) - .slice(0, 6); + const categoryCount = new Set(mcpServers.map((server) => server.category)).size; const jsonLd = { "@context": "https://schema.org", "@type": "WebSite", - "name": "forAgents.dev", - "alternateName": "Agent Hub", - "url": "https://foragents.dev", - "description": "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", - "potentialAction": { + name: "forAgents.dev", + alternateName: "Agent Hub", + url: "https://foragents.dev", + description: + "The MCP server registry for AI agents. Find and install MCP servers, agent skills, and tools.", + potentialAction: { "@type": "SearchAction", - "target": { + target: { "@type": "EntryPoint", - "urlTemplate": "https://foragents.dev/search?q={search_term_string}" + urlTemplate: "https://foragents.dev/search?q={search_term_string}", }, - "query-input": "required name=search_term_string" + "query-input": "required name=search_term_string", }, - "publisher": { + publisher: { "@type": "Organization", - "name": "Team Reflectt", - "url": "https://reflectt.ai" - } + name: "Team Reflectt", + url: "https://reflectt.ai", + }, }; + const filterTags = ["All", "Official", "Database", "Browser", "Files", "APIs"]; + return ( -
+