Apollo is a Discord bot for the University of Warwick Computing Society. It is designed to augment our Discord server with a few of the user services available on our website.
Apollo uses pipenv
for dependency and venv management. Install it with pip install pipenv
, and then run pipenv install
to install all the required dependencies into a new virtual environment.
pipenv install
, as aboveconfig.example.yaml
to config.yaml
and configure the fields.alembic.example.ini
to alembic.ini
and configure any fields you wish to change.alembic upgrade head
.
postgresql+psycopg://apollo:apollo@localhost/apollo
(in config.example.yaml
)
This requires PostgreSQL to be installed, with a database called apollo
and a user with name and password apollo
with access to it.sqlite:///apollo.sqlite3
. Run Apollo using pipenv run python apollo.py
A Dockerfile and docker-compose are provided for easily running Apollo. Assuming you already have docker installed, run docker compose up
to start both Apollo and a postgres database.
The compose file uses a read-only bind mount to mount config.yaml
into the container at runtime, not at build time. Copy config.example.yaml
to config.yaml
and configure the fields so that compose can do this. You will need to change the database url to postgresql+psycopg://apollo:apollo@db/apollo
if you wish to connect to the containerised database. Be sure to configure the rest of the fields too: you need a discord bot token.
The docker image builds alembic.ini
into it by copying the example, as it is rare any values in this wish to be changed on a per-deployment basis.
When you first create the database container, you'll need to apply migrations:
docker compose up -d
to start both services in the background. The python one won't work, but leave it running.
docker compose up --build
docker compose logs
docker compose exec apollo alembic upgrade head
to apply the database migrations.docker compose down && docker compose up
to restart both services with the migrations applied.
Migrations will need to be re-applied every time the database schema changes.
Check our issues for ideas of what to contribute. If you want to see a particular feature that isn't mentioned, feel free to work on it (but please do make an issue beforehand, so we can discuss it)
See our wiki for a general overview of the project and and Contributor Notes for project specific advice and utility.