Skip to content

Commit 9bef2fe

Browse files
committed
Init from v0
1 parent 42b19ca commit 9bef2fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+6556
-0
lines changed

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# next.js
7+
/.next/
8+
/out/
9+
10+
# production
11+
/build
12+
13+
# debug
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
.pnpm-debug.log*
18+
19+
# env files
20+
.env*
21+
22+
# vercel
23+
.vercel
24+
25+
# typescript
26+
*.tsbuildinfo
27+
next-env.d.ts

app/[lang]/contribute/page.tsx

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
import { type Locale, locales } from "@/lib/i18n/config"
2+
import { getTranslation } from "@/lib/i18n/translations"
3+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
4+
import { Button } from "@/components/ui/button"
5+
import { ExternalLink, Github, MessageSquare, GitPullRequest, FileCode } from "lucide-react"
6+
7+
export function generateStaticParams() {
8+
return locales.map((lang) => ({ lang }))
9+
}
10+
11+
export default function ContributePage({ params }: { params: { lang: Locale } }) {
12+
const t = (key: Parameters<typeof getTranslation>[1]) => getTranslation(params.lang, key)
13+
14+
return (
15+
<div className="py-12 md:py-16">
16+
<div className="container px-4 md:px-6">
17+
<div className="flex flex-col items-center text-center space-y-4 mb-8 md:mb-12">
18+
<h1 className="text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl">{t("contribute.title")}</h1>
19+
<p className="mx-auto max-w-[700px] text-muted-foreground md:text-xl">{t("contribute.subtitle")}</p>
20+
</div>
21+
22+
<div className="grid gap-6 md:grid-cols-2 lg:gap-8">
23+
<Card>
24+
<CardHeader>
25+
<CardTitle className="flex items-center gap-2">
26+
<FileCode className="h-5 w-5" />
27+
{t("contribute.guide")}
28+
</CardTitle>
29+
<CardDescription>了解如何为 BayOSS 项目做出贡献</CardDescription>
30+
</CardHeader>
31+
<CardContent>
32+
<p className="mb-4 text-muted-foreground">
33+
我们欢迎所有形式的贡献,无论是代码、文档、设计还是想法。请查看我们的贡献指南,了解如何开始。
34+
</p>
35+
<Button asChild>
36+
<a
37+
href="https://github.com/bayoss/community/blob/main/CONTRIBUTING.md"
38+
target="_blank"
39+
rel="noopener noreferrer"
40+
className="flex items-center gap-2"
41+
>
42+
<span>查看贡献指南</span>
43+
<ExternalLink className="h-4 w-4" />
44+
</a>
45+
</Button>
46+
</CardContent>
47+
</Card>
48+
49+
<Card>
50+
<CardHeader>
51+
<CardTitle className="flex items-center gap-2">
52+
<Github className="h-5 w-5" />
53+
{t("contribute.codeOfConduct")}
54+
</CardTitle>
55+
<CardDescription>了解我们的社区行为准则</CardDescription>
56+
</CardHeader>
57+
<CardContent>
58+
<p className="mb-4 text-muted-foreground">
59+
我们致力于为所有人提供一个友好、安全和包容的环境。请阅读我们的行为准则,了解我们的期望和价值观。
60+
</p>
61+
<Button asChild>
62+
<a
63+
href="https://github.com/bayoss/community/blob/main/CODE_OF_CONDUCT.md"
64+
target="_blank"
65+
rel="noopener noreferrer"
66+
className="flex items-center gap-2"
67+
>
68+
<span>查看行为准则</span>
69+
<ExternalLink className="h-4 w-4" />
70+
</a>
71+
</Button>
72+
</CardContent>
73+
</Card>
74+
75+
<Card>
76+
<CardHeader>
77+
<CardTitle className="flex items-center gap-2">
78+
<GitPullRequest className="h-5 w-5" />
79+
{t("contribute.pullRequests")}
80+
</CardTitle>
81+
<CardDescription>提交代码贡献</CardDescription>
82+
</CardHeader>
83+
<CardContent>
84+
<p className="mb-4 text-muted-foreground">
85+
如果你想为我们的项目贡献代码,可以通过提交 Pull Request
86+
来实现。请确保你的代码符合我们的代码规范和贡献指南。
87+
</p>
88+
<Button asChild>
89+
<a
90+
href="https://github.com/bayoss"
91+
target="_blank"
92+
rel="noopener noreferrer"
93+
className="flex items-center gap-2"
94+
>
95+
<span>浏览项目</span>
96+
<ExternalLink className="h-4 w-4" />
97+
</a>
98+
</Button>
99+
</CardContent>
100+
</Card>
101+
102+
<Card>
103+
<CardHeader>
104+
<CardTitle className="flex items-center gap-2">
105+
<MessageSquare className="h-5 w-5" />
106+
{t("contribute.discussions")}
107+
</CardTitle>
108+
<CardDescription>参与社区讨论</CardDescription>
109+
</CardHeader>
110+
<CardContent>
111+
<p className="mb-4 text-muted-foreground">
112+
加入我们的社区讨论,分享你的想法,提出问题,或者与其他社区成员交流。我们欢迎所有形式的参与和反馈。
113+
</p>
114+
<Button asChild>
115+
<a
116+
href="https://github.com/bayoss/community/discussions"
117+
target="_blank"
118+
rel="noopener noreferrer"
119+
className="flex items-center gap-2"
120+
>
121+
<span>参与讨论</span>
122+
<ExternalLink className="h-4 w-4" />
123+
</a>
124+
</Button>
125+
</CardContent>
126+
</Card>
127+
</div>
128+
</div>
129+
</div>
130+
)
131+
}
132+

