A modern Next.js template featuring BetterAuth for secure authentication with email/password and Google, Drizzle ORM for type-safe database interactions, PostgreSQL as the database, and tRPC for seamless type-safe API communication. Styled with Tailwind CSS and shadcn for a sleek and customizable UI. Also includes Resend for email handling and TanStack Query for efficient data fetching and state management.
Demo: https://next-authkick.vercel.app/
- Next.js 15 – App Router support for modern React features.
- BetterAuth – Secure authentication with email/password and Google login.
- Drizzle ORM – Type-safe database interactions.
- PostgreSQL – Reliable and scalable relational database.
- tRPC – Type-safe API communication between frontend and backend.
- TanStack Query - Powerful asynchronous state management.
- Resend - Simple and reliable email handling.
- Tailwind CSS v4 – Utility-first styling for rapid UI development.
- Shadcn – Beautiful, customizable UI components.
- Authenticantion with email/password.
- Authenticantion with Google.
- Forget password.
- React query cache integration.
- Routes with trcp.
- Send email with resend.
- Database integration with drizzle orm.
- Node.js 18.18.0+
- PostgreSQL database
-
Clone the repository:
git clone https://github.com/hugomendonca98/next-authkick.git cd next-authkick -
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.localfile and configure the necessary variables:DATABASE_URL=your_postgres_connection_url SITE_URL=your_client_url BETTER_AUTH_SECRET=your_better_auth_secret BETTER_AUTH_URL=your_client_url USE_DEV_MIGRATIONS_PATH=true // if true run the migrations in separated folder and use the folder to dev database. RESEND_API_KEY=your_resend_api_key GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret
-
Setup docker:
docker-compose up
-
Run database migrations:
npx drizzle-kit generate npx drizzle-kit migrate
-
Start the development server:
npm run dev
Feel free to fork this repository and submit pull requests for improvements!
This project is licensed under the MIT License.