The following is an example implementing Lucia OAuth authentication with postgres.
- Node
v20
or greater - Pnpm
- Docker
- Discord API Keys - https://discord.com/developers/applications
# FROM: ./
pnpm install;
Make sure to get DISCORD_CLIENT_ID
and DISCORD_CLIENT_SECRET
from https://discord.com/developers/applications.
Make sure to set your Redirect
to following in discord, found in https://discord.com/developers/applications/<YOUR_DISCORD_CLIENT_ID>/oauth2
.
http://localhost:3000/api/auth/discord/callback
And then fill in the information for the environment variables copy:
# FROM: ./
cp .env.example .env;
# FROM: ./
pnpm db:up;
# FROM: ./
pnpm db:gen;
# FROM: ./
pnpm db:push;
# FROM: ./
pnpm dev;
# [Expected Output]:
# ▲ Next.js 14.2.3
# - Local: http://localhost:3000
# - Environments: .env.local
#
# ✓ Starting...
# ✓ Ready in 1785ms
# FROM: ./
pnpm db:studio;
# [Expected Output]:
# ...
# Drizzle Studio is up and running on https://local.drizzle.studio
# FROM: ./
pnpm db:down;