Lifetime: Khan Academy ported some code I wrote; it now runs all of their internal user engagement metrics.<p>Recently: Erin and Thomas are still busy putting the finishing touches on their half of Starfighter, and I'm basically just on client communications duty, so I gave myself a two-day engineering project as time off for good behavior.<p>Certain events which happen when players play Starfighter games are significant. We want to congratulate players when they happen, ideally in as close to real-time as possible. Also, since "strike when the iron is hot", if that player happens to be a job seeker that would be a really good time to do an introductory phone call if they're willing to do one.<p>We have heuristics which identify these important events and pipe them into Slack. The plan was originally "If we see one of the notifications, send them a person-to-person email."<p>But if you're playing Starfighter in your browser, you aren't in your email client, so you might not see the email until e.g. the next day. What we really want is like Facebook messenger, except inside our own application, hooked up to Slack, with the ability to be selective about who it is open to.<p>Enter Apollo, messenger of the gods:<p>Front-end: React and SockJS
Back-end: SockJS-go, some Go glue code, and NSQ
Back-end for Slack: three very trivial endpoints in our main Ruby on Rails application
Interface on Slack: two slash commands and one asynchronous incoming webhook<p>How it looks in practice:<p>In-app message window: <a href="https://www.evernote.com/l/Aaf2wn2dyxhPDoHAzSYymDcNIasqcmj91McB/image.png" rel="nofollow">https://www.evernote.com/l/Aaf2wn2dyxhPDoHAzSYymDcNIasqcmj91...</a><p>Slack:
<a href="https://www.evernote.com/l/Aadc-vDMIpxNc7z6XZ1_xH1jMSNOVJ-580gB/image.png" rel="nofollow">https://www.evernote.com/l/Aadc-vDMIpxNc7z6XZ1_xH1jMSNOVJ-58...</a><p>Not bad for two days of work. (Starfighter will likely OSS the only hard part of this, which is the NSQ-to-websocket piece.)