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/
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.local
file 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.