To configure the back-end environment, follow these steps:
- Clone the
.env.template
file and rename it to.env
. - Open the
.env
file and modify the necessary configurations described below.
OAuth2 is an authentication protocol based on a third-party engine (In this case, Discord).
To use Discord OAuth2 locally, you need to:
- Create a Discord Developer account, based on your current account (you should have one cuz you're the member of LLC server).
- Create a new Application in Discord Developer Portal.
- Click onto your newly created app to modify a few settings. Select the
OAuth2
section.
- Copy the value of "client id" and "client secret" and copy into your application. Warning: the client secret is shown only once after each reset.
- Add a Redirect URL with value
http://localhost:3001/callback
inDISCORD_REDIRECT_URI
in.env
and Redirects in OAuth2 -> General
For the PORT
field, it should be the same as the port that the back-end runs on your machine (default: 3000
).
For the TOKEN_SECRET
, put anything in. (e.g.: eiwolxxx9000
)
For the POSTGRES_URL
, it should be in the form of:
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA
.