Skip to content

Commit

Permalink
Modify readme to be more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
MelvinCou committed Apr 1, 2024
1 parent 0a46ba5 commit 97f1536
Showing 1 changed file with 55 additions and 25 deletions.
80 changes: 55 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,61 @@ This list contains all the software programs necessary to run DraftBot. Our star
This guide will help you run DraftBot on your computer. We provide instructions for Linux, MacOS (🐧) and Windows (🪟). If not specified, the command is the same for all OS.
Please do not skip any step of this guide, otherwise, the following commands will not work.

- Install git: 🐧 `apt-get install git` | 🪟 https://git-scm.com/download/win
- Download the bot: `git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure`
- Switch to the DraftBot v5 branch `git checkout draftbot-v5`
- Install NodeJS (check nvm documentation for instructions)
- Check any package.json for the minimal required version
- Install Yarn `npm install --global yarn`
- Install and launch a mariadb database. Keep the credentials for the config file.
- Here is a command that will help you create a database container. (Please replace the relevant parameters of this command)
`docker run -d --name mariadb -e MARIADB_USER=draftbot -e MARIADB_PASSWORD=secret_password -e MARIADB_ROOT_PASSWORD=super_secret_password -v /path/to/volumes/mariadb:/var/lib/mysql -p 3306:3306 mariadb:latest`
- Move to the Core folder: `cd Core`
- Create the config file by copying the file config.default.toml in a new file config.toml
- Edit the file config.toml with the correct data
- Install the Core module: `yarn install`
- Move to the Keycloak folder: `cd ../Keycloak`
- Follow the instructions in the README.md file of the Keycloak folder
- Move to the Discord folder: `cd ../Discord`
- Create the config file by copying the file config.default.toml in a new file config.toml
- Edit the file config.toml with the correct data
- Install the Discord module: `yarn install`
- Move to the lib folder: `cd ../lib`
- Install the lib module: `yarn install`
- The Core module also need access to the Keycloak server on the first launch. You need to create the relevant config file in the Core folder: 🐧 `cd ../Core && touch keycloak.toml` | 🪟 `cd ../Core && type nul > keycloak.toml`
- You can copy and paste the content of the keycloak section from the config.toml file in the Discord folder in the keycloak.toml file
- You can now start the Core module: `yarn start`
- and the discord module `cd ../Discord && yarn start`
1. Install tools

```sh
# Install git
apt-get install git # 🐧
winget install git # 🪟
# Install yarn with npm
npm install --global yarn
```

2. Setup projects

```sh
# Clone the repository
git clone https://github.com/BastLast/DraftBot-A-Discord-Adventure Draftbot
cd Draftbot
export DRAFTBOT_ROOT=$PWD # 🐧
Set-Variable DRAFTBOT_ROOT $PWD # 🪟
# Switch to the DraftBot v5 branch
git checkout draftbot-v5
# Install dependencies in projects
cd $DRAFTBOT_ROOT/Core && yarn install
cd $DRAFTBOT_ROOT/Discord && yarn install
cd $DRAFTBOT_ROOT/Lib && yarn install
```

3. Setup database and Keycloak

For Keycloak, follow instructions in [README.md](./keycloak/README.md) in the keycloak folder.

```sh
# Run mariadb database with docker
docker run -d --name mariadb -e MARIADB_USER=draftbot -e MARIADB_PASSWORD=secret_password -e MARIADB_ROOT_PASSWORD=super_secret_password -v /path/to/volumes/mariadb:/var/lib/mysql -p 3306:3306 mariadb:latest
```

4. Fill config files

```sh
# Copy files with default values
cp $DRAFTBOT_ROOT/Core/config/config.default.toml $DRAFTBOT_ROOT/Core/config/config.toml
cp $DRAFTBOT_ROOT/Core/config/config.default.toml $DRAFTBOT_ROOT/Core/config/config.toml
# The Core module also need access to the Keycloak server on the first launch
touch $DRAFTBOT_ROOT/Core/config/keycloak.toml # 🐧
New-Item $DRAFTBOT_ROOT/Core/config/keycloak.toml # 🪟
# You can copy and paste the content of the keycloak section from the config.toml file in the Discord folder in the keycloak.toml file
```

5. Run projects

```sh
# First: start the core module
cd $DRAFTBOT_ROOT/Core && yarn start
# Then: start the discord module
cd $DRAFTBOT_ROOT/Discord && yarn start
```

You can set up npm launch scripts to make the start easier.
From now on you should be able to start the bot by running `yarn start` in the Core and Discord folders while having the database and keycloak running.
Expand Down

0 comments on commit 97f1536

Please sign in to comment.