The most comprehensive authentication framework for TypeScript. Best auth solution with OAuth, magic links & more.
This is a Modern Betterauth boilerplate template with a tech stack of Better-Auth, Prisma ORM, PostgreSQL, Tailwind v4 & ShadCN UI for secure web development. Customize according to your own needs. Truly an open source, open for contributions.
- Frontend: NextJS - React framework with lots of features and easy to use
- Styling: TailwindCSS - Utility-first CSS framework for rapidly building custom UI components
- UI Components: ShadCN UI - Modern UI components library built with RadixUI & TailwindCSS
- Database: PostgreSQL - Reliable and powerful relational database
- ORM: Prisma - TypeScript-based ORM for PostgreSQL, ship faster with Prisma
- Authentication: BetterAuth - Comprehensive authentication framework with OAuth, magic links & more
# Clone the repository
git clone https://github.com/atharvamhaske/athubetterauth
# Navigate to the project directory
cd athubetterauth
# Install dependencies
pnpm install
# Set up your environment variables
# Create a .env.local file with the following content:
# DATABASE_URL="postgresql://postgres:password@localhost:5432/betterauth?schema=public"
# AUTH_SECRET="your-auth-secret-key-change-this-in-production"
# AUTH_TRUST_HOST=true
# Start the development server
pnpm dev- Modern, responsive UI design
- Comprehensive authentication system
- Type-safe database operations with Prisma
- Customizable UI components with ShadCN
- Easy to extend and customize
This project requires the following environment variables:
# Database connection
DATABASE_URL="postgresql://postgres:password@localhost:5432/betterauth?schema=public"
# Auth configuration
AUTH_SECRET="your-auth-secret-key-change-this-in-production"
AUTH_TRUST_HOST=true
# Optional: Email configuration for verification
# Using Resend API (https://resend.com)
RESEND_API_KEY=your-resend-api-key
# Required for Vercel deployment with social providers
NEXTAUTH_URL="https://your-app-url.vercel.app"
# OAuth providers
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
Create a .env.local file in the root directory with these variables before starting the application.
Contributions are welcome! Feel free to open issues or submit pull requests.
Open source - Created by Atharva Mhaske