diff --git a/docs/app/page.tsx b/docs/app/page.tsx index 7c2abddf..ab33f637 100644 --- a/docs/app/page.tsx +++ b/docs/app/page.tsx @@ -1,7 +1,28 @@ import Section from "@/components/landing/section"; import Hero from "@/components/landing/hero"; import Features from "@/components/features"; -export default function HomePage() { +async function getGitHubStars() { + try { + const response = await fetch( + "https://api.github.com/repos/better-auth/better-auth", + { + next: { + revalidate: 60, + }, + }, + ); + if (!response?.ok) { + return null; + } + const json = await response.json(); + const stars = parseInt(json.stargazers_count).toLocaleString(); + return stars; + } catch { + return null; + } +} +export default async function HomePage() { + const stars = await getGitHubStars(); return (
- +
diff --git a/docs/components/features.tsx b/docs/components/features.tsx index ad57cc31..f3f639ec 100644 --- a/docs/components/features.tsx +++ b/docs/components/features.tsx @@ -1,14 +1,14 @@ "use client"; import { - CheckIcon, - Globe2Icon, - PlugIcon, - PlugZap2Icon, - Plus, - RabbitIcon, - ShieldCheckIcon, - Webhook, - XIcon, + CheckIcon, + Globe2Icon, + PlugIcon, + PlugZap2Icon, + Plus, + RabbitIcon, + ShieldCheckIcon, + Webhook, + XIcon, } from "lucide-react"; import { GitHubLogoIcon, LockClosedIcon } from "@radix-ui/react-icons"; import Link from "next/link"; @@ -16,209 +16,191 @@ import { Button } from "./ui/button"; import React, { useState } from "react"; import { TechStackDisplay } from "./display-techstack"; import { Ripple } from "./ripple"; +import { GithubStat } from "./github-stat"; -export default function Features() { - return ( -
- -
-
- +export default function Features({ stars }: { stars: string | null }) { + return ( +
+ +
+
+ -
- -

- Framework Agnostic{" "} -

-
-
-
-
-

- Supports popular frameworks -

-
-
-

- Supports your favorite frontend, backend and meta frameworks, - including React, Vue, Svelte, Astro, Solid, Next.js, Nuxt.js, - Hono, and more{" "} - - Learn more - -

-
-
-
- +
+ +

+ Framework Agnostic{" "} +

+
+
+
+
+

+ Supports popular frameworks +

+
+
+

+ Supports your favorite frontend, backend and meta frameworks, + including React, Vue, Svelte, Astro, Solid, Next.js, Nuxt.js, + Hono, and more{" "} + + Learn more + +

+
+
+
+ -
- -

Authentication

-
-
-
-
-

- Email & Password Authentication -

-
-
-

- Builtin support for email and password authentication, with secure - password hashing and account management features{" "} - - Learn more - -

-
-
-
- +
+ +

Authentication

+
+
+
+
+

+ Email & Password Authentication +

+
+
+

+ Builtin support for email and password authentication, with secure + password hashing and account management features{" "} + + Learn more + +

+
+
+
+ -
- -

Social Sign-on

-
-
-
-
-

- Support multiple OAuth providers. -

-
-
-

- Allow users to sign in with their accounts, including Github, - Google, Discord, Twitter, and more.{" "} - - Learn more - -

-
-
-
-
- -

Two Factor

-
-
-
-
-

- Two Factor Authentication -

-
-
-

- With our built-in two factor authentication plugin, you can add an - extra layer of security to your account.{" "} - - Learn more - -

-
-
-
-
- -

- Organization & Access Control{" "} -

-
-
-
-
-

- Gain and manage access. -

-
-
-

- Manage users and their access to resources within your - application.{" "} - - Learn more - -

-
-
-
-
- -

- Plugin Ecosystem{" "} -

-
-
-
-

- Pluggable with custom. -

-
-
-
-

- Enhance your application with our official plugins and those - created by the community.{" "} - - Learn more - -

-
-
-
-
-
-
- -

- Own your auth -

-
-

- Roll your own auth with confidence in minutes! -

-
- -
-
- - - - - - -
- -
-
-
-
-
- ); +
+ +

Social Sign-on

+
+
+
+
+

+ Support multiple OAuth providers. +

+
+
+

+ Allow users to sign in with their accounts, including Github, + Google, Discord, Twitter, and more.{" "} + + Learn more + +

+
+
+
+
+ +

Two Factor

+
+
+
+
+

+ Two Factor Authentication +

+
+
+

+ With our built-in two factor authentication plugin, you can add an + extra layer of security to your account.{" "} + + Learn more + +

+
+
+
+
+ +

+ Organization & Access Control{" "} +

+
+
+
+
+

+ Gain and manage access. +

+
+
+

+ Manage users and their access to resources within your + application.{" "} + + Learn more + +

+
+
+
+
+ +

+ Plugin Ecosystem{" "} +

+
+
+
+

+ Pluggable with custom. +

+
+
+
+

+ Enhance your application with our official plugins and those + created by the community.{" "} + + Learn more + +

+
+
+
+
+
+
+ +

+ Own your auth +

+
+

+ Roll your own auth with confidence in minutes! +

+
+ +
+
+ +
+ +
+
+
+
+
+ ); } diff --git a/docs/components/github-stat.tsx b/docs/components/github-stat.tsx new file mode 100644 index 00000000..a04ebde0 --- /dev/null +++ b/docs/components/github-stat.tsx @@ -0,0 +1,35 @@ +export function GithubStat({ stars }: { stars: string | null }) { + return ( + + +
+ + + + Star on GitHub +
+
+ + + {stars} + +
+
+ ); +}