Skip to content

Repository files navigation

Full Stack Starter

Minimal and production-minded starter repository built with Better Auth, Next.js, shadcn/ui, Tailwind, Prisma, Brevo mailer, and PostgreSQL on Neon.

Clone it, add environment variables, and start building your product features.

Starter Preview

Replace the image above with your own screenshot file in public (example: public/readme-preview.png).

What is included

  • Next.js 16 (App Router)
  • React 19
  • TypeScript
  • Better Auth (email/password + social login)
  • Prisma ORM
  • PostgreSQL (Neon)
  • Brevo transactional mailer (email verification)
  • Upstash Redis integration
  • shadcn/ui components
  • Tailwind CSS v4
  • next-themes (dark and light mode)
  • Zod + React Hook Form

Tech stack details

Frontend

  • Next.js App Router architecture
  • Reusable UI primitives in src/components/ui
  • Theme support via next-themes
  • Tailwind CSS + utility helpers (clsx, tailwind-merge)

Auth

  • Better Auth configured in src/lib/auth.ts
  • Email/password authentication enabled
  • Email verification required before sign-in completion
  • Social providers configured for Google and GitHub

Database

  • Prisma schema at prisma/schema.prisma
  • Generated Prisma client in src/generated/prisma
  • Models included by default:
    • User
    • Session
    • Account
    • Verification

Mail

  • Brevo SMTP API integration in src/lib/mail-sender.ts
  • Verification emails are sent through Brevo API

NOTE: Here I have used brevo in place of nodemailer

Cache / KV

  • Upstash Redis client setup in src/lib/redis.ts

Project structure

src/
	app/
		(auth)/
			sign-in/
			sign-up/
			verify-email/
			email-verified/
		(protected)/
			dashboard/
		api/auth/[...all]/
	components/
		auth/
		landing/
		providers/
		shared/
		ui/
	generated/prisma/
	lib/
	schemas/
prisma/
	schema.prisma
	migrations/

Quick start

  1. Clone the repository
git clone <your-repo-url>
cd full_stack_starter
  1. Install dependencies
bun install

You can also use npm, pnpm, or yarn if preferred.

  1. Create environment file
cp .env.example .env.local

If .env.example does not exist yet, create .env.local manually and use the variables from the section below.

  1. Run migrations
bun x prisma migrate dev --name <migration_name>
  1. Start development server
bun dev

Open http://localhost:3000

Required environment variables

Add these values in .env.local:

# App
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Better Auth
BETTER_AUTH_SECRET=replace-with-strong-secret
BETTER_AUTH_URL=http://localhost:3000

# Database (Neon Postgres)
DATABASE_URL=postgresql://user:password@host:5432/dbname?sslmode=require

# Social auth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

# Brevo mailer
BREVO_API_KEY=
EMAIL_USER=no-reply@yourdomain.com

# Upstash Redis
KV_REST_API_URL=
KV_REST_API_TOKEN=

Notes:

  • Ensure EMAIL_USER is a verified sender in Brevo.
  • For production, use real domain URLs for BETTER_AUTH_URL and NEXT_PUBLIC_APP_URL.
  • Keep secrets out of version control.

Available scripts

bun dev      # Start dev server
bun build    # Create production build
bun start    # Start production server
bun lint     # Run ESLint

Authentication flow

  • User signs up with email/password or social provider.
  • Email verification is triggered via Brevo.
  • Verified users can access protected dashboard routes.

Dark and light mode

  • Theme handling is provided by next-themes.
  • UI components are styled for both dark and light themes.

Deployment checklist

  • Set all environment variables in your hosting platform.
  • Configure production database URL (Neon).
  • Run Prisma migrations in your deploy pipeline.
  • Ensure Brevo sender and API key are active.
  • Set Better Auth URLs to your production domain.

License

Add your preferred license here.

About

Minimal and production-minded starter repository built with Better Auth, Next.js, shadcn/ui, Tailwind, Prisma, Brevo mailer, and PostgreSQL on Neon.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages