Skip to content

Commit

Permalink
docs: add quick setup guide
Browse files Browse the repository at this point in the history
  • Loading branch information
viliusddd committed Jul 30, 2024
1 parent 44feef5 commit 9eb290b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DATABASE_URL='./data/database.db'
PORT=3000
DISCORD_TOKEN=''
DISCORD_CHANNEL_ID=''
DISCORD_GUILD_ID=''
GIPHY_API_KEY=''
DISCORD_TOKEN='MTI2NzgzMTU1NTc0MTU4MTM4Mg.G8mDef.HfkhetjZXJX3l2H7pOYEvYYV2CDu3EDy3Ox5bw'
DISCORD_CHANNEL_ID='1267837479835402260'
DISCORD_SERVER_ID='1267492271385743421'
GIPHY_API_KEY='RezKMkdertExeFOQQrI54n632J31BHTp'
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ It's a dynamic Discord bot powered by a REST API that celebrates user achievemen

- [Bravo! Bot 🎉](#bravo-bot-)
- [Features](#features)
- [TL;DR SETUP](#tldr-setup)
- [Discord Setup](#discord-setup)
- [Project Setup](#project-setup)
- [Examples](#examples)
- [Messages](#messages)
- [CRUD Sprints (praises | templates | users | emojis)](#crud-sprints-praises--templates--users--emojis)
Expand All @@ -20,6 +20,30 @@ It's a dynamic Discord bot powered by a REST API that celebrates user achievemen
- DB is seeded with data.
- GH Action for linting and testing.

## TL;DR SETUP

1. Join test server https://discord.gg/vAxt2mvsNe
2. Clone repo, setup and run app:

```sh
git clone [email protected]:viliusddd/bravo-bot.git && \
cd bravo-bot && \
cp .env.example .env && \
npm i && \
npm run migrate:latest && \
npm run dev
```

3. Execute cUrl POST in cli (or any other cmd from [Examples](#examples)):

```sh
curl -sX POST http://localhost:3000/messages \
-H 'Content-Type: application/json' \
-d '{"username": "vjuodz", "sprintCode": "WD-1.3.4"}' | jq
```

4. Voila! Check message at discord server.

## Discord Setup

1. Create a copy of `.env.example` and rename it to `.env`
Expand All @@ -37,18 +61,6 @@ It's a dynamic Discord bot powered by a REST API that celebrates user achievemen
4. paste copied url at you internet browser, choose channel you want your bot to reside.
7. Paste yur app token to the `.env` and fill in the rest of the variables.

## Project Setup

1. Clone repo, `cd` and run `npm i` at project root dir.
2. Create copy of `.env.example` and rename it to `.env`
3. Add correct values to `.env`
4. Seed example data to database and update types (optionally):

```sh
npm run migrate:latest
npm run gen:types
```

## Examples

### Messages
Expand Down

0 comments on commit 9eb290b

Please sign in to comment.