Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,12 @@ PNPM_FLAGS=--shamefully-hoist
# readonly key for membership base:
# MEMBERSHIP_AIRTABLE_API_KEY=token
#
# Webhooks (Slack / Zoom / co-working bot):
# Redirect functions (/join-coffee and /join-slack in /netlify/functions/):
#
# These power the Netlify Functions in /netlify/functions/. Most are only needed if you're
# working on those functions locally — production values live in Netlify's env settings.
# Only needed if you're working on those functions locally — production values live in
# Netlify's env settings.
#
# Slack app credentials (https://api.slack.com/apps):
# SLACK_BOT_TOKEN=xoxb-...
# SLACK_SIGNING_SECRET=...
# SLACK_ANNOUNCEMENTS_CHANNEL=C...
# SLACK_EVENT_ADMIN_CHANNEL=C...
# SLACK_JOIN_LINK=https://join.slack.com/t/...
#
# Zoom app credentials (https://marketplace.zoom.us/develop/apps):
# ZOOM_WEBHOOK_SECRET_TOKEN=...
# ZOOM_WEBHOOK_AUTH=...
# ZOOM_TUESDAYS=https://zoom.us/j/...
# ZOOM_THURSDAYS=https://zoom.us/j/...
#
# Airtable base for co-working rooms (used by scripts/build-rooms.ts and the zoom webhook handler):
# AIRTABLE_COWORKING_BASE=app...
#
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,12 @@ All of the data points have mock data that is used if the required API key isn't

If you'd like to work on a feature that requires an API key, please reach out to a maintainer and we can probably get that going.

## Webhooks
## Netlify Functions

Netlify Functions in `netlify/functions/` handle webhook events for the Slack and Zoom integrations, plus scheduled event reminders. Shared utilities and types live in `netlify/functions/_shared/`.
Netlify Functions in `netlify/functions/` provide two short-link redirects (rewrites configured in `netlify.toml`):

HTTP endpoints (rewrites configured in `netlify.toml`):

- **`/slack-events`** — Slack Events API. Currently handles `team_join` (welcome message) and `app_home_opened` (publishes the welcome view to a member's App Home).
- **`/slack-interactivity`** — Slack interactivity URL. Shares the same handler as `/slack-events`; required to keep buttons in Slack messages working.
- **`/zoom-meeting-webhook-handler`** — Zoom meeting webhooks. Tracks `meeting.{started,ended,participant_joined,participant_left}` for the co-working room and posts/updates Slack messages and Airtable records.
- **`/join-coffee`** and **`/join-slack`** — short-link redirects to the Tuesday/Thursday Zoom rooms and the Slack invite link.

Scheduled functions (cron schedules declared inline via `export const config`):

- **`event-reminders-daily`** — `0 12 * * *` (12pm UTC daily). Posts that day's events to the announcements channel; skips Mondays since the weekly reminder runs that day.
- **`event-reminders-hourly`** — `50 * * * *` (50 minutes past every hour). Posts upcoming events starting in the next hour.
- **`event-reminders-weekly`** — `0 12 * * 1` (Monday 12pm UTC). Posts the week's events.

The `scripts/build-rooms.ts` prebuild step pulls co-working room records from Airtable into `data/rooms.json`, which is bundled into the Zoom function via `included_files` in `netlify.toml`.
- **`/join-coffee`** — redirects to the Tuesday/Thursday Zoom rooms.
- **`/join-slack`** — redirects to the Slack invite link.

## Adding content

Expand Down
2 changes: 0 additions & 2 deletions data/.gitignore

This file was deleted.

18 changes: 3 additions & 15 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
autoLaunch = false
framework="next"

[functions]
included_files = ["data/*.json"]

[[headers]]
for = "/_next/static/*"
[headers.values]
Expand Down Expand Up @@ -212,19 +209,10 @@
status = 200

[[redirects]]
from = "/zoom-meeting-webhook-handler"
to = "/.netlify/functions/zoom-meeting-webhook-handler"
status = 200

[[redirects]]
from = "/slack-interactivity"
to = "/.netlify/functions/slack"
status = 200

[[redirects]]
from = "/slack-events"
to = "/.netlify/functions/slack"
from = "/bots/*"
to = "https://vc-bots.lucky-art-2f02.workers.dev/:splat"
status = 200
force = true

[[redirects]]
from = "/plausible/js/script.js"
Expand Down
17 changes: 0 additions & 17 deletions netlify/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,10 @@ declare namespace NodeJS {
CMS_TOKEN?: string;

// Slack
SLACK_BOT_TOKEN?: string;
SLACK_SIGNING_SECRET?: string;
SLACK_ANNOUNCEMENTS_CHANNEL?: string;
SLACK_EVENT_ADMIN_CHANNEL?: string;
SLACK_JOIN_LINK?: string;

// Zoom
ZOOM_WEBHOOK_SECRET_TOKEN?: string;
ZOOM_WEBHOOK_AUTH?: string;
ZOOM_TUESDAYS?: string;
ZOOM_THURSDAYS?: string;

// Airtable
AIRTABLE_COWORKING_BASE?: string;

// Test overrides
TEST_SLACK_BOT_TOKEN?: string;
TEST_SLACK_SIGNING_SECRET?: string;
TEST_SLACK_ANNOUNCEMENTS_CHANNEL?: string;
TEST_SLACK_EVENT_ADMIN_CHANNEL?: string;
TEST_ZOOM_WEBHOOK_SECRET_TOKEN?: string;
TEST_ZOOM_WEBHOOK_AUTH?: string;
}
}
18 changes: 0 additions & 18 deletions netlify/functions/_shared/slack.ts

This file was deleted.

22 changes: 0 additions & 22 deletions netlify/functions/_shared/types/cms.ts

This file was deleted.

15 changes: 0 additions & 15 deletions netlify/functions/_shared/types/room.ts

This file was deleted.

77 changes: 0 additions & 77 deletions netlify/functions/_shared/verify.ts

This file was deleted.

Loading
Loading