// app/page.tsx
// Homepage - navbar/footer now in layout.tsx
import Link from 'next/link';
import { query } from '@/lib/db';
import { TrophyIcon, ChartIcon, CircleIcon, UsersIcon, ServerIcon, ActivityIcon } from '@/components/ui/icons';
export const dynamic = "force-dynamic";
async function getStats() {
const driversOnline = await query(`
SELECT COUNT(*) as count
FROM users
WHERE is_connect = true
`);
const totalDrivers = await query(`
SELECT COUNT(*) as count
FROM users
`);
const activeServers = await query(`
SELECT COUNT(DISTINCT server_id) as count
FROM servers
WHERE connected_players > 0
`);
return {
driversOnline: driversOnline[0]?.count || 0,
totalDrivers: totalDrivers[0]?.count || 0,
activeServers: activeServers[0]?.count || 0,
};
}
export default async function HomePage() {
const stats = await getStats();
return (
<>
{/* Hero */}
{/* Logo */}
{/* Tagline */}
FREE RACING.
NO BARRIERS.
Join our community of passionate racers. Compete in multiple leagues,
track your progress, and race for free on dedicated infrastructure.
{/* CTA */}
{/* Live Stats */}
}
/>
}
/>
}
/>
{/* Features Grid */}
INFRASTRUCTURE
Everything required for competitive sim racing
}
title="MULTIPLE LEAGUES"
description="Progress through skill-based divisions. C-Class to Pro level competition across all disciplines."
/>
}
title="LIVE RANKINGS"
description="Real-time performance tracking. Transparent ELO system with historical data and statistics."
/>
}
title="FREE ACCESS"
description="No subscriptions. No hidden costs. Open infrastructure for the racing community."
/>
}
title="WEATHER SYSTEMS"
description="Dynamic conditions. Rain, dry, variable grip. Test your adaptability in all scenarios."
/>
}
title="MULTIPLE CLASSES"
description="MX5, GT4, GT3 categories. Different cars for different racing philosophies and styles."
/>
}
title="ACTIVE COMMUNITY"
description="Discord integration. Event organization, race coordination, and community engagement tools."
/>
{/* System Status */}
>
);
}
function LiveStatCard({
value,
label,
icon
}: {
value: number;
label: string;
icon: React.ReactNode;
}) {
return (
{value.toLocaleString()}
{label}
);
}
function FeatureCard({
icon,
title,
description
}: {
icon: React.ReactNode;
title: string;
description: string;
}) {
return (
{icon}
{title}
{description}
);
}