Copied URL with current time.
0:00 / 0:00

Get to Know Your Coworkers through Simple QA with This Slack App

In this episode of Running in Production, Adam Conrad goes over building a Slack bot service with Phoenix and Elixir. Itโ€™s hosted with Gigalixir for about $50 / month and has been up and running since mid 2018.

Adam talks about the wonderful Elixir community along with how Elixir helps him manage a bunch of concurrent tasks for his service. He also goes over a number of features that you get from using Gigalixir to host your Elixir projects.

Show Notes

  • 1:31 โ€“ Adam is the sole developer but he has a friend who helps him market the service
  • 2:38 โ€“ The Slack bot asks you a number of questions, such as your music preference
  • 6:01 โ€“ The public site uses Phoenix and the bot is written in Elixir
  • 6:25 โ€“ What made Elixir a perfect fit for this application?
  • 7:38 โ€“ Handling concurrency through tasks using Elixirโ€™s standard library
  • 9:16 โ€“ Several thousand questions are answered per day
  • 10:23 โ€“ Itโ€™s all done through Slack webhooks using the Elixir-Slack library
  • 11:28 โ€“ Slack bots are easy to start using but it gets complicated pretty quickly
  • 12:26 โ€“ Unix timestamps vs Gregorian seconds
  • 13:39 โ€“ The Elixir forums and Slack channel are great resources to get Elixir help
  • 15:13 โ€“ Are you using the latest version of Phoenix? Not yet
  • 17:50 โ€“ Phoenix is nice because it gently guides you into creating well structured apps
  • 19:19 โ€“ The stripity_stripe library is used to handle Stripe payments
  • 19:52 โ€“ The awesome-elixir repo on GitHub has a great list of libraries
  • 21:25 โ€“ It was hard to find a good well maintained authentication library for Elixir
  • 22:50 โ€“ The Elixir-Slack library was really helpful for Adamโ€™s project
  • 23:59 โ€“ Everything is stored in a PostgreSQL database
  • 25:02 โ€“ Gigalixir is used for hosting and itโ€™s well optimized for running Elixir in production
  • 25:56 โ€“ Gigalixir has really good support
  • 26:25 โ€“ Gigalixirโ€™s team is mostly composed of ex-Google / ex-Stripe employees
  • 27:50 โ€“ Gigalixir also has zero down time deploys for most deploys
  • 28:42 โ€“ nginx isnโ€™t being used and Gigalixir handles TLS too
  • 30:20 โ€“ The push for HTTPS everywhere and Letโ€™s Encrypt being easy but not that easy
  • 31:15 โ€“ Accessing your logs on Gigalixir by tailing your logs on the command line
  • 32:31 โ€“ Adam pays about $50 a month for everything on Gigalixir
  • 33:59 โ€“ Metrics related to server health can be found in the Gigalixir dashboard
  • 34:14 โ€“ Surviving the front page of HackerNews with an Elixir app on a hobby instance
  • 35:22 โ€“ Depending on user feedback for error reporting
  • 36:28 โ€“ Itโ€™s super nice to have a compiler warn you about flaws in your code
  • 36:57 โ€“ Gigalixir lets you git push your code to get it from your dev box into production
  • 38:04 โ€“ Code is also pushed to GitHub mainly for backup purposes
  • 38:23 โ€“ Code is tested locally before being pushed but testing a Slack integration is hard
  • 42:18 โ€“ Putting an app on the Slack app marketplace requires human review
  • 44:30 โ€“ Managing secrets with Gigalixir is done through their CLI, similar to Heroku
  • 45:03 โ€“ Database backups happen daily but the interval on Gigalixir can be configured
  • 47:26 โ€“ Email alerts are sent out by Gigalixir if your app happens to go down
  • 48:59 โ€“ Best tips? Leverage the Elixir community if you get stuck
  • 49:24 โ€“ Enjoy a language that a bit of novelty to it since itโ€™s still relatively young
  • 50:37 โ€“ Getting help for basic things from the creator of Elixir on IRC
  • 51:47 โ€“ Constantly looking at older code to see how it could be refactored
  • 52:57 โ€“ Using the Credo library to help analyze your code base for best practices
  • 55:07 โ€“ Check out their Slack app, follow Adam on Twitter @theadamconrad and GitHub

Shameless Plugs

  • Nick: Want to learn Docker? Join thousands of others in my Dive into Docker video course

Questions

Mar 09, 2020

โœ๏ธ Edit on GitHub