This serverless Python API uses AWS services to provide data from a Starbucks drinks table to ChatGPT. The API support GET queries and utilize AWS Lambda, Amazon API Gateway, and DynamoDB.
The data for this project came from a kaggle data set: https://www.kaggle.com/datasets/starbucks/starbucks-menu
- CSV File Analysis: Analyzed and combined two CSV files containing Starbucks drinks data using ChatGPT.
- Data Cleaning: Cleaned and merged the data, ensuring consistency across the datasets.
- DynamoDB Preparation:
- Created table StarbucksDrinksCatalog and CloudWatch dashboard.
- Chose
BeverageID
(a combination ofBeverage
andBeverage_prep
) as the primary key. - Transformed the data into a format suitable for DynamoDB.
- Data Loading:
- Utilized Boto3 in Python to load the transformed data into DynamoDB.
- Verified the integrity of the data in the DynamoDB table against the original CSV files.
- Set up AWS credentials for programmatic access using Boto3.
- Configured Amazon CloudWatch for monitoring DynamoDB and Lambda functions.
- Developed an AWS Lambda function in Python to handle API requests.
- The function is capable of querying DynamoDB to retrieve random beverage data.
- Set up necessary permissions for Lambda to access DynamoDB.
- Successfully tested the Lambda function locally.
- Deployed the Lambda function to AWS.
- Created a Lambda URL for direct invocation of the function.
- Successfully integrated the Lambda function with Amazon API Gateway.
- Set up an API endpoint (
/random
) to access the Lambda function. - Created an OpenAPI definition for the
/random
endpoint.
- Use CloudWatch to monitor API and Lambda performance.
- Optimize configurations for efficiency and cost-effectiveness.
- Consider adding more features to the API based on user feedback.
- Explore opportunities for scaling and improving the system architecture.