Cloud-native expense management application built on AWS using managed AI services, Infrastructure as Code, and containerized deployment.
- Overview
- Problem Statement
- Architecture
- Tech Stack
- Core Workflows
- Infrastructure as Code
- Containerization & Deployment
- Security
- Scalability
- Testing
- Project Structure
- Setup & Deployment
- Future Enhancements
- Author
The AI-Powered Expense Tracker with OCR is a production-ready cloud-native web application built on Amazon Web Services (AWS).
Users can:
- Authenticate securely
- Upload receipt images
- Automatically extract financial data using AWS Textract
- Visualize expenses through an interactive dashboard
- Receive automated monthly summaries via email
The project demonstrates real-world implementation of:
- Infrastructure as Code (IaC)
- Serverless storage
- Managed identity
- AI-as-a-Service
- Container orchestration
- Cloud-native architecture
Manual expense tracking requires repetitive data entry and often leads to errors.
This project automates receipt digitization using AWS Textract AnalyzeExpense API, reducing manual effort while maintaining scalability and security.
The system is designed using a layered cloud-native architecture.
- Client (Next.js frontend)
- EC2 (Dockerized backend & frontend)
- Cognito (Authentication)
- S3 (Receipt Storage)
- Textract (OCR)
- DynamoDB (Database)
- SNS (Notifications)
- VPC + Security Groups (Networking)
Workflows include:
- Authentication
- Receipt Upload + OCR Processing
- Expense Management
- Monthly Summary Notifications
All AWS resources are provisioned through:
infrastructure.yaml
- Next.js 16
- TypeScript
- Tailwind CSS
- Node.js v22
- Express.js
- Docker
- Docker Compose
- EC2 (t3.micro)
- Cognito
- S3 (Presigned URLs)
- Textract (AnalyzeExpense API)
- DynamoDB (Pay-per-request)
- SNS
- CloudFormation
- VPC & Security Groups
- User signup with email verification (OTP)
- Secure Remote Password (SRP)
- JWT token issued upon login
- JWT used for protected API calls
-
User selects receipt
-
Backend generates presigned S3 URL
-
Frontend uploads directly to S3
-
Backend calls Textract AnalyzeExpense
-
Extracted fields returned:
- Merchant Name
- Total Amount
- Date
-
User confirms data
-
Expense saved to DynamoDB
-
JWT-authenticated requests
-
Partitioned DynamoDB queries using
userId -
Displays:
- Category pie chart
- Monthly trend line chart
- Expense table
- Summary statistics
- Scheduled aggregation of expenses
- Formatted HTML summary
- Published to SNS topic
- Delivered via email
All AWS resources are defined in a single declarative file:
infrastructure.yaml
Resources created:
- VPC
- Public Subnet
- Internet Gateway
- Route Tables
- Security Groups
- EC2 Instance
- IAM Role & Instance Profile
- Cognito User Pool & Client
- S3 Bucket
- DynamoDB Table
- SNS Topic
- Reproducible deployments
- Version-controlled infrastructure
- Automated rollback
- No manual console configuration
Two containers:
| Service | Port |
|---|---|
| Backend | 5000 |
| Frontend | 3000 |
Managed via docker-compose.
Benefits:
- Environment consistency
- Dependency isolation
- Simplified deployment
- Production-ready setup
- JWT-based stateless authentication
- SRP protocol
- Email verification
- Token expiration
- Private S3 bucket
- 15-minute presigned URL expiration
- DynamoDB encryption at rest
- HTTPS enforced
- Custom VPC
- Restricted security groups
- Least-privilege IAM roles
- Single EC2 instance (Single Point of Failure)
- Application Load Balancer
- Auto Scaling Group
- CloudFront CDN
- ElastiCache (Redis)
- Lambda-based backend
- DynamoDB GSIs
- Signup & OTP verification
- JWT validation
- OCR extraction accuracy
- Expense persistence
- Unauthorized API rejection
- Expired token handling
- Cross-user isolation
- Presigned URL expiration validation
.
├── backend/
├── frontend/
├── infrastructure.yaml
├── docker-compose.yml
└── README.md
git clone <repository-url>
cd expense-trackeraws cloudformation deploy \
--template-file infrastructure.yaml \
--stack-name expense-tracker-stackdocker-compose up --build- Multi-currency support
- Budget alerts
- Expense sharing between users
- Analytics export (CSV/PDF)
- Serverless backend migration










