More useful info tbd here.
Chilla uses Python 3.9 and MongoDB.
Quickstart, assuming all necessary tools are installed:
docker compose up -d
to start up Mongopipenv install
to install Python dependencies- Make a copy of
.env.example
called.env
in the root directory and fill out all values pipenv run python main.py
to run the bot
By default, Chilla looks for a MongoDB instance at localhost:27017 with no authentication. You can override the Mongo via environment variables (see "Configuration" below).
This project includes a very basic docker-compose.yml file to spin up a Mongo container if you don't want to download
and install Mongo. To use, simply run docker compose up -d
to start a Mongo instance at mongodb://localhost:27017
(
with no auth).
Assuming that you already have Python installed, you'll need pip and Pipenv.
Pipenv is a dependency management tool that centralizes the dependencies required by a project. It does this by
combining virtual environments (virtualenv) and a Pipfile. The Pipfile contains the list of dependencies required by the
project, and running pipenv install
will install all the specified dependencies into an automatically-managed
virtualenv.
Chilla uses environment variables for configuration in combination with .env
files and python-dotenv. .env
is
excluded from source control, and the template for all variables can be found in .env.example
.
Tests are mostly integration tests and require a standing MongoDB instance; they target a separate test database instead of the regular application one.
To run tests, first install dev dependencies with pipenv install --dev
. Then simply run pipenv run pytest
.
- For text, use double quotes
- For variables inside strings, use single quotes
- For keys/symbols, use single quotes
To get real data from prod into your local db for manual testing:
# Open a shell into the mongo container
docker exec -it chilla_mongo_1 bash
# Dump prod data - fill in with your creds
mongodump mongodb+srv://<username>:<password>@<url>/Chilla
# Restore
mongorestore dump