zexahq/better-auth-starter
About
A modern Next.js boilerplate with authentication, admin dashboard, and user management built with Better Auth, Drizzle ORM, and PostgreSQL
Web & AppsWhat you can do
- User Management: Full CRUD operations on user accounts
- Role Management: Assign and modify user roles
- Security Actions: Ban users, revoke sessions, delete accounts
- Audit Trail: Track user actions and changes
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalZexa Auth Starter
A modern, production-ready Next.js boilerplate with comprehensive authentication, admin dashboard, and user management features. Built by Zexa for rapid application development.
✨ Features
🔐 Authentication
- Email & Password Authentication with email verification
- Session Management with secure token handling
- Account Linking support
- Role-based Access Control (Admin, User roles)
👥 User Management
- User Registration & Login with form validation
- Email Verification system
- Profile Management
- User Banning/Unbanning with expiration dates
- Session Revocation for security
🛡️ Admin Dashboard
- User Management Interface - View, edit, ban/unban users
- Role Assignment - Manage user permissions
- User Actions - Delete users, revoke sessions
- Responsive Admin UI with modern design
Admin Panel
🎨 UI/UX
- Modern Design System with Tailwind CSS
- Responsive Layout for all devices
- Component Library with Radix UI primitives
- Form Validation with React Hook Form + Zod
- Toast Notifications for user feedback
🛠️ Tech Stack
- Framework: Next.js 16 with App Router
- Authentication: Better Auth
- Database: PostgreSQL with Drizzle ORM
- Styling: Tailwind CSS
- UI Components: Radix UI
- Form Handling: React Hook Form
- Validation: Zod
- Email: Resend
- TypeScript: Full type safety
🚀 Quick Start
Prerequisites
- Node.js 18+
- PostgreSQL database
- Resend account (for email functionality)
Installation
Clone the repository
git clone <repository-url> cd zexa-auth-starterInstall dependencies
pnpm installEnvironment Setup
Copy the
.env.examplefile to.env.localand fill in the values.cp .env.example .env.localDatabase Setup
# Generate and run migrations pnpm db:generate pnpm db:migrateStart Development Server
pnpm dev
Visit http://localhost:3000 to see your application!
📁 Project Structure
src/
├── app/ # Next.js App Router
│ ├── admin/ # Admin dashboard pages
│ ├── api/ # API routes
│ ├── auth/ # Authentication pages
│ └── dashboard/ # User dashboard
├── components/ # React components
│ ├── admin/ # Admin-specific components
│ ├── auth/ # Authentication forms
│ ├── landing/ # Landing page components
│ └── ui/ # Reusable UI components
├── db/ # Database configuration
├── lib/ # Utility libraries
└── utils/ # Helper functions
🔧 Available Scripts
pnpm dev- Start development server with Turbopackpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm db:generate- Generate database migrationspnpm db:migrate- Run database migrationspnpm db:push- Push database migrations to the databasepnpm db:studio- Open the Drizzle ORM Studio
🔑 Key Features Explained
Authentication Flow
- Registration: Users sign up with email/password
- Email Verification: Automated email verification process
- Login: Secure session-based authentication
Admin Features
- User Management: Full CRUD operations on user accounts
- Role Management: Assign and modify user roles
- Security Actions: Ban users, revoke sessions, delete accounts
- Audit Trail: Track user actions and changes
🚀 Deployment
Vercel (Recommended)
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙋 Support
For support and questions:
- Create an issue in this repository
- Contact Zexa team
Built with ❤️ by Zexa
Ready to build something amazing? Get started with Zexa Auth Starter today!
Explore related projects
Loading…