Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { auth } from "@/lib/auth";
import { headers } from "next/headers";
import { redirect } from "next/navigation";
import { LandingPage } from "@/components/landing-page";

// Redirect to dashboard - middleware will handle authentication
export default function Home() {
redirect("/dashboard");
export default async function Home() {
const session = await auth.api.getSession({
headers: await headers(),
});

if (session) {
redirect("/dashboard");
}

return <LandingPage />;
}
110 changes: 110 additions & 0 deletions components/landing-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
"use client";

import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import {
LayoutDashboard,
Shield,
Table2,
Palette,
ArrowRight,
} from "lucide-react";
import Link from "next/link";

const features = [
{
icon: Shield,
title: "用户认证",
description: "基于 Better-Auth 的完整认证系统,支持邮箱/社交登录",
},
{
icon: LayoutDashboard,
title: "仪表盘",
description: "丰富的数据可视化组件,支持交互式图表和实时数据展示",
},
{
icon: Table2,
title: "数据表格",
description: "强大的表格管理功能,支持排序、筛选、分页等操作",
},
{
icon: Palette,
title: "主题定制",
description: "内置明暗模式切换,支持自定义主题色彩和字体配置",
},
];

const techStack = [
"Next.js 16",
"React 19",
"TypeScript",
"Tailwind CSS",
"Shadcn UI",
"Better-Auth",
"Drizzle ORM",
"PostgreSQL",
];

export function LandingPage() {
return (
<div className="flex min-h-screen flex-col">
<main className="flex flex-1 flex-col items-center justify-center px-4 py-16">
<div className="mx-auto max-w-3xl text-center">
<div className="mb-8 flex justify-center">
<div className="bg-primary text-primary-foreground flex h-16 w-16 items-center justify-center rounded-xl text-2xl font-bold">
SA
</div>
</div>

<h1 className="mb-4 text-4xl font-bold tracking-tight sm:text-5xl">
Shadcn Admin
</h1>

<p className="text-muted-foreground mb-8 text-lg">
基于 Next.js 和 Shadcn UI 的现代化后台管理系统
</p>

<div className="mb-12 flex flex-wrap justify-center gap-2">
{techStack.map((tech) => (
<span
key={tech}
className="bg-secondary text-secondary-foreground rounded-full px-3 py-1 text-sm"
>
{tech}
</span>
))}
</div>

<Link href="/sign-in">
<Button size="lg" className="gap-2">
登录后台
<ArrowRight className="h-4 w-4" />
</Button>
</Link>
</div>

<div className="mx-auto mt-16 grid max-w-5xl gap-4 sm:grid-cols-2 lg:grid-cols-4">
{features.map((feature) => (
<Card key={feature.title} className="border-border/50">
<CardContent className="pt-6">
<div className="mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10">
<feature.icon className="h-5 w-5 text-primary" />
</div>
<h3 className="mb-2 font-semibold">{feature.title}</h3>
<p className="text-muted-foreground text-sm">
{feature.description}
</p>
</CardContent>
</Card>
))}
</div>
</main>

<footer className="border-t py-6">
<div className="text-muted-foreground text-center text-sm">
Shadcn Admin Dashboard · 开源后台管理解决方案
</div>
</footer>
</div>
);
}