app/[lang]/layout.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import type React from "react"
2+
import { Navbar } from "@/components/navbar"
3+
import { Footer } from "@/components/footer"
4+
import { type Locale, locales } from "@/lib/i18n/config"
5+
import { headers } from "next/headers"
6+
7+
export function generateStaticParams() {
8+
return locales.map((lang) => ({ lang }))
9+
}
10+
11+
export default function LocaleLayout({
12+
children,
13+
params,
14+
}: {
15+
children: React.ReactNode
16+
params: { lang: Locale }
17+
}) {
18+
const headersList = headers()
19+
const pathname = headersList.get("x-pathname") || ""
20+
21+
return (
22+
<>
23+
<Navbar locale={params.lang} pathname={pathname} />
24+
<main className="flex-1">{children}</main>
25+
<Footer />
26+
</>
27+
)
28+
}
29+

app/[lang]/page.tsx

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { Button } from "@/components/ui/button"
2+
import Link from "next/link"
3+
import { type Locale, locales } from "@/lib/i18n/config"
4+
import { getTranslation } from "@/lib/i18n/translations"
5+
6+
export function generateStaticParams() {
7+
return locales.map((lang) => ({ lang }))
8+
}
9+
10+
export default function HomePage({ params }: { params: { lang: Locale } }) {
11+
const t = (key: Parameters<typeof getTranslation>[1]) => getTranslation(params.lang, key)
12+
13+
return (
14+
<div className="flex flex-col min-h-screen">
15+
<section className="py-12 md:py-16 lg:py-20 bg-gradient-to-b from-primary/10 to-background">
16+
<div className="container px-4 md:px-6">
17+
<div className="flex flex-col items-center text-center space-y-4">
18+
<h1 className="text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl lg:text-6xl">
19+
{t("home.title")}
20+
</h1>
21+
<p className="mx-auto max-w-[700px] text-muted-foreground md:text-xl">{t("home.subtitle")}</p>
22+
<div className="space-x-4">
23+
<Button asChild size="lg">
24+
<Link href={`/${params.lang}/projects`}>{t("nav.projects")}</Link>
25+
</Button>
26+
<Button asChild variant="outline" size="lg">
27+
<Link href={`/${params.lang}/contribute`}>{t("nav.contribute")}</Link>
28+
</Button>
29+
</div>
30+
</div>
31+
</div>
32+
</section>
33+
34+
<section className="py-12 md:py-16">
35+
<div className="container px-4 md:px-6">
36+
<div className="grid gap-6 lg:grid-cols-2 lg:gap-12">
37+
<div className="space-y-4">
38+
<h2 className="text-2xl font-bold tracking-tighter sm:text-3xl">关于 BayOSS</h2>
39+
<p className="text-muted-foreground">{t("home.about")}</p>
40+
</div>
41+
<div className="space-y-4">
42+
<h2 className="text-2xl font-bold tracking-tighter sm:text-3xl">{t("home.join")}</h2>
43+
<ul className="space-y-2 text-muted-foreground">
44+
<li>
45+
1. 关注我们的 GitHub 组织:{" "}
46+
<a
47+
href="https://github.com/bayoss"
48+
target="_blank"
49+
rel="noopener noreferrer"
50+
className="text-primary hover:underline"
51+
>
52+
github.com/bayoss
53+
</a>
54+
</li>
55+
<li>
56+
2. 加入我们的社区讨论:{" "}
57+
<a
58+
href="https://github.com/bayoss/community/discussions"
59+
target="_blank"
60+
rel="noopener noreferrer"
61+
className="text-primary hover:underline"
62+
>
63+
Community Discussions
64+
</a>
65+
</li>
66+
<li>3. 参与我们的开源项目贡献</li>
67+
<li>4. 分享你的想法和建议</li>
68+
</ul>
69+
<Button asChild>
70+
<a href="https://github.com/bayoss" target="_blank" rel="noopener noreferrer">
71+
{t("home.joinButton")}
72+
</a>
73+
</Button>
74+
</div>
75+
</div>
76+
</div>
77+
</section>
78+
</div>
79+
)
80+
}
81+

