This is a simple authentication-only web app built with:
- Next.js App Router
- NextAuth.js for authentication
- PostgreSQL database hosted on Supabase
- ShadCN UI + Tailwind CSS
- Animated particle background for visual appeal
- Email/password login via NextAuth Credentials Provider
- Session-based auth with JWT
- Responsive, dark-mode ready UI using ShadCN
- Particle animation background using WebGL (OGL)
- Server-side session check using
getServerSession - Deployed-ready folder structure
git clone https://github.com/your-username/your-repo.git
cd your-reponpm installCreate a .env file in the root of your project and configure it like this:
# .env
DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@YOUR_DB_HOST:5432/postgres"
NEXTAUTH_SECRET=your-secret-string
NEXTAUTH_URL=http://localhost:3000You can get the
DATABASE_URLfrom Supabase → Project → Settings → Database → Connection Info.
If you're using Prisma (e.g. with @next-auth/prisma-adapter):
npx prisma generate
npx prisma migrate dev --name initnpm run devVisit http://localhost:3000
/sign-in→ Login page/sign-up→ (Optional) Registration page/admin→ Session-protected page (shows username if logged in)
This app includes an animated WebGL background using OGL:
- Renders only on the client
- Customizable speed, color, spread
- Enhances visual feel of login/admin screens
Include this file when sharing:
# .env.example
DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@YOUR_DB_HOST:5432/postgres"
NEXTAUTH_SECRET=your-secret-string
NEXTAUTH_URL=http://localhost:3000
GOOGLE_CLIENT_ID=your-google-clientid
GOOGLE_CLIENT_SECRET=your-google-clientsecret| Tool | Purpose |
|---|---|
| Next.js | React Framework (App Router) |
| NextAuth.js | Authentication |
| Supabase | Hosted PostgreSQL DB |
| Prisma | ORM (optional but recommended) |
| Tailwind CSS | Utility-first styling |
| ShadCN UI | Styled UI components |
| OGL | WebGL particles animation |