A Slack bot for submitting and voting on ideas, built with Python. Submitted ideas are stored in a Firebase database, and displayed on a web page developed here.
The Slack bot component of this project is being developed under the Thunder You-Ship-We-Ship by Hack Club.
I'm following the tutorial from Slack Developer Tools in the initial stages.
- Submit ideas
- Vote on ideas
- View top ideas
- View recent ideas
- Create a Firebase project:
- Go to the Firebase Console
- Click "Add project" and follow the setup wizard
- Enter a project name and accept the terms
- (Optional) Configure Google Analytics
- Click "Create project"
- Create a Realtime Database:
- In your Firebase project console, click on "Build" in the left sidebar
- Select "Realtime Database"
- Click "Create Database"
- Choose a location for your database (typically the default option is fine)
- Start in test mode for development (you can update security rules later)
- Add a service account key to your project:
- In your Firebase project console, go to Project Settings (gear icon)
- Select the "Service accounts" tab
- Click "Generate new private key" button
- Save the JSON file securely (you'll need this for your application)
- Never commit this file to version control
If you're hosting this bot on Hack Club's Nest, follow these steps:
- Create a nest account following the instructions here.
- Connect to nest via ssh as described in the guide above.
- Clone this repository in the
pub/
directory:
cd pub/
git clone https://github.com/MaadhavBhatt/fork-this-idea-slack-bot.git
cd ..
- Move
update_repo.sh
to the root and make it executable. Use it to clone the repository automatically every time you deploy:
mv pub/fork-this-idea-slack-bot/update_repo.sh .
chmod +x update_repo.sh
- Create a
.env
file in the root directory and copy the contents from.env.example
, then fill in your Firebase and Slack credentials:
cp pub/fork-this-idea-slack-bot/.env.example .env
nano .env
- Copy the example service file into the systemd directory:
cp pub/fork-this-idea-slack-bot/ftibot.service.example ~/.config/systemd/user/ftibot.service
- Enable the service and check its status:
systemctl --user daemon-reload
systemctl --user enable --now ftibot.service
systemctl --user status ftibot.service