import { Button } from "@repo/ui/shadcn/button"; import { auth, signIn, signOut } from "../../server/auth"; import { db } from "../../server/db"; import { sql } from "drizzle-orm"; import { users } from "../../server/db/schema"; import { getThemeToggler } from "../../lib/get-theme-button"; export const runtime = "edge"; export default async function Page() { const usr = await auth(); const userCount = await db .select({ count: sql`count(*)`.mapWith(Number), }) .from(users); const SetThemeButton = getThemeToggler(); return (
{" "} Cloudflare Next Saas Starter
Start by editing apps/web/page.tsx
Welcome to Cloudflare Next Saas Starter.
Built a full stack app using production-ready tools and frameworks, host on Cloudflare instantly.
An opinionated, batteries-included framework with{" "} Turborepo {" "} and Nextjs. Fully Typesafe. Best practices followed by default.

Here's what the stack includes:
  • Authentication with next-auth
  • Database using Cloudflare's D1 serverless databases
  • Drizzle ORM, already connected to your database and auth ⚡
  • Light/darkmode theming that works with server components (!)
  • Styling using TailwindCSS and ShadcnUI
  • Turborepo with a landing page and shared components
  • Cloudflare wrangler for quick functions on the edge
  • ... best part: everything's already set up for you. Just code!
Number of users in database: {userCount[0]!.count}
{usr?.user?.email ? ( <>
Hello {usr.user.name} 👋 {usr.user.email}
{ "use server"; await signOut(); }} >
) : (
{ "use server"; await signIn("google"); }} >
)}
); }