From d2c7fb70287f50717a5d883df78bca8c5f67bff6 Mon Sep 17 00:00:00 2001 From: Bertik23 Date: Thu, 8 Sep 2022 11:51:02 +0200 Subject: [PATCH 1/3] More information --- docs/howto.md | 58 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/docs/howto.md b/docs/howto.md index 991816c5..8524868e 100644 --- a/docs/howto.md +++ b/docs/howto.md @@ -1,7 +1,11 @@ # How to Start -## Configuration +## Prerequisites +Make sure you have the latest .NET Core and ASP.NET installed. You can find +install instructions [here][dotnet]. +You'll also need to have docker installed. +## About our configuration For configuration, we use a combination of the standard `appsettings.json` file and `secrets.json`. Non-sensitive information is stored in the `appsettings.json` file and sensitive information is stored in place outside of the git repository. @@ -45,29 +49,17 @@ Discord token can be found on [Discord developer portal][discordDev]. Database URL in the example is working with provided docker image which can be found in [compose file][compose]. -## Setup +## Initial configuration +To be able to run the bot locally you need to setup some configs. +- Set the Discord token of your test app and the `DATABASE_URL` parameter +in [`secrets.json`][secrets] the other secrets are not needed for your average +development needs. +- Change `Discord.GuildId` in `appsettings.Development.json` to the id of your +test guild +- Change `CustomVoiceOptions.ClickChannelId` in `appsettings.Development.json` to +an id of a voice channel in your test guild -Before you can start working on the botyou need to download the latest released version of .NET. -Available version can be found [here][dotnet]. -We also need to have access to PostgresDB. -For development we use docker image, -so you will need to download it too, -or you can use other Postgres instance. - -## Startup - -Before starting the bot itself we will need to start DB by the following command: - -```sh -docker-compose up -d -``` - -if everything went well you will see `Starting postgres-botner ... done`. - -After that, you can start up the project in your favorite IDE -or by typing `dotnet run --project ./src/HonzaBotner/`. - -## Migrations +## Database and migrations To modify the database scheme we need to process migrations. For that, we need to install a tool that does that. @@ -81,7 +73,7 @@ We can see generated files in `src/HonzaBotner/Migrations`. If everything is OK we can update our DB by the following command: ```sh -dotnet ef database update +dotnet ef database update --project ./src/HonzaBotner ``` With this, we will get migration based on our code @@ -95,6 +87,24 @@ cd src/HonzaBotner dotnet ef migrations add "Name of migration" ``` +# Startup + +Before starting the bot itself we will need to start DB. + +If you are on Linux start the docker service using `systemctl start docker` + +Than start the DB using the following command: + +```sh +docker-compose up -d +``` + +if everything went well you will see `Starting postgres-botner ... done`. + +After that, you can start up the project in your favorite IDE +or by typing `dotnet run --project ./src/HonzaBotner/`. + + [dotnet]: https://dotnet.microsoft.com/download [compose]: ../docker-compose.yml [discordDev]: https://discord.com/developers/applications From 4a75ae24558329a67eaacc3d25ce37c0815db258 Mon Sep 17 00:00:00 2001 From: Honza Bittner Date: Mon, 12 Sep 2022 10:06:03 +0200 Subject: [PATCH 2/3] Update docs/howto.md --- docs/howto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/howto.md b/docs/howto.md index 8524868e..0da033cf 100644 --- a/docs/howto.md +++ b/docs/howto.md @@ -55,7 +55,7 @@ To be able to run the bot locally you need to setup some configs. in [`secrets.json`][secrets] the other secrets are not needed for your average development needs. - Change `Discord.GuildId` in `appsettings.Development.json` to the id of your -test guild +test guild. - Change `CustomVoiceOptions.ClickChannelId` in `appsettings.Development.json` to an id of a voice channel in your test guild From 18fbe509a0a6ea18e1691e5e2b1b569a9ec8212c Mon Sep 17 00:00:00 2001 From: Honza Bittner Date: Mon, 12 Sep 2022 10:06:09 +0200 Subject: [PATCH 3/3] Update docs/howto.md --- docs/howto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/howto.md b/docs/howto.md index 0da033cf..26f44dc8 100644 --- a/docs/howto.md +++ b/docs/howto.md @@ -57,7 +57,7 @@ development needs. - Change `Discord.GuildId` in `appsettings.Development.json` to the id of your test guild. - Change `CustomVoiceOptions.ClickChannelId` in `appsettings.Development.json` to -an id of a voice channel in your test guild +an id of a voice channel in your test guild. ## Database and migrations