# 🔐 Next.js Auth Starter
A simple authentication starter using **Next.js App Router**, **Auth.js**, **ShadCN UI**, and **Google OAuth** with support for credentials login.
## 🚀 Features
- Email & password login (hardcoded for testing)
- Google OAuth login
- Auth.js with App Router support
- Styled using ShadCN UI and TailwindCSS
- Ready for PostgreSQL + Prisma
## 📦 Getting Started
```bash
git clone https://github.com/your-repo/nextjs-auth-starter
cd nextjs-auth-starter
npm install
npm run dev
```
Create a .env
file in the root of the project:
NEXTAUTH_URL=http://localhost:3000
AUTH_SECRET=your-random-secret-here
AUTH_GOOGLE_ID=your-google-client-id
AUTH_GOOGLE_SECRET=your-google-client-secret
AUTH_TRUST_HOST=true
DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA
AUTH_SECRET
: Generate withnpx auth secret
AUTH_GOOGLE_ID
andAUTH_GOOGLE_SECRET
: Create a new project and OAuth app in Google Cloud ConsoleDATABASE_URL
: Get from your PostgreSQL providerNEXTAUTH_URL
: Usuallyhttp://localhost:3000
in development
Use these to test the credentials login:
- Email:
[email protected]
- Password:
secret123
/app
/auth/login → Login page
/auth/signup → Signup page
/api/auth/[...nextauth].ts → Auth.js route
/components → Reusable UI components
/lib → Execute Actions
.env → Environment config
- ShadCN UI
- Tailwind CSS
- React Icons
MIT – Free to use and modify. Please create a new branch for new features or updates then ensure to make a pull request.
- Next.js
- Auth.js
- ShadCN UI
- Prisma