A Discord OAuth2 Application (from the Discord Developers Portal) with the Redirect URI set to http://<frontend url>/callback
.
<aside>
ℹ️ Information needed from the application include CLIENT ID
and CLIENT SECRET
, which will be used later.
</aside>
A discord bot token from the developer portal.
Either one of the two:
A local copy of the git repository forms-backend.
<aside>
💡 Create a .env
file in the root with the following values inside it (each variable should be a line like VARIABLE=value
):
</aside>
The following variables are required:
OAUTH2_CLIENT_ID
: Client ID of the Discord OAuth2 ApplicationOAUTH2_CLIENT_SECRET
: Client Secret of the Discord OAuth2 ApplicationFRONTEND_URL
: The URL of the forms frontendDISCORD_BOT_TOKEN
: Token for a discord bot. Make sure to use it to connect to the gateway at least once (run the helper script below).DISCORD_GUILD
: The id of the guild to use for discord features such as roles. The bot from the previous variable needs to have access to this guild.Set the following variables if running on the host (not on Docker):
PRODUCTION
: Set to false
DATABASE_URL
: MongoDB instance URL, in the format mongodb://<username>:<password>@<database IP or domain>:<port>
MONGO_DB
: MongoDB database name, defaults to pydis_forms
SNEKBOX_URL
: Snekbox eval endpoint. http://snekbox:8060/eval
when using docker-compose.To start using the application, simply run docker-compose up
in the repository root. You'll be able to access the application by visiting http://localhost:8000/