Oil & Rope is a Python project for managing Roleplay Games. The goal of this project is to make online roleplay easier and intuitive.
You can try now at our website Oil & Rope Web.
The main goal of Oil & Rope Project is combine both real-time web interaction with Discord Bots response.
Since a lot of people often use Discord for roleplay gaming we thought it might be wonderful for everyone to enjoy a
session either on Discord chat or Web (with its respective features).
The project is based on three fundamental technologies:
The entire web is based on Django Framework.
All views are tested CBV with Pytest (using base Django's TestCase).
We use django-channels to deal with ASGI requests
since we need real-time interaction with the user for sending and receiving information
from Discord API.
This allows us to create WebSockets so the frontend
can communicate with the backend immediately.
The web is directly linked to
Oil & Rope Bot,
the bot that manages roleplay session that are currently open in Oil & Rope Web.
This is achieved by the library discord.py which is based on
Discord Gateways.
If you want to just run the project to see how it looks like you can use our development docker images
These images are not intended for production environments and verbose error messages are gonna be displayed.
As part of out CI/CD we create images for every new feature we are adding and once these branches have passed the
GitHub Actions' tests an image under the following naming rules oilandrope/core:<feature-type>-<feature-ID>
for
example if a branch called feature/OAR-44
(named after OAR-44 - Character creation) is pushed an image
oilandrope/core:feature-OAR-44
will be created.
This means you can just run a docker image under the name of oilandrope/core:feature-OAR-44
and you'll have the latest
changes for that feature (if it isn't already implemented).
In order to create and access as admin user (Django's Superuser) you can set the environment variable ADMIN_PASSWORD
to create a user with username admin
and given password.
- Run
docker run -ti -p 8000:8000 -e ADMIN_PASSWORD=p4ssw0rd oilandrope/core:develop
- Access localhost:8000.
- Set username
admin
and passwordp4ssw0rd
.
First of all we need to clone this repository git clone https://github.com/oil-rope/oil-and-rope.git
.
The dependencies are managed by poetry and are easily installed by poetry install
.
Note that this command will also create a virtual environment.
If you want to install dependencies viarequirements.txt
you can get this file running the following commandpoetry export -f requirements.txt --dev --without-hashes -o requirements.txt
.
It's important to note that we have two settings files;
oilandrope/settings.py
andoilandrope/dev_settings.py
.
settings.py
it's intended to be used on production or with similar production environment since its features support for PostgreSQL Database, Mail and Hosts.dev_settings.py
it's supposed to just work by just setting environment variables.
It has support for local Redis, SQLite and debug tools such a django-extensions.
- Set environment variables:
cp .env.example .env
- Set settings: Change
DJANGO_SETTINGS_MODULE
tooilandrope.dev_settings
. - Run migrations:
python manage.py migrate
. - (Recommended) Run tests:
python manage.py test
. - Run server:
python manage.py runserver
.
We use Docker to simulate a Redis machine that manage ASGI requests.
- Run
docker run --rm -p 127.0.0.1:6379:6379 --name oar_redis --detach redis:6.2
.
This docker machine will manage all ASGI requests if you are running the web with
dev_settings.py
.
This does not work withrunserver_plus
.
In order the bot to run you need some environment variables such as token and command.
BOT_TOKEN
is used to connect discord.py to your bot via Discord bot's token.
BOT_COMMAND
is used as the command to call the bot.
- Change
BOT_TOKEN
on.env
with your token. - Change
BOT_COMMAND
on.env
with a command to call the bot. - Run
python manage.py runbot
.