This project is an alert system that sends real-time NBA game day score notifications to subscribed users via Email. It leverages Amazon SNS, AWS Lambda and Python, Amazon EvenBridge and NBA APIs to provide up-to-date game information. The project demonstrates cloud computing principles and efficient notification mechanisms.
- Fetches live NBA game scores using an external API.
- Sends formatted score updates to subscribers via Email using Amazon SNS.
- Scheduled automation for regular updates using Amazon EventBridge.
- Cloud Provider - AWS
- Services Used - SNS, Lambda, EventBridge, IAM
- External API - NBA Game API (SportsData.io)
- Programming Language - Python 3.x
git clone https://github.com/Lakunzo/NBA-Game-Notifications.git- Sign up on SportsData.IO
- Confirm Email
- Get API Key
- Open the AWS Management Console
- Locate the SNS Service
- Create a Topic using the standard type
- Open the Topic created, anc click Create Subscription
- Select Email in the protocol list
- Enter your email address and create the subscription
- Confirm the subscription
- Open IAM, and click policies
- Create policy and select SNS service. Switch to JSON. Copy and modify the nba_game_role.json file
- Enter a name for the policy and create the policy
- Within IAM, click Create role
- In Trusted entity type, select AWS service. In Use case, select Lambda and click Next
- Select the IAM policy created, search for the "AWSLambdaBasicExecutionRole", add it and click Next
- Enter a name for the role and create the role
- In Lambda, click Create function
- Select Author from scratch
- Enter a function name. In Runtime, select Python 3.13
- In Change default execution role, use an existing role, and select the IAM role that was created. Create the function
- Copy the content of the src/nba_game_notification.py file from the repository
- From the Lambda function, select the Configuration tab, click Environment variables
- NBA_API_KEY:your_nba_api_key
- SNS_TOPIC_ARN: The ARN of the SNS topic created earlier
- In EventBridge, locate and click Rules in the Buses segment
- Click Create rule. In Rule detail, enter a name, select Schedule for the rule type, and click continue in Eventbridge scheduler
- In Schedule pattern, select recurring schedule, and select Cron-based schedule
- In Cron expression, enter your cron job details
- In select target, choose AWS Lambda, and select the Lambda function that was created earlier
- Open the Lambda function
- In the Code tab, click Test to simulate the function
- Wait for it to complete and check result in the Test tab
- Verify that an email was delivered
- Integrating external API into cloud systems
- Architecting a notification system using SNS Topic and Lambda
- Automating system triggers using EventBridge
- Add S3 bucket as destination for results
- Dashboard using AWS QuickSight

