Go to file
DataHearth 5d1f7c5b43
Rust / Run tests (push) Successful in 2m12s Details
Docker / Build and push builder images (push) Successful in 10m4s Details
Docker / Build and push service images (database) (push) Successful in 10m3s Details
Docker / Build and push service images (bot) (push) Successful in 10m26s Details
Docker / Build and push service images (web) (push) Successful in 11m45s Details
add error button a tag
2023-08-23 16:23:54 +02:00
.gitea/workflows try speeding up build process 2023-08-14 11:24:17 +02:00
bot syntax 2023-08-14 09:40:54 +02:00
database update graphql schema 2023-08-14 09:37:27 +02:00
frontend add error button a tag 2023-08-23 16:23:54 +02:00
.dockerignore Feat: add web, database and discord micro-services (#1) 2023-08-10 11:43:00 +02:00
.gitattributes Feat: add web, database and discord micro-services (#1) 2023-08-10 11:43:00 +02:00
.gitignore Feat: add web, database and discord micro-services (#1) 2023-08-10 11:43:00 +02:00
Cargo.lock Feat: add web, database and discord micro-services (#1) 2023-08-10 11:43:00 +02:00
Cargo.toml Feat: add web, database and discord micro-services (#1) 2023-08-10 11:43:00 +02:00
Dockerfile try speeding up build process 2023-08-14 11:24:17 +02:00
Justfile add cmd to generate schema.json 2023-08-14 11:25:01 +02:00
LICENSE set license 2023-05-24 09:59:05 +02:00
README.md update doc 2023-08-14 11:24:46 +02:00

README.md

tech-bot

Description

Save technologies you want to share/remember in a simple way inside Discord.

How to use

Install

Docker

# BOT
cat << EOF > .env
DISCORD_TOKEN=TOKEN
GRAPHQL_ENDPOINT="http://database/graphql"
EOF

# DATABASE
cat << EOF > .env
DB_PATH="/path/to/db/database.db"
EOF

# FRONTEND
cat << EOF > $DOTENV_CONFIG_PATH # <==== Default to "/app/config/.env" in the image
PORT=3000
HOST=127.0.0.1
PUBLIC_GRAPHQL_ENDPOINT="http://database/graphql"
CLIENT_ID="DISCORD_APP_ID"
CLIENT_SECRET="DISCORD_APP_SECRET"
ORIGIN="http://host"
EOF

# Side note: ".env" file for "bot" and "database" are not mandatory, but if you don't use them, you will need to pass the environment variables to the container. Default path for ".env" is "/.env"

docker run -d \
  --name tech-bot-bot \
  -v $PWD/.env:/.env \
  --restart unless-stopped \
  gitea.antoine-langlois.net/datahearth/tech-bot:bot-latest

docker run -d \
  --name tech-bot-database \
  -v $PWD/.env:/.env \
  -v $DATABASE_VOLUME:/app \
  --restart unless-stopped \
  gitea.antoine-langlois.net/datahearth/tech-bot:database-latest

docker run -d \
  --name tech-bot-front \
  -v $FRONT_VOLUME:/app/config \
  -p ${EXTERNAL_PORT}:${INTERNAL_PORT} \
  --restart unless-stopped \
  gitea.antoine-langlois.net/datahearth/tech-bot:front-latest

Manually

# Setup
git clone https://gitea.antoine-langlois.net/datahearth/tech-bot.git
cd tech-bot

# Database & Bot
## Build
cargo build --release

# Run
# BOT
cat << EOF > .env
DISCORD_TOKEN=TOKEN
GRAPHQL_ENDPOINT="http://database/graphql"
EOF

# DATABASE
cat << EOF > .env
DB_PATH="/path/to/db/database.db"
EOF

. ./target/release/tech-bot/database
. ./target/release/tech-bot/bot

# Frontend
cd frontend

## Build
pnpm install --prod --frozen-lockfile
pnpm build

## Run
export PORT=3000
export HOST=127.0.0.1
export PUBLIC_GRAPHQL_ENDPOINT="http://database/graphql"
export CLIENT_ID="DISCORD_APP_ID"
export CLIENT_SECRET="DISCORD_APP_SECRET"
export ORIGIN="http://host"
node -r dotenv/config build

Usage

Hello fellow human! I am a bot that can help you adding new technologies to a git repository.

To add a new technology, just type:

/add <technology> <link>

To list all technologies, just type:

/list


To search for a technology, just type:

/search <technology> <options> <tags>


To remove a technology, you need to have the permission to remote a tech from the list.
If so, just type:

/remove <technology>


To update a technology, you need to have the permission to update a tech from the list.
If so, just type:

/update <UUID> <technology> <link> <tags>


To get help, just type:

/help