A cloud-based serverless solution that processes CSV data containing video game sales information, generates analytics, and visualizes the results in a real-time dashboard.
This project demonstrates a complete serverless data processing pipeline using AWS services to analyze video game sales data. When a CSV file is uploaded to an S3 bucket, it automatically triggers an AWS Lambda function that:
- Processes the CSV data
- Extracts key insights like total sales, top genres, and popular platforms
- Generates individual HTML reports for each file
- Updates a dashboard with the latest analytics
- AWS Lambda: Handles the serverless processing logic
- Amazon S3: Stores input CSV files, processed results, and web assets
- Amazon CloudFront: Secures and distributes the dashboard
- AWS IAM: Manages secure access between services
- Grab sales data from Kaggle
- AWS account with appropriate permissions
- Python 3.8 or higher
- AWS CLI configured locally
-
Create S3 Buckets:
aws s3 mb s3://your-input-bucket-name aws s3 mb s3://your-output-bucket-name
-
Deploy Lambda Function:
# Create a deployment package zip -r function.zip lambda_function.py # Create the Lambda function aws lambda create-function \ --function-name csv-processor \ --runtime python3.8 \ --handler lambda_function.lambda_handler \ --role arn:aws:iam::<YOUR_ACCOUNT_ID>:role/lambda-csv-processor-role \ --zip-file fileb://function.zip
-
Set Up S3 Trigger:
aws lambda add-permission \ --function-name csv-processor \ --statement-id s3-trigger \ --action lambda:InvokeFunction \ --principal s3.amazonaws.com \ --source-arn arn:aws:s3:::your-input-bucket-name
-
Upload Dashboard Assets:
aws s3 cp dashboard/index.html s3://your-output-bucket-name/dashboard/index.html aws s3 cp dashboard-data.json s3://your-output-bucket-name/dashboard-data.json
-
Set Up CloudFront (Optional for Enhanced Security): Follow the steps in the AWS console to create a CloudFront distribution pointing to your S3 bucket.
-
Upload a CSV file to the input S3 bucket:
aws s3 cp vgsales.csv s3://your-input-bucket-name/
-
Lambda processes the file automatically (no action required)
-
View the dashboard at:
https://[your-cloudfront-domain]/Or directly from S3:
http://your-output-bucket-name.s3-website-[region].amazonaws.com/
The system expects CSV files with the following columns:
Rank, Name, Platform, Year, Genre, Publisher, NA_Sales, EU_Sales, JP_Sales, Other_Sales, Global_Sales
Example:
Rank,Name,Platform,Year,Genre,Publisher,NA_Sales,EU_Sales,JP_Sales,Other_Sales,Global_Sales
1,Wii Sports,Wii,2006,Sports,Nintendo,41.49,29.02,3.77,8.46,82.74- Summary of processed data
- Top game genres visualization
- Platform popularity analysis
- Sales trends and metrics
- Historical report access
- S3 bucket access is restricted
- CloudFront distribution uses HTTPS
- IAM roles follow principle of least privilege
- No sensitive data is exposed in the dashboard
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Note: This project is designed for demonstration purposes. For production environments, consider implementing additional security measures and error handling.
