TreeHacks Slack Mentorship System
This is an experimental (read: not quite production-ready) version of TreeHacks' new Slack-based mentorship system. What follows is an explanation of how everything works and our design decisions, but if you'd like to get it running right now, head on down to Get It Running.
Why Slack? Communication is a huge problem at hackathons, and Slack gives us a really nice unified communications platform, including announcements, feedback, volunteer communication, hacker questions, sponsor relations, hacker-to-hacker community chat, and now, mentorship. Plus, we get configurable mobile and email notifications for free.
Note that this is still pretty hacky. It works well in our manual tests, but it's undocumented, has no automated testing, and utilizes some private API's. Use at your own risk, yada yada yada. That said, we're committed to making this really awesome, and we'd love all the help we can get - Pull Requests welcome! We'd be delighted if this got used at other events, and if you need any kind of help setting it up, shoot an email to
The system is a basically Hacker News distilled into one repo - it's built with node.js, ES6 (via Babel), React, and Material Design. The app is split into two components: Mentorbot (bot) and Mentor Dashboard (dash). They share a lot of code and complement one another, but they each work perfectly fine on their own, so we'll explain them separately.
This is the heart of the mentorship system. This code (located in
src/bot.js) implements a flow that sounds pretty complicated, but once you try it out, is actually pretty slick. Here's how it all works:
- Invite mentors to a private mentorship group (we use
#mentors). This is nice, since it requires no database, no sign-up process, and no lists. Getting a mentor set up is as simple as
/invite @mentor-username. The room will auto-delete any non-bot posts to keep it clean for tickets (explained below).
- Hackers request help in plain English using the
/mentorslash command from anywhere inside Slack. Example:
- The question is posted inside the
#mentorsgroup, and any mentor can claim it by tapping the
🙋emoji reaction. Here's what it looks like:
- Once a mentor claims the ticket, it's deleted from the mentor room. Then, the mentor and hacker are invited to a private chat to discuss the issue and hopefully meet up. That's it!
This has a couple advantages. It works accross phones and laptops, with nice notifications via push or email. It also requires no database (fewer dependencies!), relying solely on Slack to make it all happen. In the future, we might add a DB for metrics and such, but it's not required.
Mentor Dashboard (dash)
Mentorbot works great if mentors pay close attention to the
So, we whipped up a quick web GUI for managing tags. Mentors simply sign in via Slack OAuth and add some tags (the tag database includes StackOverflow's top 1000 tags, which we felt was sufficient). It's mobile-friendly, and while pretty sparse, it's not too bad looking. Here's a screenshot:
The backend automatically sets the mentor's highlight words, including all relevant synonyms. Just like Mentorbot, this needs no database, instead using Slack as its single source of truth.
Get It Running
- Publicly-accessible webserver. If you wanna try it on your laptop, ngrok is amazing.
nodebinary on that server.
- Admin account on your Slack instance.
Here's how everyting is laid out. You don't need to know any of this to get it running, but if you need to monkey around in the source, it's good to know.
||The mentor dashboard|
||Styles for the dashboard (duh)|
||Compiled (babelified, browserified, uglified) version of
||Lists all dependencies|
||Sample config file. Move this to
||Main entry-point for the app. Run
||Code for mentorbot|
||Code for the client-side mentor dashboard|
||Server powering the dashbord|
||Custom slack library|
||Handles all the indexing/searching of tags for dash-client|
||List of all 1000 top StackOveflow tags, their synonyms, and their related tags|
To configure everything for your specific Slack, follow the instructions inside
sample-config.js. In no particular order, you're going to have to:
- Grab your own token
- Create a new Slack user and grab its token
- Create a slash command
- Create a new Slack OAuth app
Don't worry, it's all in that file. Once you're done, run
mv sample-config.js config.js, since the code expects that filename. Note that
config.js will be gitignored so you don't accidentally leak your secrets.
cdinto the top-level folder (
slack-mentorshipif you cloned from github)