Blog
Oct 26, 2026 - 10 MIN READ
My First AWS Adventure: Building a Sentiment Analysis System on a Budget

My First AWS Adventure: Building a Sentiment Analysis System on a Budget

From zero to production-ready: How I built a full-stack sentiment analysis platform entirely within AWS Free Tier, exploring serverless architecture, cost optimization, and creative problem-solving along the way.

Peter Mangoro

Peter Mangoro

When I first opened the AWS Console, I felt like I was staring into the abyss. Lambda, API Gateway, DynamoDB, S3, SNS, CloudWatch—it was an alphabet soup of services with names that didn't quite explain what they did. But as part of my cloud computing course, I had one goal: build something real, something that actually solves a problem, and do it entirely within the AWS Free Tier.

I ended up building a production-ready customer feedback sentiment analysis system. And the best part? It costs $0 per month to run.

Live System: https://d2vxc18gbzwhbm.cloudfront.net/

The $0 Budget Challenge

The assignment was straightforward: create a system that analyzes customer feedback sentiment using AWS services. The catch? No paid services beyond the free tier. No AWS Comprehend (it's too expensive). No QuickSight dashboards ($24/month per user). No fancy ML services.

I had to get creative.

What I Built

The system I created automatically processes customer feedback from files (CSV, JSON, TXT) or individual submissions, analyzes the sentiment using a custom rule-based algorithm I developed, and visualizes the results in real-time through a beautiful dashboard.

Project at a Glance

  • Duration: 4 weeks
  • Cost: $0/month (AWS Free Tier)
  • Tech Stack: AWS Lambda, DynamoDB, S3, Vue.js, Nuxt 4, Python
  • Processing Speed: <100ms per feedback item
  • Sentiment Accuracy: ~75-80%
  • GitHub: View Repository

Key Features

  • File Upload: Batch processing of customer feedback files with automatic sentiment analysis
  • Individual Submissions: Single feedback entry with rating system (1-5 stars)
  • Real-time Dashboard: Interactive charts powered by Chart.js showing sentiment distribution
  • Advanced Filtering: Filter by sentiment type, date range, and search text
  • Export Functionality: Download results as CSV for further analysis
  • Responsive Design: Works beautifully on desktop, tablet, and mobile
  • Dark/Light Mode: Automatic theme switching based on user preference

The Architecture

Here's how it all works together:

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Frontend      │    │   API Gateway   │    │   Lambda        │
│   (Nuxt 4)      │◄──►│   (REST API)    │◄──►│   Functions     │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                                      │
                                                      ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Vue Dashboard │    │   DynamoDB      │    │   S3 Bucket     │
│   (Chart.js)    │◄──►│   (Results)     │◄──►│   (Files)       │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                                      │
                                                      ▼
                        ┌─────────────────┐    ┌─────────────────┐
                        │   SNS           │    │   CloudWatch    │
                        │   (Alerts)      │◄──►│   (Monitoring)  │
                        └─────────────────┘    └─────────────────┘

The Tech Stack

Frontend:

  • Nuxt 4 with Vue.js 3 and Composition API
  • @nuxt/ui for beautiful components
  • Chart.js for data visualization
  • Tailwind CSS for styling
  • Pinia for state management

Backend:

  • AWS Lambda (Python 3.9) for serverless compute
  • API Gateway for REST API endpoints
  • DynamoDB for NoSQL data storage
  • S3 for file storage with automatic triggers
  • SNS for notification alerts
  • CloudWatch for monitoring and logging
  • CloudFormation for infrastructure as code

Key Decisions

Decision 1: Custom Sentiment Analysis vs AWS Comprehend

When I first researched sentiment analysis on AWS, I found Comprehend. It looked perfect—powerful NLP capabilities, 99% accuracy, simple API. Then I saw the pricing: $0.0001 per 100 characters.

Let's do the math: 10,000 customer feedback items averaging 200 characters each = 2,000,000 characters = $2,000 per analysis run. That's definitely not staying in the free tier.

The Creative Solution:

I built my own rule-based sentiment analysis algorithm. It uses keyword matching to identify positive, negative, neutral, and mixed sentiment:

def analyze_sentiment(text: str) -> Dict[str, Any]:
    """Rule-based sentiment analysis (free alternative to AWS Comprehend)"""
    positive_words = [
        'good', 'great', 'excellent', 'amazing', 'wonderful', 'fantastic', 
        'love', 'like', 'best', 'perfect', 'outstanding', 'satisfied', 'happy'
    ]
    
    negative_words = [
        'bad', 'terrible', 'awful', 'horrible', 'worst', 'hate',
        'disappointed', 'frustrated', 'angry', 'poor', 'slow', 'broken'
    ]
    
    text_lower = text.lower()
    positive_count = sum(1 for word in positive_words if word in text_lower)
    negative_count = sum(1 for word in negative_words if word in text_lower)
    
    if positive_count > negative_count:
        sentiment = 'POSITIVE'
        confidence = min(0.95, 0.5 + (positive_count - negative_count) * 0.1)
    elif negative_count > positive_count:
        sentiment = 'NEGATIVE'
        confidence = min(0.95, 0.5 + (negative_count - positive_count) * 0.1)
    else:
        sentiment = 'NEUTRAL'
        confidence = 0.5
    
    return {'Sentiment': sentiment, 'SentimentScore': confidence}

Result: 75-80% accuracy at $0 cost. For a fintech CRM use case, this was perfectly adequate.

Decision 2: Custom Vue.js Dashboard vs QuickSight

My next research led me to Amazon QuickSight for dashboards. Professional looking, built for analytics, easy to use. Then I discovered the pricing: $9-24 per user per month. For a free-tier project, that's a hard no.

The Solution:

I built a custom Vue.js dashboard using Chart.js. Not only was it free, but I had complete control over the design, animations, and user experience. The dashboard features interactive bar charts, real-time data updates, advanced filtering, export functionality, and beautiful responsive design with dark/light mode support.

This gave me a better dashboard than QuickSight could have provided, tailored exactly to my needs.

Decision 3: Serverless Architecture

From the beginning, I chose serverless. Here's why:

Benefits:

  • Cost: Pay only for what you use. No idle compute costs.
  • Scalability: Automatically handles traffic spikes
  • Simplicity: No server management, deployment, or maintenance
  • Development Speed: Faster iteration and deployment

The event-driven architecture means:

  1. User uploads file to S3
  2. S3 triggers Lambda function
  3. Lambda processes file, analyzes sentiment
  4. Results stored in DynamoDB
  5. SNS sends alerts for negative sentiment
  6. Frontend fetches results via API Gateway

Every part is independent, scalable, and only runs when needed.

Technical Highlights

Lambda Function: Sentiment Processor

The heart of the system. This Lambda function downloads files from S3, parses various formats (CSV, JSON, TXT), performs sentiment analysis, stores results in DynamoDB, and sends SNS notifications for negative sentiment.

def lambda_handler(event, context):
    """Main Lambda handler for S3 file processing"""
    try:
        bucket_name = event['Records'][0]['s3']['bucket']['name']
        object_key = event['Records'][0]['s3']['object']['key']
        
        # Download and parse file
        file_content = download_file_from_s3(bucket_name, object_key)
        feedback_data = parse_file_content(object_key, file_content)
        
        # Process each feedback item
        analysis_results = []
        for feedback_item in feedback_data:
            sentiment_result = analyze_sentiment(feedback_item['text'])
            result_id = store_analysis_result(
                object_key=object_key,
                feedback_item=feedback_item,
                sentiment_result=sentiment_result
            )
            analysis_results.append({
                'id': result_id,
                'sentiment': sentiment_result['Sentiment'],
                'confidence': sentiment_result['SentimentScore']
            })
        
        return {'statusCode': 200, 'body': json.dumps({'results': analysis_results})}
    except Exception as e:
        logger.error(f"Error: {str(e)}")
        return {'statusCode': 500, 'body': json.dumps({'error': str(e)})}

Vue.js Frontend with Nuxt

The frontend is built with Nuxt 4, providing file-based routing, auto-imports, server-side rendering capabilities, and optimized builds. The upload interface uses Vue's Composition API with clean separation of concerns.

DynamoDB Table Design

The results table uses a simple key-value structure with TTL for automatic cleanup:

Table: sentiment-analysis-results
Primary Key: id (String)
Attributes:
  - object_key (String)
  - text (String)
  - sentiment (String)
  - sentiment_score (Map)
  - timestamp (String)
  - metadata (Map)
  - ttl (Number) - 1 year expiration

Key Challenges & Solutions

Challenge 1: Lambda Permissions

Problem: My first Lambda invocation failed with permission denied errors. The function couldn't access S3 or write to DynamoDB.

Solution: I learned about IAM roles and how Lambda functions need explicit permissions. I updated the CloudFormation template to include proper IAM policies for DynamoDB writes, S3 reads, and SNS publishing.

Challenge 2: CORS Configuration

Problem: The frontend couldn't make API requests. Browser console showed CORS policy blocking requests.

Solution: Proper CORS configuration in API Gateway and Lambda responses. This required adding appropriate headers on both the API Gateway configuration and in Lambda response headers.

Challenge 3: DynamoDB Decimal Type

Problem: DynamoDB uses Decimal type for numeric values, but JSON serialization expects float. This caused errors when returning API responses.

Solution: Created conversion functions to transform Decimal to float for JSON serialization in both directions, ensuring clean API responses.

Results & Metrics

Performance

  • Processing Speed: <100ms per feedback item
  • File Processing: Handles files up to 50MB
  • API Response Time: <200ms average
  • Frontend Load Time: <2 seconds
  • Chart Rendering: <500ms

Cost

Monthly Cost: $0.00 (entirely within AWS Free Tier)

  • S3: 5GB storage, 20,000 GET requests
  • Lambda: 1M requests, 400,000 GB-seconds
  • DynamoDB: 25GB storage, 25 read/write capacity
  • API Gateway: 1M API calls per month
  • CloudFront: 1TB data transfer out

Sentiment Analysis Accuracy

  • Rule-based Algorithm: ~75-80% accuracy
  • Processing Volume: 1000+ items per minute
  • Sentiment Categories: POSITIVE, NEGATIVE, NEUTRAL, MIXED
  • Confidence Scoring: 0.5-0.95 range

Key Takeaways & Skills Gained

AWS Services Mastered

  1. Lambda: Serverless compute for event-driven processing
  2. API Gateway: RESTful API creation and management
  3. DynamoDB: NoSQL database design and querying
  4. S3: Object storage with lifecycle policies
  5. SNS: Notification and alerting system
  6. CloudWatch: Monitoring, logging, and debugging
  7. CloudFormation: Infrastructure as code (IaC)
  8. CloudFront: CDN for global content delivery

Serverless Architecture Understanding

  • Event-driven design principles
  • Cold start optimization
  • Stateless function design
  • Scalability patterns
  • Cost optimization strategies

Full-Stack Development

  • Frontend: Vue.js, Nuxt 4, Chart.js, Tailwind CSS
  • Backend: Python, AWS Lambda, boto3
  • Database: DynamoDB
  • Infrastructure: CloudFormation
  • DevOps: Automated deployment

Problem-Solving Approach

  • Research before implementation
  • Testing edge cases thoroughly
  • Debugging with CloudWatch logs
  • Documentation as you build
  • Iterative improvement mindset

What's Next

This project taught me that with the right approach, you can build production-quality systems on a budget. Potential improvements include machine learning integration when budget allows, user authentication with Cognito for multi-user support, advanced analytics with trend analysis and forecasting, and expanding beyond English sentiment analysis.

Try It Yourself

You can experience the system live at: https://d2vxc18gbzwhbm.cloudfront.net/

What You Can Do

  1. Upload Test Files: Try CSV, JSON, or TXT files
  2. Submit Individual Feedback: Experience the single feedback submission
  3. Explore Results: View charts, filter data, export results
  4. Test Features: Dark mode, mobile responsiveness, filtering

Conclusion

This project taught me more than just AWS services. It taught me how to think like a cloud architect, how to balance cost and functionality, and how to solve real problems with creative solutions.

Building this system from scratch gave me confidence in:

  • Designing cloud-native architectures
  • Implementing cost-effective solutions
  • Debugging distributed systems
  • Creating user-friendly interfaces
  • Delivering end-to-end solutions

Most importantly, it proved that you don't need a massive budget to build something production-ready. With the right architecture and creative problem-solving, the AWS Free Tier is more powerful than most people realize.

If you have questions about the implementation or want to collaborate, feel free to reach out!


Project Repository: GitHub
Live Demo: https://d2vxc18gbzwhbm.cloudfront.net/
Project Type: Academic (Cloud Computing Course)


This project was completed as part of my Cloud Computing course, demonstrating practical application of AWS services and cloud computing principles. All code, documentation, and infrastructure definitions are available in the GitHub repository.

Built with Nuxt UI • © 2025