
Weekend Annoying Task Challenge: MedMinder - AI That Turns Prescription Chaos Into Smart Medicine Reminders in Seconds
AI-powered medicine reminder app that automatically extracts prescription details using AWS Bedrock + sends automated reminders via EventBridge. Built for AWS Weekend Challenge.
Vision & What the App Does
As someone who manages multiple medications daily, one of my most frustrating challenges is remembering when to take each medicine. With 3-4 different medications, each with different schedules (morning, afternoon, night), it's easy to miss doses. Missing even one dose can have serious health consequences.
According to the World Health Organization,Β medication non-adherence accounts for 50% of treatment failures and approximately 125,000 preventable deaths annually in the United States alone. This isn't just an inconvenience β it's a public health crisis.
MedMinder is an AI-powered medicine reminder app that automates this exact pain point.Β Users upload a prescription image (photo of a bill, prescription paper, or medicine bottle), and the AI instantly:
- Extracts all text from the prescription using Amazon Bedrock's multimodal AI
- Identifies the medicine name, dosage, frequency, and duration
- Automatically categorizes the medicine (morning, afternoon, night)
- Stores everything in a searchable, filterable dashboard
- Sends automated email reminders at scheduled times (8:00 AM and 9:00 PM IST)
- Allows one-click "Mark as Taken" to track adherence
- Syncs all data to the cloud for persistence across devices
MedMinder doesn't require manual data entryΒ β it acts as an intelligent prescription scanner. Upload a prescription photo, and within 15 seconds you have a fully categorized medicine entry with automated reminders. What previously took manual spreadsheet work now takes zero effort. Just snap a photo and let AI handle the rest.
ο»Ώ
How I Built It
Development Process
I started by identifying the core workflow:
Prescription Image β AI Text Extraction β Medicine Analysis β Structured Data β Dashboard Display β Automated Reminders
The key architectural decision was usingΒ Amazon Bedrock's Nova Lite modelΒ for multimodal prescription analysis combined withΒ EventBridge for scheduled remindersΒ to handle the full pipeline from raw image to structured, categorized data with automated notifications.
Key Decisions
- Amazon Bedrock Nova Lite for multimodal AIΒ β It handles prescription images, medicine bottles, and handwritten notes remarkably well, extracting medicine details with high accuracy. The model returns clean structured JSON when prompted correctly.
- EventBridge for scheduled remindersΒ β Instead of polling or manual triggers, EventBridge cron rules automatically invoke the reminder Lambda at 8:00 AM and 9:00 PM IST, eliminating infrastructure complexity.
- Serverless architectureΒ β Lambda + DynamoDB means zero infrastructure management and pay-per-use pricing (perfect for a health app that's used daily but not continuously).
- Lambda Function URLsΒ β Direct HTTPS endpoints for API calls without needing API Gateway, simplifying the architecture and reducing latency.
- Amazon SES for email deliveryΒ β Sends beautifully formatted HTML emails with medicine lists, special instructions, and dosage information.
- DynamoDB with on-demand capacityΒ β Stores all medicine records and user emails with PAY_PER_REQUEST billing, meaning zero cost when not in use.
- Single-page frontendΒ β No build tooling needed; vanilla HTML/CSS/JavaScript hosted on S3 keeps deployment simple and fast.
- Local storage + cloud syncΒ β Frontend stores data locally for instant access, while Lambda syncs to DynamoDB for persistence and reminder processing.
ο»Ώ
Challenges & Solutions
Challenge 1: Accurate Medicine Extraction from Varied Prescription Formats
Problem:Β Prescriptions come in many formats β printed pharmacy receipts, handwritten doctor notes, medicine bottle photos, and digital screenshots. Early attempts struggled with inconsistent formatting.
Solution:Β I refined the Bedrock prompt to explicitly ask for structured JSON output with specific fields (name, dosage, frequency, duration, notes). The model now handles all prescription formats consistently, extracting only the relevant medicine information.
Challenge 2: Consistent JSON Output from LLM
Problem:Β The AI sometimes wrapped responses in markdown code blocks or added explanatory text before/after the JSON, causing parsing failures.
Solution:Β I added defensive parsing logic that:
- Strips markdown wrappers (Β
json ...Β Β)
- Handles both clean JSON and wrapped JSON
- Falls back gracefully if parsing fails
- Returns user-friendly error messages
Challenge 3: Scheduling Reminders Across Time Zones
Problem:Β Users are in different time zones, but reminders need to be sent at specific local times (8:00 AM and 9:00 PM IST).
Solution:Β EventBridge cron expressions are in UTC. I calculated the UTC equivalent of 8:00 AM and 9:00 PM IST:
- Morning:Β Β
cron(30 2 * * ? *)ΒΒ (8:00 AM IST = 2:30 AM UTC)
- Night:Β Β
cron(30 15 * * ? *)ΒΒ (9:00 PM IST = 3:30 PM UTC)
Challenge 4: Processing Time and User Experience
Problem:Β The full pipeline (upload β Bedrock analysis β DynamoDB storage) takes 10-15 seconds. Without feedback, users think the app is broken.
Solution:Β I added progressive status messages in the UI:
- "π· Uploading prescription..."
- "π€ AI is analyzing..."
- "β Medicine added successfully!"
Users now know exactly what's happening at each step.
Challenge 5: IAM Permissions Complexity
Problem:Β Lambda functions need permissions for Bedrock, DynamoDB, and SES. Getting permissions wrong causes cryptic "AccessDenied" errors.
Solution:Β I created separate IAM roles for each Lambda function with least-privilege permissions:
- MedMinder_API role:Β DynamoDB + Bedrock access
- MedMinder_Reminder role:Β DynamoDB + SES access
This ensures each function only has the permissions it needs.
Challenge 6: S3 Public Access and CORS
Problem:Β The S3-hosted frontend couldn't communicate with Lambda due to CORS restrictions and bucket policy conflicts.
Solution:
- Disabled "Block Public Access" on the S3 bucket
- Added a bucket policy allowing public read access to index.html
- Enabled CORS on Lambda Function URLs with proper headers
- Configured allowed origins, methods, and headers
ο»Ώ
AWS Services Used / Architecture Overview
Architecture Diagram
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ USER BROWSER ββ (S3 Static Website) ββ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β MedMinder Frontend (index.html) β ββ β - Email input & save β ββ β - Prescription upload (AI extraction) β ββ β - Manual medicine entry β ββ β - Today's schedule view β ββ β - Mark as taken functionality β ββ β - Local storage for offline access β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β HTTPS βΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ AWS LAMBDA (API) ββ MedMinder_API Function ββ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Endpoints: β ββ β - POST /extract β Analyze prescription image β ββ β - POST /add β Store medicine in DynamoDB β ββ β - POST /register β Register user email β ββ β - GET /medicines β Retrieve user medicines β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β β β ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ β Bedrock β βDynamoDB β β SES β β(Nova β β(Storage)β β (Email) β β Lite) β β β β β β β β β β β β AI Image β βTables: β β Sends β β Analysis β β- Meds β β Emails β β β β- Users β β β ββββββββββββ βββββββββββ βββββββββββο»Ώ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ AWS EVENTBRIDGE ββ (Scheduled Reminders) ββ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Cron Rules: β ββ β - Morning: cron(30 2 * * ? *) β 8:00 AM IST β ββ β - Night: cron(30 15 * * ? *) β 9:00 PM IST β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β βΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ AWS LAMBDA (Reminder) ββ MedMinder_Reminder Function ββ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β 1. Check current time (morning/afternoon/night) β ββ β 2. Query DynamoDB for all users β ββ β 3. Find medicines due at current time β ββ β 4. Format HTML email with medicine details β ββ β 5. Send via SES β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β βΌ ββββββββββββββββ β User Email β β (Reminder) β ββββββββββββββββο»Ώ
AWS Services
AWS Service | Role | Free Tier |
|---|---|---|
Amazon S3 | Two buckets β medicine image storage + static website hosting for frontend | 5GB free |
AWS Lambda (Python 3.12) | Two serverless functions handling API requests and scheduled reminders | 1M requests/month free |
Amazon Bedrock (Nova Lite) | AI engine β analyzes prescription images and extracts medicine details | ~$0.0002/request |
Amazon DynamoDB | NoSQL database storing all medicine records and user emails with on-demand capacity | 25GB free |
Amazon SES | Email delivery service β sends reminder emails at scheduled times | 200 emails/day free |
Amazon EventBridge | Serverless event bus β triggers reminder Lambda at scheduled times (8 AM & 9 PM IST) | 100 rules free |
AWS IAM | Identity and access management β least-privilege permissions for each Lambda function | Free |
ο»Ώ
How the Agent is Triggered
User Flow: Adding a Medicine
- User opens the MedMinder web app (hosted on S3)
- User enters their email address and clicks "Save Email"
- Frontend registers email with Lambda API
- User uploads a prescription image (photo or screenshot)
- Frontend converts image to Base64 and sends to LambdaΒ Β
/extractΒΒ endpoint
- Lambda calls Amazon Bedrock Nova Lite with the image
- Bedrock analyzes the image and returns structured medicine data (name, dosage, frequency, duration, notes)
- Lambda stores the medicine in DynamoDB
- Frontend displays the extracted medicine in the dashboard
- User confirms and medicine is added to their list
Reminder Flow: Automated Email Reminders
- EventBridge triggers at 8:00 AM ISTΒ (cron rule:Β Β
cron(30 2 * * ? *)Β)
- Lambda MedMinder_Reminder function is invoked
- Lambda queries DynamoDB for all registered users
- For each user, Lambda finds medicines due at morning time
- Lambda formats a beautiful HTML email with:
- Medicine names and dosages
- Special instructions (e.g., "Take after food")
- Encouragement message
- Lambda sends email via Amazon SES
- User receives reminder email
- EventBridge triggers again at 9:00 PM ISTΒ (cron rule:Β Β
cron(30 15 * * ? *)Β)
- Same process repeats for night medicines
Dashboard Features
- Today's ScheduleΒ β View medicines due today organized by time
- Mark as TakenΒ β One-click to track which medicines you've taken
- All MedicinesΒ β View complete list of all medicines with details
- Local StorageΒ β Data persists even after browser refresh
- Cloud SyncΒ β All data synced to DynamoDB for persistence
ο»Ώ
Deployment
The entire infrastructure is deployed manually through the AWS Console:
Step 1: Create DynamoDB Tables
1. Go to AWS Console β DynamoDB2. Create MedMinder_Medicines table - Partition key: user_email (String) - Sort key: medicine_id (String) - Billing: On-demand3. Create MedMinder_Users table - Partition key: email (String) - Billing: On-demandο»Ώ
Step 2: Deploy Lambda Functions
1. Go to AWS Console β Lambda2. Create MedMinder_API function - Runtime: Python 3.12 - Copy code from backend/lambda_api.py - Add permissions: AmazonDynamoDBFullAccess, AmazonBedrockFullAccess - Create Function URL (CORS enabled)3. Create MedMinder_Reminder function - Runtime: Python 3.12 - Copy code from backend/lambda_reminder.py - Add permissions: AmazonDynamoDBFullAccess, AmazonSESFullAccess - Add EventBridge triggers (morning & night cron rules)ο»Ώ
Step 3: Set Up Amazon SES
1. Go to AWS Console β SES2. Create verified identity with your email3. Verify email from inbox4. Update Lambda with verified email addressο»Ώ
Step 4: Create S3 Buckets
1. Create bucket: medminder-app-naveen2. Disable "Block Public Access"3. Enable static website hosting4. Add bucket policy for public read access5. Upload index.html (with Lambda URL updated)ο»Ώ
Step 5: Configure EventBridge
1. Go to AWS Console β EventBridge2. Create rule: MedMinder_MorningReminder - Schedule: cron(30 2 * * ? *) - Target: MedMinder_Reminder Lambda3. Create rule: MedMinder_NightReminder - Schedule: cron(30 15 * * ? *) - Target: MedMinder_Reminder Lambdaο»Ώ
Total deployment time: 45-60 minutes
Total monthly cost: $0Β (All within AWS Free Tier)
ο»Ώ
What I Learned
1. Bedrock Nova Lite is Remarkably Effective for Multimodal Analysis
The model accurately extracts medicine details from prescription images with minimal errors, even with poor image quality, angles, or partial visibility. It handles handwritten notes, printed receipts, and digital screenshots equally well.
2. Lambda Function URLs Simplify Architecture
Instead of API Gateway, Function URLs provide direct HTTPS endpoints, reducing complexity for simple use cases. No need for API Gateway configuration, CORS setup, or resource management.
3. IAM Permissions are Critical to AWS Security
Understanding least-privilege access is essential. Each Lambda function should only have the permissions it needs. This prevents security breaches and makes debugging easier.
4. EventBridge Provides Powerful Scheduling Without Infrastructure
Cron-based scheduling eliminates the need for managing cron jobs, polling loops, or scheduled tasks. The system only runs (and costs money) when there's actual work to do.
5. Amazon SES Sandbox Mode is Perfect for Testing
Free email sending for verified addresses makes testing reminders easy before production. The sandbox mode is ideal for personal tools and low-volume applications.
6. DynamoDB On-Demand Pricing is Ideal for Variable Workloads
No need to provision capacity; pay only for what you use. This makes DynamoDB perfect for personal tools that are used daily but not continuously.
7. AWS Free Tier Supports Real, Production-Ready Applications
A fully functional, production-ready health app costs $0 per month, making AWS accessible to everyone. This democratizes application development.
8. Starting Simple Wins
I initially planned to add user authentication (Cognito), monthly reports with charts, medicine interaction checking, and refill reminders. By focusing on the core workflow (upload prescription β get categorized medicine β receive reminders), I shipped a working tool in one weekend that solves my actual problem today.
9. Serverless is Perfect for Personal Tools
I use this app daily but not continuously. Pay-per-use means my monthly cost is under $0.05, compared to running an EC2 instance 24/7 for a tool I use for 5 minutes a day.
10. Health Tech Can Be Built Quickly and Affordably
MedMinder proves that you don't need a massive budget or complex infrastructure to build impactful health applications. By leveraging AWS serverless services, I built a production-ready app in one weekend that could genuinely improve people's health outcomes.
ο»Ώ
Link to App & Repo
πΒ Documentation:Β Complete setup guides, API documentation, and troubleshooting included in repository
ο»Ώ
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article