nextjs-auth-template
v0.4.0
Published
![Github Intro Image](https://nextauth.dannyisadog.com/github-intro.png)
Downloads
2
Readme
Next.js Auth Template
The nextjs-authjs-template is a robust starter template for building modern web applications with Next.js and Auth.js (formerly NextAuth.js). This template is designed to streamline the development process by providing a pre-configured setup that integrates user authentication and authorization seamlessly into your Next.js project.
Features:
- FullStack Next.js application with built-in authentication.
- User authentication with email, Google, and GitHub.
- ORM with Prisma for database management.
- PostgreSQL database with Docker for easy setup.
- Email service with Resend API.
- MUI for styling and responsive design.
Use Cases:
- Rapidly prototype and deploy Next.js applications with built-in authentication.
- Start new projects with a solid foundation, reducing the boilerplate code required for user management.
Getting Started
- Create a
.env
file in the root of the project and add the following
cp .env.example .env
- Generate auth secret key
npx auth secret
- Fill up your google & github client id & secret in
.env
...
AUTH_GOOGLE_ID=xxxx
AUTH_GOOGLE_SECRET=xxxx
AUTH_GITHUB_ID=xxxx
AUTH_GITHUB_SECRET=xxxx
...
- Create your Resend api key for email service in
.env
...
RESEND_API_KEY=xxxx
...
- Install dependencies
yarn install
- Start postgres database
docker-compose up -d
- Run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.