Coder Social home page Coder Social logo

andreffs18 / santosbot Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 28.35 MB

🤖Bot that spits out quotes from Gustavo Santos

Home Page: https://santosbot.herokuapp.com

License: MIT License

Python 38.95% Jupyter Notebook 42.39% Dockerfile 1.48% JavaScript 1.10% Vue 5.92% Shell 0.72% HTML 1.85% SCSS 7.56% Procfile 0.03%
bot quotes slack-bot gustavo santos heroku heroku-deployment

santosbot's Introduction

Slack Bot that spits out quotes from Gustavo Santos whenever a *Trigger Word* is written.

Built with ❤︎ by André Silva

Installation

To run this locally you just need to have docker installed.

Make sure you export your SLACK_API_TOKEN. More on that can be found on the /bot README file.

$ export SLACK_API_TOKEN=xoxb-*****

Usage

This project is divided into 3 parts:

  • Backend API: Python ASGI web server that exposes an web API for getting quotes.
  • Frontend App: VueJS app that helps to showcase bot functionality.
  • Slack Bot: Actual slack bot that you can run to interact with.

By running with $ docker-compose up you instantiate all 3 services, which then can be accessed on a browser (http://localhost:8080).

If you configured the SLACK_API_TOKEN then you should also be able to use the bot on your Slack team account, out of the box! 📦

Instructions on how to run each service separately can be found in each service folder.

Deployment

This project is hosted on Heroku, on just one dyno!. Yup, 3 apps, different languages, one dyno. You can check it on https://santosbot.herokuapp.com.

The structure is pretty simple:

  • There is an nginx app, working as reverse proxy, that redirects all requests to the frontend app;
  • All "/api" request are proxied to the backend server;
  • The actual bot is just running on a different process, and connects to my slack account using slack RTM library (yup, I have this live, working, just for the sake of it)
  • Every process was started by honcho (foreman port to python) to bypass the number of dynos restriction on heroku.

There is actually a blogpost explaining how I achieved that, so you might just check that out 😄.

If your curious commit 462b27a added all necessary files to make the app public, via heroku.

santosbot's People

Contributors

andreffs18 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

streetgt

santosbot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.