Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

A Slack app that pairs up paticipants for 1:1 conversations.

License

Notifications You must be signed in to change notification settings

bluedotimpact/networking-bot

Repository files navigation

This product is archived. This means we no longer use or develop it.


networking-bot

A Slack app that pairs up participants for 1:1 conversations.

Architecture diagram

How it works

Each week, a cron job set up in GitHub Actions hits an endpoint:

POST /api/scheduler/run

This runs the Vercel Serverless Function defined by run.ts.

It accesses a database, which stores:

  • installations (which contain Slack installation details, and references to AirTable bases with participants)
  • meetings
  • meeting feedbacks

For each installation, it gets participants and matches them up. It then finds them on Slack, creates a group DM and sends a message to that DM. It then records this as a new meeting.

When users click buttons in the message, events are triggered. These are handled in events.ts. Generally, these acknowledge the action, update the state of something in the database and send a follow-up message back to the channel.

Progress notes

Complete:

  • Set up project with API
  • Build db helper to safely use Airtable as a database
  • Set up Slack OAuth
  • Set up matcher basics
  • Set up multi-tenant participant fetching
  • State management, i.e. confirmed/completed
  • Handle receiving meeting feedback
  • Restrict participants to an Airtable view
  • Send follow-ups if no response
  • Deploy to Vercel
  • Handle multiple installations on the same Slack workspace
  • Trigger run for a single installation

Todo:

  • nice to have: smarter matcher logic
  • nice to have: time availabilities

(BlueDot Internal) Further documentation: https://www.notion.so/bluedot-impact/Networking-bot-89bec8d266884408839970b6d9512c62

Developer setup

  1. Clone this repository
  2. Install Node
  3. Install dependencies with npm install
  4. Get access to the [Example] Slack networking bot base and create an Airtable personal access token with the scopes 'data.records:read', 'data.records:write', 'schema.bases:read', 'block:manage'.
  5. Set the environment variables in .env.local
  6. Run the server with npm start

Local usage

So that OAuth and event callbacks to hit the right place, use localhost.run:

  1. Run ssh -R 80:localhost:3000 [email protected] (or ssh -R 80:localhost:3000 [email protected] if you want a longer lasting domain - requires free signup)
  2. In the Slack console for '(local) networking bot':
  1. In .env.local update the SLACK_REDIRECT_URI

You should then be able to use the app at your lhr.life url.

Data is stored in the Airtable base here: https://airtable.com/appnNmNoNMB6crg6I/tblzo9A4hjnxs8ezd/viwr3hvlKM7ebsf9v

Deployment

This app is deployed using Vercel and uses an Airtable base as a database. API keys are stored safely in Vercel environment variables. GitHub Actions hits the scheduler endpoint.

To deploy a new version, simply commit to the master branch. GitHub Actions automatically handles CD, via npm run deploy:prod.

About

A Slack app that pairs up paticipants for 1:1 conversations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published