Skip to content

Repository files navigation

slack-bot

Pixel — friendly analytics sidekick. Ask in plain English; Pixel chats up Mixpanel and the gateway DB so you don't have to.

About

Meet Pixel, the analytics bot who'd much rather you didn't have to write SQL today.

@mention Pixel in any channel (or DM directly) with a plain-English question — "how many DAU last week?", "checkout conversion this quarter?", "top 5 features used by paying users?" — and Pixel scampers off to interrogate the gateway database and politely ping Mixpanel. A few seconds later you get back an answer with assumptions, a confidence badge, and a deep-link to the Mixpanel dashboard if there's a chart worth seeing.

Not quite what you meant? Tap Refine, tweak the question, and Pixel takes another swing. In-thread follow-ups remember the conversation, so "now break it by platform" just works.

No SQL editor. No Mixpanel hunting. No "can someone pull this number for me?" threads.

See HLD.md for the full spec.

Setup

npm install
cp .env.example .env
# fill in SLACK_BOT_TOKEN, SLACK_APP_TOKEN, SLACK_SIGNING_SECRET, BACKEND_URL
npm run dev

/healthzhttp://localhost:3000/healthz.

Slack app config

In api.slack.com/apps for this app:

  • Socket Mode ON (generates xapp-… app-level token with connections:write)
  • Interactivity ON
  • Bot user enabled
  • Bot scopes (OAuth & Permissions):
    • app_mentions:read
    • chat:write
    • im:read
    • im:write
    • im:history
    • users:read
  • Event Subscriptions (Subscribe to bot events):
    • app_mention
    • message.im
  • Install to workspace → copy xoxb-… bot token + signing secret to .env

Bot identity: Pixel (@pixel). Invite to a channel with /invite @pixel.

Scripts

script purpose
npm run dev tsx watch on src/index.ts
npm run build tscdist/
npm run start run compiled dist/index.js
npm test vitest single run
npm run test:watch vitest watch
npm run lint eslint over src + tests + mock-backend
npm run format prettier write
npm run typecheck tsc --noEmit
npm run mock start mock analytics backend (see mock-backend/README.md)
npm run mock:watch mock backend in watch mode

Layout

See HLD §16.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages