Skip to content

mark-whelan/next-js-starter-with-authentication

 
 

Repository files navigation

Next.js Starter with Authentication

A Next.js starter template with built-in authentication, including signup, login (with Google login), and email verification via Resend. The project follows a modular and framework-like structure for easy scalability.

Features

  • User Authentication: Signup, Login with email/password & Google login
  • Email Verification: Verification emails with Resend API, including a resend feature
  • Structured Framework: Modular code with predefined authentication pages
  • Environment Configurations: .env.example provides necessary variables for configuration

Authentication Routes

  • Login: /auth/login
  • Signup: /auth/signup
  • Email Verification: /auth/verify

Setup

1. Clone the Repository

git clone https://github.com/DivyanshuLohani/next-js-starter-with-authentication.git
cd next-js-starter-with-authentication

2. Install Dependencies

npm install

3. Configure Environment Variables

Rename .env.example to .env.local and fill in the required fields, including API keys for Resend and Google authentication.

For Google Login, add the following URIs to your Google OAuth redirect settings:

4. Run the Development Server

npm run dev

The project will be running at localhost:3000.

Authentication Configuration

This project uses NextAuth.js for authentication. Modify the configuration in:

src/lib/auth/authOptions.ts

to customize authentication behavior, providers, and callbacks.

Enjoy building with Next.js Starter with Authentication!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.8%
  • Other 1.2%