Next Auth Starter is a Next.js 15 boilerplate with built-in authentication using BetterAuth. It supports Google Login and BetterAuth credentials, providing a solid foundation for any Next.js project requiring authentication.
bun install
Create a .env file and add the necessary credentials:
# Secret key for BetterAuth (Use a strong, random secret)
BETTER_AUTH_SECRET=<your_better_auth_secret>
# The base URL of your application (Update this for production)
BETTER_AUTH_URL=http://localhost:3000 # Change this to your production domain in deployment
# PostgreSQL Database Connection URL (Use environment variables in production)
DATABASE_URL="postgresql://<username>:<password>@<host>/<database_name>?sslmode=require"
# Google OAuth Credentials (Required for social login)
GOOGLE_CLIENT_ID=<your_google_client_id>
GOOGLE_CLIENT_SECRET=<your_google_client_secret>
bunx prisma migrate dev
bun dev
The app will be available at http://localhost:3000.
Check out the live version: Auth Starter