app/[lang]/projects/page.tsx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { type Locale, locales } from "@/lib/i18n/config"
2+
import { getTranslation } from "@/lib/i18n/translations"
3+
import { getOrganizationRepos, type RepoType } from "@/lib/github"
4+
import { ProjectCard } from "@/components/project-card"
5+
import { ProjectFilter } from "@/components/project-filter"
6+
7+
export function generateStaticParams() {
8+
return locales.map((lang) => ({ lang }))
9+
}
10+
11+
export interface ProjectsPageProps {
12+
params: { lang: Locale }
13+
searchParams: { type?: RepoType }
14+
}
15+
16+
export default async function ProjectsPage({ params, searchParams }: ProjectsPageProps) {
17+
const t = (key: Parameters<typeof getTranslation>[1]) => getTranslation(params.lang, key)
18+
19+
// Get the repo type from search params or default to 'all'
20+
const repoType: RepoType = (searchParams.type as RepoType) || "all"
21+
22+
// Fetch projects with the selected filter
23+
const projects = await getOrganizationRepos("bayoss", repoType)
24+
25+
return (
26+
<div className="py-12 md:py-16">
27+
<div className="container px-4 md:px-6">
28+
<div className="flex flex-col items-center text-center space-y-4 mb-8 md:mb-12">
29+
<h1 className="text-3xl font-bold tracking-tighter sm:text-4xl md:text-5xl">{t("projects.title")}</h1>
30+
<p className="mx-auto max-w-[700px] text-muted-foreground md:text-xl">{t("projects.subtitle")}</p>
31+
</div>
32+
33+
{/* Project Filter */}
34+
<ProjectFilter currentType={repoType} locale={params.lang} />
35+
36+
{projects.length > 0 ? (
37+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
38+
{projects.map((project) => (
39+
<ProjectCard key={project.id} project={project} locale={params.lang} />
40+
))}
41+
</div>
42+
) : (
43+
<div className="text-center py-12">
44+
<p className="text-muted-foreground">{t("projects.noProjects")}</p>
45+
</div>
46+
)}
47+
</div>
48+
</div>
49+
)
50+
}
51+

app/globals.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@layer base {
6+
:root {
7+
--background: 0 0% 100%;
8+
--foreground: 222.2 84% 4.9%;
9+
--card: 0 0% 100%;
10+
--card-foreground: 222.2 84% 4.9%;
11+
--popover: 0 0% 100%;
12+
--popover-foreground: 222.2 84% 4.9%;
13+
--primary: 221.2 83.2% 53.3%;
14+
--primary-foreground: 210 40% 98%;
15+
--secondary: 210 40% 96.1%;
16+
--secondary-foreground: 222.2 47.4% 11.2%;
17+
--muted: 210 40% 96.1%;
18+
--muted-foreground: 215.4 16.3% 46.9%;
19+
--accent: 210 40% 96.1%;
20+
--accent-foreground: 222.2 47.4% 11.2%;
21+
--destructive: 0 84.2% 60.2%;
22+
--destructive-foreground: 210 40% 98%;
23+
--border: 214.3 31.8% 91.4%;
24+
--input: 214.3 31.8% 91.4%;
25+
--ring: 221.2 83.2% 53.3%;
26+
--radius: 0.5rem;
27+
}
28+
29+
.dark {
30+
--background: 222.2 84% 4.9%;
31+
--foreground: 210 40% 98%;
32+
--card: 222.2 84% 4.9%;
33+
--card-foreground: 210 40% 98%;
34+
--popover: 222.2 84% 4.9%;
35+
--popover-foreground: 210 40% 98%;
36+
--primary: 217.2 91.2% 59.8%;
37+
--primary-foreground: 222.2 47.4% 11.2%;
38+
--secondary: 217.2 32.6% 17.5%;
39+
--secondary-foreground: 210 40% 98%;
40+
--muted: 217.2 32.6% 17.5%;
41+
--muted-foreground: 215 20.2% 65.1%;
42+
--accent: 217.2 32.6% 17.5%;
43+
--accent-foreground: 210 40% 98%;
44+
--destructive: 0 62.8% 30.6%;
45+
--destructive-foreground: 210 40% 98%;
46+
--border: 217.2 32.6% 17.5%;
47+
--input: 217.2 32.6% 17.5%;
48+
--ring: 224.3 76.3% 48%;
49+
}
50+
}
51+
52+
@layer base {
53+
* {
54+
@apply border-border;
55+
}
56+
body {
57+
@apply bg-background text-foreground;
58+
}
59+
}
60+

0 commit comments

Comments
 (0)