Next.js + Auth.js v5 + ShadCN UI

Next.js Auth Starter

A secure, modern authentication template with everything you need to get started (password reset, email validation and oAuth, profile update)

git clone https://github.com/Bendada-abdelmajid/nextjs-authjs.git

Features

This starter template is a guide to help you get started with Next.js for large scale applications. Feel free to add or remove features to suit your needs.

Credential Authentication

Secure user authentication with credentials, ensuring strong validation and encryption for login security.

Email Verification

Verify user email addresses to prevent spam and unauthorized account creation, improving platform security.

Password Reset

Allow users to securely reset passwords using token-based authentication, reducing the risk of account lockout.

S3 Storage for Profiles

Integrate Amazon S3 for scalable and reliable user profile storage, ensuring quick and secure access to files.

ShadCN UI Components

Utilize modern and accessible UI components from ShadCN for a seamless and responsive user experience.

MongoDB Database

Leverage MongoDB for a scalable and flexible NoSQL database solution, ensuring high availability and performance.

Get Started

To get started with this project, follow the steps below:

  1. Clone the repository

    git clone https://github.com/Bendada-abdelmajid/nextjs-authjs.git
    cd clreck-clone
  2. Install dependencies

    npm install
  3. Set up environment variables

    To configure the environment variables, create a `.env` file in the root of the project and set the following variables:

    DATABASE_URL=
    NEXTAUTH_URL= # Your NextAuth URL (e.g., http://localhost:3000)
    NEXTAUTH_SECRET= # A secret key for NextAuth encryption
    
    AUTH_GOOGLE_ID= # Google OAuth Client ID (create it in Google Developer Console: https://console.developers.google.com/)
    AUTH_GOOGLE_SECRET= # Google OAuth Secret (generated in the same place as the Client ID)
    
    AUTH_LINKEDIN_ID= # LinkedIn OAuth Client ID (create it in LinkedIn Developer Portal: https://www.linkedin.com/developers/)
    AUTH_LINKEDIN_SECRET= # LinkedIn OAuth Secret (generated in the same place as the Client ID)
    
    EMAIL_FROM= # The email address you'll use to send verification and reset emails
    EMAIL_PASSWORD= # Password or application-specific password for your email account
    
    AWS_S3_SECRET_ACCESS_KEY= # AWS S3 Secret Access Key (generate it in the AWS IAM Console: https://console.aws.amazon.com/iam/)
    AWS_S3_ACCESS_KEY_ID= # AWS S3 Access Key ID (also in IAM Console)
    AWS_S3_REGION= # AWS S3 Region (e.g., us-east-1)
    AWS_S3_BUCKET_NAME= # Your S3 Bucket Name (create it in the AWS S3 Console: https://console.aws.amazon.com/s3/)
  4. Generate Prisma client

    npx prisma generate
  5. run and enjoy

    npm run dev