|
| 1 | +============ |
| 2 | +Introduction |
| 3 | +============ |
| 4 | + |
| 5 | +This is the documentation for Rodhaj, the modern ModMail bot for the transprogrammer server. |
| 6 | + |
| 7 | +Software Requirements |
| 8 | +--------------------- |
| 9 | + |
| 10 | +Before you get started, please ensure you have the following installed: |
| 11 | + |
| 12 | +- `Git <https://git-scm.com>`_ |
| 13 | +- `Python 3 <https://python.org>`_ |
| 14 | +- `Poetry <https://python-poetry.org>`_ |
| 15 | +- `Docker <https://docker.com>`_ |
| 16 | +- Discord Account + App |
| 17 | + |
| 18 | +If you are using Linux, the following dependencies will need to be installed: |
| 19 | + |
| 20 | +- `libffi <https://github.com/libffi/libffi>`_ |
| 21 | +- `libnacl <https://github.com/saltstack/libnacl>`_ |
| 22 | +- `python3-dev <https://packages.debian.org/python3-dev>`_ |
| 23 | +- `libssl <https://github.com/openssl/openssl>`_ |
| 24 | + |
| 25 | +For a debian-based system, you can install them with the following command: |
| 26 | + |
| 27 | +.. code-block:: bash |
| 28 | +
|
| 29 | + $ apt install libffi-dev libnacl-dev python3-dev libssl-dev |
| 30 | +
|
| 31 | +.. caution:: |
| 32 | + Rodhaj uses `uvloop <https://github.com/MagicStack/uvloop>`_ on Linux and MacOS |
| 33 | + and `winloop <https://github.com/Vizonex/Winloop>`_ on Windows. Replacing the default event loop |
| 34 | + with these Cython-based implementations provides a significant performance boost. |
| 35 | + Although Rodhaj is natively developed and deployed on Linux, |
| 36 | + Windows support should work but is not tested. |
| 37 | + |
| 38 | +Setup |
| 39 | +----- |
| 40 | + |
| 41 | +**Rodhaj only supports Python 3.9 or higher** |
| 42 | + |
| 43 | +.. important:: |
| 44 | + Ensure that you are in the root of the repo throughout this process |
| 45 | + |
| 46 | +1. Fork and clone the repo |
| 47 | + |
| 48 | +2. Install dependencies and set up pre-commits |
| 49 | + |
| 50 | +.. code-block:: bash |
| 51 | +
|
| 52 | + poetry install \ |
| 53 | + && poetry run pre-commit install |
| 54 | +
|
| 55 | +3. Copy over the ``.env`` template over to the ``bot`` directory. Modify the values as appropriate. |
| 56 | + |
| 57 | +.. code-block:: bash |
| 58 | +
|
| 59 | + cp envs/dev.env bot/.env |
| 60 | +
|
| 61 | +4. Run the SQL migrations |
| 62 | + |
| 63 | +.. code-block:: bash |
| 64 | +
|
| 65 | + poetry run python bot/migrations.py init |
| 66 | +
|
| 67 | +5. In order to demonstrate, you can run the bot to test everything out |
| 68 | + |
| 69 | +.. code-block:: bash |
| 70 | +
|
| 71 | + poetry run python bot/launcher.py |
| 72 | +
|
| 73 | +Database |
| 74 | +^^^^^^^^ |
| 75 | + |
| 76 | +The following SQL queries can be used to create the user and database: |
| 77 | + |
| 78 | +.. code-block:: sql |
| 79 | +
|
| 80 | + CREATE ROLE rodhaj WITH LOGIN PASSWORD 'somepass'; |
| 81 | + CREATE DATABASE rodhaj OWNER rodhaj; |
| 82 | +
|
| 83 | +.. note:: |
| 84 | + |
| 85 | + This step is largely skipped if you are using Docker to run |
| 86 | + the PostgreSQL server. If you decide not to use Docker, you |
| 87 | + will need to manually create the database as shown below |
| 88 | + |
| 89 | +Basic Concepts |
| 90 | +-------------- |
| 91 | + |
| 92 | +Rodhaj works by implementing commands, which |
| 93 | +are used staff. And Rodhaj takes care of assigning threads, creating tickets, etc. |
| 94 | +More will be provided in-depth in other parts of the documentation. |
0 commit comments