Skip to content

Refactor routes and middleware: Extract Slack endpoints and admin routes - #383

Merged
bokelley merged 3 commits into
mainfrom
bokelley/addie-slack-separate-endpoint
Dec 29, 2025
Merged

bokelley merged 3 commits into
mainfrom
bokelley/addie-slack-separate-endpoint

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Refactored http.ts to extract routes and middleware into separate modules for better organization. Added separate Slack endpoint for Addie AI assistant with independent signing secret configuration. Extracted admin routes into /admin/ subdirectory for clarity.

Changes

  • Extract Slack middleware to server/src/middleware/slack.ts with reusable signature verification
  • Extract public Slack routes to server/src/routes/slack.ts supporting both AAO bot and Addie
  • Extract admin Slack routes to server/src/routes/admin/slack.ts
  • Extract admin Email routes to server/src/routes/admin/email.ts
  • Create shared unified users cache in server/src/cache/unified-users.ts

Test plan

  • ✅ Local Docker container testing: site pages load, APIs respond correctly
  • ✅ TypeScript compilation successful
  • ✅ All existing tests passing (schema, unit, typecheck)
  • ✅ No breaking changes to existing endpoints

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 [email protected]

bokelley and others added 3 commits December 29, 2025 10:08
Extract public Slack webhook routes into separate modules for better organization
and maintainability. Create reusable Slack middleware and separate endpoint
handlers for the main AAO bot and Addie AI assistant.

Changes:
- Add separate Slack events endpoint for Addie AI (/api/addie/slack/events)
- Extract Slack middleware to server/src/middleware/slack.ts
- Extract public Slack routes to server/src/routes/slack.ts
- Extract admin Slack routes to server/src/routes/admin/slack.ts
- Extract admin Email routes to server/src/routes/admin/email.ts
- Create shared unified users cache in server/src/cache/unified-users.ts
- Update CLAUDE.md with Slack app configuration documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
BREAKING CHANGE: Slack endpoint URLs changed:
- /api/slack/events → /api/slack/aaobot/events
- /api/slack/commands → /api/slack/aaobot/commands
- New: /api/slack/addie/events

All Slack routes now under /api/slack/{app}/ for consistency.
Update Slack app Event Subscription URLs after deployment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Keep both Slack Apps and Dev Mode Testing sections in CLAUDE.md
- Use our refactored slack.ts with separate admin routes
- Remove duplicate Slack route mounts from origin/main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant