A modern, serverless solution to transparently track and analyze coffee consumption in your team, fully integrated with Microsoft Teams and built on AWS using Infrastructure as Code (Terraform).
This project demonstrates how everyday challenges—like monitoring caffeine intake—can be solved with cloud-native technologies. The Coffee Tracker leverages AWS Lambda, API Gateway, DynamoDB, and SNS to record, analyze, and notify about coffee consumption events, all triggered directly from Microsoft Teams.
- API Gateway: Provides REST endpoints for tracking and retrieving coffee entries.
- AWS Lambda (Python 3.13):
track_coffee.py: Validates and stores entries, triggers SNS notifications.get_user_entries.py: Retrieves a user's coffee history.notify_teams.py: Sends notifications as Adaptive Cards to Microsoft Teams.logging_utils.py: Structured logging for CloudWatch.
- DynamoDB:
- Stores coffee entries.
- Deduplication table for Teams notifications.
- SNS: Event-driven notifications between components.
- IAM & CloudWatch: Secure, monitor, and log all activities.
- Terraform: Declarative, automated provisioning of all resources.
git clone <your-repo-url>
cd coffee-trackerterraform init
terraform applyTerraform will provision all AWS resources in your account.
After deployment, Terraform will output your API endpoint. You can now:
- Track coffee entries directly from Microsoft Teams (or via
curlfor testing). - Retrieve user consumption history.
When the defined caffeine limit is exceeded, a notification is automatically sent to Microsoft Teams via SNS and Lambda.
{
"userId": "employee1",
"timestamp": "2025-09-12T10:15:00Z",
"type": "espresso",
"amount": 2
}- Add authentication and rate limiting for production use.
- Integrate with dashboards (e.g., AWS QuickSight).
- Extend notification logic or add new integrations.
This project is for demonstration purposes only.
To keep the solution simple, important security aspects such as authentication, authorization, and API rate limiting are not implemented. If you plan to use this in production, ensure you protect your API Gateways and all components according to AWS security best practices.
For a non-binding demo or individual consultation, feel free to contact us.
This project is licensed under the MIT License.