Skip to content

Showcasing how to roll your own JWT auth without the use Lucia, nextauth, clerk or any other external service. Stored securely in PostgreSQL. Features like admin roles, onboarding and more,. All opt-in via config.

Notifications You must be signed in to change notification settings

remcostoeten/nextjs-15-roll-your-own-authentication

Repository files navigation

Auth Your Own Roll

Still working on it, but life is busy.

Overview

Auth Your Own Roll is a project designed to provide authentication solutions using various databases. This project utilizes Drizzle ORM for database interactions.

Getting Started

Prerequisites

  • Node.js
  • pnpm (or npm/yarn)
  • A supported database (PostgreSQL, MySQL, SQLite, or Turso)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd authyourownroll
  2. Install dependencies:

    pnpm install

Configuration

Before running the project, you need to configure the database settings in the drizzle.config.ts file.

  1. Open drizzle.config.ts.

  2. Set the dialect property to your desired database type. The available options are:

    • 'postgresql'
    • 'mysql'
    • 'sqlite'
    • 'turso'

    Example configuration for PostgreSQL:

    export default {
        dialect: 'postgresql',
        // ... other configurations ...
    }

Switching Databases

To switch the database:

  1. Update the dialect property in drizzle.config.ts to the desired database type.
  2. Ensure you have the corresponding database server running and accessible.
  3. Install any necessary database drivers if required (e.g., pg for PostgreSQL, mysql for MySQL).

Running the Project

After configuring the database, you can run the project using:

pnpm gen

About

Showcasing how to roll your own JWT auth without the use Lucia, nextauth, clerk or any other external service. Stored securely in PostgreSQL. Features like admin roles, onboarding and more,. All opt-in via config.

Topics

Resources

Stars

Watchers

Forks