Git Product home page Git Product logo

auth-vault's Introduction

Auth-Vault Next.js Authentication Project ๐Ÿ›ก๏ธ

This is a Next.js project focusing on complex authentication logic implemented using NextAuth.js, Prisma, Zod, and a custom email verification resend service. The project aims to provide a robust authentication system with various features for both admin and regular users.

image

Features ๐Ÿš€

  • Multiple Authentication Methods:

    • Users can create accounts or log in using GitHub, Google, or manually with email/password.
  • Email Verification:

    • Verification email links are sent using a resend service to ensure email validity.
  • Role-based Access Control:

    • Admin and normal user functionalities are distinguished.
  • Two-Factor Authentication (2FA):

    • Implemented with OTP generation for added security during login.
  • User Account Management:

    • Users can update their names, emails, and passwords.
  • Role Switching:

    • Capability to switch roles from a normal user to an admin.

Technologies Used ๐Ÿ’ป

  • Next.js: React framework for server-rendered React applications.
  • TypeScript: Language that gives types to javascript.
  • NextAuth: Authentication library for Next.js applications.
  • Prisma: Database toolkit for TypeScript and Node.js.
  • Zod: TypeScript-first schema validation library.
  • Resend: Custom service for handling email verification resends.

Getting Started ๐Ÿ

Prerequisites ๐Ÿ“‹

  • Node.js (v14 or higher)
  • PostgreSQL (or another supported Prisma database)

Installation

  1. Clone the repository:
git clone https://github.com/amitamrutiya2210/Auth-Vault
  1. Navigate to the project directory:
cd Auth-Vault
  1. Install dependencies:
npm install
  1. Set up environment variables:

Create a .env.local file in the root directory from the sample.env.local file:

cp .env.local .sample.env.local

5.Run the development server:

npm run dev
  1. Open http://localhost:3000 in your browser to see the application.

Contributing ๐Ÿค

This project is open-source. Contributions are welcome! Feel free to fork the repository and submit pull requests. This is an open-source project. Anyone who wants to implement authentication for a Next.js project using NextAuth.js can simply come to this repository, copy the code, and use it for their own authentication system.

auth-vault's People

Contributors

amitamrutiya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.