A full-featured authentication demo application using Better Auth with a custom Steam OpenID 2.0 authentication plugin.
- NestJS - Node.js framework
- Prisma - Database ORM
- Better Auth - Authentication system
- Resend - Email service
- PostgreSQL - Database
- Next.js 16 - React framework
- React 19 - UI library
- Tailwind CSS 4 - Styling
- shadcn/ui - UI component library
- Radix UI - Accessible components
- React Hook Form + Zod - Forms and validation
- better-auth-steam - Custom Better Auth plugin for Steam authentication via OpenID 2.0
- 🔐 Login & Registration (email/password)
- 🎮 Steam authentication (OpenID 2.0)
- 🔑 Two-factor authentication (2FA)
- 📧 Email verification
- 🔄 Password reset
- 👤 User profile management
- 👑 Admin panel
- 🔗 Account linking (link Steam to existing account)
- Node.js 18+
- pnpm
- PostgreSQL
- Steam API key
- Clone the repository:
git clone https://github.com/Luc4sguilherme/better-auth-steam-demo.git
cd better-auth-steam-demo- Install dependencies:
pnpm install-
Set up environment variables (create
.envfiles in/serverand/web).The server requires the following variables:
BETTER_AUTH_URL- Backend URLBETTER_AUTH_SECRET- Auth secret keyBETTER_TRUSTED_ORIGINS- Trusted frontend originSTEAM_API_KEY- Your Steam API key
-
Run database migrations:
cd server
pnpm prisma:migrateBackend:
pnpm dev:serverFrontend:
pnpm dev:webOpen http://localhost:3000 in your browser.
├── plugins/
│ └── better-auth-steam/ # Custom Steam auth plugin
│ └── index.ts # Plugin implementation (OpenID 2.0)
│
├── server/ # NestJS API
│ ├── src/
│ │ ├── auth/ # Authentication module (Better Auth)
│ │ ├── email/ # Email service (Resend)
│ │ ├── prisma/ # Prisma service
│ │ └── users/ # Users module
│ └── prisma/ # Schema and migrations
│
└── web/ # Next.js frontend
├── app/ # Routes and pages
├── components/ # React components
└── lib/ # Utilities and config
This project is for demonstration purposes only.