Run it locally#
Prerequisites#
Steps#
Copy the example environment file and set an API key:
cp .env.example .envOpen
.envand setAPI_KEYto any long random string. This is the shared key the bot would use to call your local API.Install the Python and Node dependencies:
make installStart Postgres in Docker and create the database tables:
make db-up migrateStart the site and the API together, with hot reload:
make devOpen http://localhost:8000. The site and the API share this one port, so the sign-in cookie works on both.
make help lists every command.
Sign-in needs a Discord app#
The sign-in button needs a Discord OAuth app and its own client ID and secret
(WEB_DISCORD_CLIENT_ID, WEB_DISCORD_CLIENT_SECRET). Without one, the public pages still work
and the sign-in button returns an error. See the repo’s .env.example for how to set one up, and
WEB_SESSION_SECRET for the session cookie.
Running the bot against your local API#
Clone the bot repo and set its API_URL to
http://localhost:8000 and its API_KEY to the same value you set here. See
Run it locally.
Database changes#
After you change a database model, write and apply a migration:
make migration MSG="add away dates"
make migrate
See How it works for the rule that keeps migrations safe during a deploy.