Just another Next.js boilerplate.
✨ Demo: https://nothing.jaouan.dev
- Framework : Next.js (file-based routing, RSC, server actions)
- Auth : Supabase (SSR+CSR) / Better-Auth (SSR+CSR) / Firebase (CSR only)
- Backend : Supabase (client-side + server-side) / Firebase (client-side only)
- State Management : Zustand
- UI / Styling : TailwindCSS + Shadcn
- Code Quality & Formatting : Biome
- Git Hooks : Husky
-
Install dependencies
pnpm install # or npm install / yarn install -
Configure environment variables
- Copy
.env.exampleto.env.localand fill in your keys.
- Copy
-
Choose Better-Auth, Firebase or Supabase for authentication
- Toggle the exports in
lib/auth/browser.tsandlib/auth/server.ts. - If switching to Supabase, delete
<AuthenticatedOnly>HOC. - Delete any unused auth folders.
- Ensure to remove any unused dependencies after switching.
- Toggle the exports in
-
Run the development server
pnpm dev
-
Google OAuth setup :
-
(Supabase only) Backend setup
- Initialize:
supabase init - Create migrations/seeds in
supabase/migrations/andsupabase/seed.sql - Push schema:
supabase db push
- Initialize:
-
(better-auth only) Database setup
- Generate schema:
npx @better-auth/cli@latest generate --config ./lib/auth/better-auth/auth.ts
- Generate schema:
app/ # Next.js app router
actions/ # Server actions (e.g. fetchDataAction)
private/ # Private example page
components/ # UI components (atoms, navbar, theme, ...)
hooks/ # Custom React hooks
lib/ # Utilities, backend client/server helpers
stores/ # Zustand stores (user, data)
supabase/ # Supabase migrations, seeds, config
- Google OAuth via Better-Auth, Firebase or Supabase
- Session state managed with Zustand
- Next.js proxy for protected routes
- Use server actions for secure SSR/CSR data access
- Zustand stores for client state, calling server actions via API
Example:
useDataStore.actions.ts: use server actions.useDataStore.firebase.ts: use Firebase client SDK (fetching and subscribing to data).
- TailwindCSS + Shadcn for rapid UI development
- ThemeSwitcher for dark/light mode
pnpm dev— Start development serverpnpm build— Build for productionsupabase db push— Apply migrationssupabase db seed— Seed database
PRs and issues welcome! Please follow code style and best practices.
MIT