1+
12How to get started
23------------------
34
451. Install *Pipenv * at a system level
5-
6+
67 If you are not using it for your projects, you should. *Pipenv * is a mix between *pip * and *virtualenv * (it uses
78 both of them below) and basically manages everything. You can probably find *Pipenv * packaged, check their webpage
89 for installation steps.
910
10112. Install dependencies
11-
12+
1213 In a command line, navigate to the current project directory and install the dependencies by running one of the
1314 commands below.
1415
15- * To use the bot: `pipenv install `
16+ * To use the bot: `` pipenv install ` `
1617
17- * To develop: `pipenv install -d `
18+ * To develop: `` pipenv install -d ` `
1819
1920 If these steps don't work, please report it so that I can update these instructions with relevant steps.
2021
21223. Install *mostbot * as a package
22-
23- Run the command `python setup.py develop `. You can also do `python setup.py install `, but it's better to keep the
24- installation linked to this directory instead of having `setuptools ` package and install the bot separately. If you
23+
24+ Run the command `` python setup.py develop `` . You can also do `` python setup.py install ` `, but it's better to keep the
25+ installation linked to this directory instead of having `` setuptools ` ` package and install the bot separately. If you
2526 have doubts on what I just said, https://stackoverflow.com/questions/19048732/python-setup-py-develop-vs-install
2627
27284. Install a database
28-
29+
2930 Apart from the bot code, you also need a database to link the bot to. You can link it to whatever *PostgreSQL *
3031 database you want, but I would recommend you to run a local instance.
31-
32+
3233 Using *Docker * and *Docker Compose * is a really good way to run packaged software. There are complete guides on the
3334 internet about how to run them, but for the basics:
3435
3536 1. Install *Docker * either using your package manager or as suggested in *Docker *'s official webpage. By the way,
3637 the official website method is just a Python script, so you can also install it with *pip * (I would
3738 discourage this option).
38-
39+
3940 2. Install *Docker Compose *. Same thing as *Docker *: user either package manager or the official webpage script.
40-
41+
4142 3. Open another terminal in this folder. This new terminal will be used all the time to maintain up the database
4243 while your bot is running. There are other ways to run the database in the background, but I recommend this
4344 one.
44-
45- 4. In the new terminal, run `docker-compose up ` to download and run the packaged software (the *PostgreSQL *
45+
46+ 4. In the new terminal, run `` docker-compose up ` ` to download and run the packaged software (the *PostgreSQL *
4647 database in this case).
47-
48- 5. Run `alembic upgrade head ` to create the database structure by setting up all the database tables, etc.
48+
49+ 5. Run `` alembic upgrade head ` ` to create the database structure by setting up all the database tables, etc.
4950
50515. Launch *mosbot *
51-
52- Go back to the first terminal, and run `bot ` to launch. The output of the command should be self explanatory.
52+
53+ Go back to the first terminal, and run `` bot ` ` to launch. The output of the command should be self explanatory.
5354
5455
5556
@@ -59,20 +60,20 @@ Project structure
5960This is a brief outline to cover the basics of the project structure:
6061
6162* The more inner layer and the thing that most defines the bot is the Data Model. This are the Entities that we
62- manage, and they are in `mosbot/db.py `.
63+ manage, and they are in `` mosbot/db.py ` `.
6364
6465* From there, because we have no ORM at the moment (asyncio doesn't have an async ORM yet), we have all the functions
65- and queries that operate on the data in `mosbot/query.py `.
66+ and queries that operate on the data in `` mosbot/query.py ` `.
6667
6768* Now you should be able to gather/write data and make some operations. There are some operations that are not as
6869 "simple" as the queries, and these are the "usecases" where you have a whole flow of queries and data transformation.
69- The place where these are stored is in `mosbot/usecase.py `
70+ The place where these are stored is in `` mosbot/usecase.py ` `
7071
7172* Finally, in the most outer layer, you have the two main "interfaces", this is where we receive the data from the
72- `abot ` library and we have the handlers and commands. The files are, `mosbot/handler.py ` for event handlers and
73- `mosbot/command.py ` for the commands.
73+ `` abot `` library and we have the handlers and commands. The files are, `` mosbot/handler.py ` ` for event handlers and
74+ `` mosbot/command.py ` ` for the commands.
7475
75- * There are two other files, that are "transversal" that are the `mosbot/utils.py ` and `mosbot/config.py `.
76+ * There are two other files, that are "transversal" that are the `` mosbot/utils.py `` and `` mosbot/config.py ` `.
7677
7778
7879You should think of this architecture (file structure/function dependencies) as an onion. The idea is that the most
@@ -91,6 +92,22 @@ Further recommendations
9192 rest of alternatives. Of course, you are free to choose whichever editor you want.
9293
9394
95+ Using the Helm chart
96+ --------------------
97+
98+ 1. Fetch/update chart dependencies:
99+
100+ .. code-block :: bash
101+
102+ helm dependency update ./helm
103+
104+
105+ 2. Install mosbot chart:
106+
107+ .. code-block :: bash
108+
109+ helm install ./helm
110+
94111
95112 Contributions
96113-------------
0 commit comments