This project uses Discord Oauth2 to authenticate users, and then uses their roles to determine what content they can access.
Roles are first stored when the Oauth2 is completed. The discord bot will listen for discord role updates and update the database accordingly.
- PostgreSQL database
- Prisma CLI installed globally. How do I install it?
- Discord application with the
SERVER MEMBERS INTENTenabled
- Clone the repo
- Find the
.env.examplefile in the root directory - Create a discord application here and enable the
SERVER MEMBERS INTENTin the bot section
- Rename the
.env.examplefile to.env.localand modify the following variables
DATABASE_URL="postgresql://user:pass@address:port/dbname?schema=public"
BOT_TOKEN="DISCORD BOT TOKEN"
GUILD_ID="DISCORD GUILD ID"
NEXT_PUBLIC_ROLE_ID="DISCORD ROLE"
CLIENT_ID="DISCORD CLIENT ID"
CLIENT_SECRET="DISCORD CLIENT SECRET"
REDIRECT_URI="http://localhost:3000/login/discord/callback"
- Run
npm install - Run
prisma db pushto create the database tables - Run
npm run devto start the webapp - Run
npm run botto start the discord bot
- Next.js (React)
- TailwindCSS
- Prisma
- PostgreSQL
- Discord.js
- SWR
- iron-session