A Next.js application with TypeScript, Tailwind CSS, shadcn/ui, Supabase, Zustand, and Clerk authentication.
- Next.js 16 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - High-quality React components
- Supabase - Backend as a service (database, auth, storage)
- Zustand - Lightweight state management
- Clerk - Authentication and user management
- Node.js 18+ and npm
- Clerk account (sign up here)
- Supabase account (sign up here)
- Clone the repository and install dependencies:
npm install- Set up environment variables:
Copy .env.local.example to .env.local and fill in your credentials:
cp .env.local.example .env.localUpdate .env.local with your actual keys:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key- Go to Clerk Dashboard
- Create a new application or select an existing one
- Copy your Publishable Key and Secret Key from the API Keys section
- Go to Supabase Dashboard
- Create a new project or select an existing one
- Go to Settings → API
- Copy your Project URL and anon/public key
npm run devOpen http://localhost:3000 with your browser to see the result.
├── app/ # Next.js App Router pages
│ ├── layout.tsx # Root layout with ClerkProvider
│ ├── page.tsx # Home page
│ └── globals.css # Global styles
├── components/ # React components
│ └── ui/ # shadcn/ui components
├── lib/ # Utility functions and configurations
│ ├── supabase/ # Supabase client setup
│ │ ├── client.ts # Browser client
│ │ └── server.ts # Server client
│ ├── store/ # Zustand stores
│ │ └── useStore.ts # Example store
│ └── utils.ts # Utility functions
├── middleware.ts # Clerk middleware for route protection
└── components.json # shadcn/ui configuration
Client Component:
import { createClient } from '@/lib/supabase/client'
const supabase = createClient()
const { data } = await supabase.from('table').select()Server Component:
import { createClient } from '@/lib/supabase/server'
const supabase = await createClient()
const { data } = await supabase.from('table').select()import { useStore } from '@/lib/store/useStore'
function MyComponent() {
const { count, increment, decrement } = useStore()
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
)
}import { useUser } from '@clerk/nextjs'
function Profile() {
const { user } = useUser()
return <div>Hello, {user?.firstName}!</div>
}npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add dialog- Next.js Documentation
- shadcn/ui Components
- Supabase Documentation
- Zustand Documentation
- Clerk Documentation
The easiest way to deploy your Next.js app is to use the Vercel Platform.
Make sure to add your environment variables in the Vercel dashboard under Project Settings → Environment Variables.