Skip to content

codingwithmanny/nextjs-lucia-magiclink-postgres-docker

Repository files navigation

NextJS Lucia Passwordless / Magiclink Postres Docker

The following is an example implementing Lucia magilink authentication with postgres.

Requirements

  • Node v20 or greater
  • Pnpm
  • Docker

Quick Setup

1 - Install Dependencies

# FROM: ./

pnpm install;

2 - Set Environment Variables

# FROM: ./

cp .env.example .env;

3 - Start Database

# FROM: ./

pnpm db:up;

4 - Generate Local Database

# FROM: ./

pnpm db:gen;

5 - Push Database Changes

# FROM: ./

pnpm db:push;

6 - Run App

# FROM: ./

pnpm dev;

# [Expected Output]:
#   ▲ Next.js 14.2.3
#   - Local:        http://localhost:3000
#   - Environments: .env.local
# 
#  ✓ Starting...
#  ✓ Ready in 1785ms

7 - Run Drizzle Studio

# FROM: ./

pnpm db:studio;

# [Expected Output]:
# ...
# Drizzle Studio is up and running on https://local.drizzle.studio

8 - See Mailhog Email Server

# FROM: ./

open http://localhost:8025

9 - Destroy Database

# FROM: ./

pnpm db:down;

About

An example of using lucia auth with magiclinks, postgres, and docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published