Skip to content

Commit 21efa33

Browse files
committed
docs: add basic usage information docs
1 parent 018f6de commit 21efa33

File tree

7 files changed

+70
-12
lines changed

7 files changed

+70
-12
lines changed

docs/byte/usage/byte.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
==========
2+
About Byte
3+
==========
4+
5+
The Discord side of Byte is utilizing the `discord.py <https://discordpy.readthedocs.io/en/latest/>`_. framework.
6+
7+
The structure of Byte is not too complex. There exists a ``bot.py`` file containing the main
8+
:ref:`Byte` bot class, which includes some on-start utilities like loading cogs and ingesting
9+
new guilds as they join into the database. The class is called via the :func:`run_bot` function
10+
to start the bot.
11+
12+
The structure of Byte is not dissimilar to the structure of the server side; it has a ``lib/``
13+
directory for common backend functionality like utilities, logging, and settings, a ``plugings/``
14+
directory for the cogs, and a ``views/`` directory for the UI components inside of Discord.
15+
16+
For example, any functionality related to `Astral <https://astral.sh/>`_ is located in the
17+
``plugins/astral/`` directory, such as ``ruff`` embeds, and it's related views are located in
18+
``views/astral/``.

docs/byte/usage/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
=====
12
Usage
23
=====
34

45
.. toctree::
56
:titlesonly:
7+
:caption: Byte Usage Documentation
8+
9+
byte
10+
starting

docs/byte/usage/starting.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=============
2+
Starting Byte
3+
=============
4+
5+
.. todo:: This section needs to be written.

docs/web/usage/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
=====
12
Usage
23
=====
34

45
.. toctree::
56
:titlesonly:
7+
:caption: Web Usage Documentation
8+
9+
server

docs/web/usage/server.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
================
2+
About the Server
3+
================
4+
5+
The server side of Byte is utilizing the `Litestar <https://litestar.dev>`_ framework.
6+
It is an immensely powerful, fast, and easy to use framework that is perfect for Byte.
7+
8+
The server is responsible for handling all of the requests to and from the database,
9+
as well as serving the frontend to the user; it utilizes the `Jinja2 <https://jinja.palletsprojects.com/en/3.0.x/>`_
10+
templating engine to do so.
11+
12+
There are a few key components to the server, structured like so:
13+
14+
* ``app.py``: The main entry point for the server where the application factory is defined.
15+
* ``cli.py``: The command line interface for the server.
16+
* ``__main__.py``: The entry point for the server when running it via the command line.
17+
* ``lib/``: A directory containing all of the server's logic, settings, and configuration.
18+
* ``domain/``: A directory containing all of the server's domain logic, including the database models and routes.
19+
20+
The domain is further broken down into logical components, such as:
21+
22+
* ``db/``: The database models
23+
24+
.. note:: These once were houses inside the respective domain components, but were moved to a separate directory to
25+
make it easier to manage and maintain the database models (but also because circular imports are bad).
26+
* ``github/``: The GitHub domain logic, including connectivity to GitHub via the
27+
`githubkit <https://github.com/yanyongyu/githubkit>`_ library.
28+
* ``guilds/``: The guilds domain logic, including the guilds routes and any helper functions used to perform CRUD
29+
operations on guilds.
30+
* ``system/``: The system domain logic, mainly for dealing with tasks and healthchecks for the core system.
31+
* ``web/``: The web domain logic, including the web routes, frontend resources, and templates
32+
33+
This structure allows for a clear separation of concerns and makes it easy to find and maintain the server's logic.

docs/web/usage/starting.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
===============
2+
Starting Server
3+
===============
4+
5+
.. todo:: This section needs to be written.

src/byte/bot.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@
2323
load_dotenv()
2424

2525

26-
async def on_member_join(member: Member) -> None:
27-
"""Handle member join event.
28-
29-
Args:
30-
member: Member object.
31-
"""
32-
await member.send(
33-
f"Welcome to {member.guild.name}! Please make sure to read the rules if you haven't already. "
34-
f"Feel free to ask any questions you have in the help channel."
35-
)
36-
37-
3826
class Byte(Bot):
3927
"""Byte Bot Base Class."""
4028

0 commit comments

Comments
 (0)