When I started building The Factory’s Discord community, I needed bots that could handle slash commands, generate AI-powered daily digests, and run a gamified LeetCode challenge — all without managing servers 24/7.
The Architecture
The entire platform runs on AWS Lambda with API Gateway as the entry point. Discord sends interaction webhooks to our API Gateway endpoint, which routes to a verifier Lambda that handles Ed25519 signature verification, button clicks, and slash command dispatch.
Heavy work (like AI summarisation) gets dispatched to SQS, picked up by a worker Lambda, and executed on a small EC2 instance running the Claude Code agent SDK.
Why Serverless?
Cost. The entire platform runs within AWS free tier — Lambda, SQS, API Gateway, EventBridge. Total monthly cost: under $18 including the EC2 instance.
Reliability. No servers to patch, no processes to monitor. The bots are always available because there’s nothing to go down.
What’s Next
We’re expanding the digest system to cover more topics and publishing them publicly on this website. Stay tuned.