Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/remcostoeten/nextjs-15-roll-your-own-authentication

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.
https://github.com/remcostoeten/nextjs-15-roll-your-own-authentication

admin authentication boilerplate jwt middleware nextjs15 react server-actions session solid starter

Last synced: about 1 month ago
JSON representation

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.

Awesome Lists containing this project

README

        

# 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:
```bash
git clone
cd authyourownroll
```

2. Install dependencies:
```bash
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:
```typescript
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:
```bash
pnpm gen
```