Giter Site home page Giter Site logo

ringge / next-lucia-auth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saasykits/next-lucia-auth

0.0 0.0 0.0 319 KB

This is a Next.js T3 project with authentication implemented using Lucia.

Home Page: https://next-lucia.vercel.app

License: MIT License

JavaScript 2.18% TypeScript 96.63% CSS 1.18%

next-lucia-auth's Introduction

Next.js Auth Starter Template

Motivation

Implementing authentication in Next.js, especially Email+Password authentication, can be challenging. NextAuth intentionally limits email password functionality to discourage the use of passwords due to security risks and added complexity. However, in certain projects, clients may require user password authentication. Lucia offers a flexible alternative to NextAuth.js, providing more customization options without compromising on security. This template serves as a starting point for building a Next.js app with Lucia authentication.

Lucia vs. NextAuth.js

Lucia is less opinionated than NextAuth, offering greater flexibility for customization. While Lucia involves more setup, it provides a higher degree of flexibility, making it a suitable choice for projects requiring unique authentication configurations.

Key Features

  • Authentication: ๐Ÿ’ผ Support for Credential and OAuth authentication.
  • Authorization: ๐Ÿ”’ Easily manage public and protected routes within the app directory.
  • Email Verification: ๐Ÿ“ง Verify user identities through email.
  • Password Reset: ๐Ÿ”‘ Streamline password resets by sending email password reset links.
  • Lucia + tRPC: ๐Ÿ”„ Similar to NextAuth with tRPC, granting access to sessions and user information through tRPC procedures.
  • Stripe Payment: ๐Ÿ’ณ Setup user subscriptions seamlessly with stripe.
  • Email template with react-email: โœ‰๏ธ Craft your email templates using React.
  • MySQL Database: ๐Ÿ›ข๏ธ Utilize a MySQL database (Planetscale) set up using Drizzle for enhanced performance and type safety.
  • Database Migration: ๐Ÿš€ Included migration script to extend the database schema according to your project needs.

Tech Stack

Get Started

  1. Clone this repository to your local machine.
  2. Copy .env.example to .env and fill in the required environment variables.
  3. Run pnpm install to install dependencies.
  4. Update app title, database prefix, and other parameters in the src/lib/constants.ts file.
  5. Run pnpm db:push to push your schema to the database.
  6. Execute pnpm dev to start the development server and enjoy!

Roadmap

  • Update Password
  • Stripe Integration
  • API Rate-Limiting
  • Admin Dashboard (under consideration)
  • Role-Based Access Policy (under consideration)

Contributing

If you wish to contribute, fork the repository and use a feature branch. Pull requests are warmly welcome.

next-lucia-auth's People

Contributors

iamtouha avatar sadmann7 avatar jammy108 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.