How just-boris/squash-umfrage works
Project type and purpose
• This is a serverless “Squash poll bot” for Telegram, implemented as a set of AWS Lambda functions and deployed via AWS CDK.
• Its purpose is to receive incoming updates from Telegram (via webhooks), schedule or send poll messages, and respond back to Telegram users.
File structure
• Top level:
• cdk.json, src/infrastructure/… – AWS CDK app that defines your cloud resources.
• src/lambda/… – all Lambda function code, plus its own package.json.
• .env.example – local test configuration for the Telegram bot token.
• local-test.js – helper to invoke Lambdas locally.
• Inside src/infrastructure:
• index.ts – CDK entrypoint (App).
• notification-stack.ts – CDK Stack that provisions the API Gateway, Lambdas, IAM roles, SSM parameter(s), and any scheduled events.
• Inside src/lambda:
• index.ts – the main webhook handler.
• messages.ts, duration.ts, ssm.ts, utils.ts – helper modules for message formatting, scheduling logic, SSM parameter retrieval, and common utilities.
• src/interfaces.ts holds TypeScript interfaces shared across both infra and Lambdas.
README
• Confirms deployment process: local testing (npm start), environment variables, then npm run deploy (AWS credentials).
Detail level and coverage
• Every AWS resource you create in CDK: API Gateway, each Lambda, Parameter Store, any scheduling resource.
• Don’t worry about file-level minutiae—focus on logical components and how they interplay to deliver the poll‑bot functionality.