← projects

$ OCR Expense Tracker

[2025]
TypeScriptNext.jsNode.jsExpressAWS TextractCognitoDynamoDBDocker
code ↗
OCR Expense Tracker

$ cat README.md· github/jntbatra/ocr-aws

AI-Powered Expense Tracker with OCR

Cloud-native expense management application built on AWS using managed AI services, Infrastructure as Code, and containerized deployment.


Badges

AWS Docker Node.js Next.js License


Table of Contents


Overview

The AI-Powered Expense Tracker with OCR is a production-ready cloud-native web application built on Amazon Web Services (AWS).

Users can:

The project demonstrates real-world implementation of:


Problem Statement

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.


Architecture

The system is designed using a layered cloud-native architecture.

1️⃣ Cloud Architecture (Component View)

Cloud Architecture Diagram


2️⃣ Data Flow Pipeline (Sequence View)

Workflows include:

Data Flow Diagram


3️⃣ Infrastructure Deployment (IaC View)

All AWS resources are provisioned through:

infrastructure.yaml

Infrastructure Diagram


Tech Stack

Frontend

Backend

Containerization

AWS Services


Core Workflows

Authentication Flow

Login Page Signup Page Cognito Console


Receipt Upload & OCR Pipeline

  1. User selects receipt

  2. Backend generates presigned S3 URL

  3. Frontend uploads directly to S3

  4. Backend calls Textract AnalyzeExpense

  5. Extracted fields returned:

    • Merchant Name
    • Total Amount
    • Date
  6. User confirms data

  7. Expense saved to DynamoDB

Receipt Upload OCR Preview


Expense Dashboard

Dashboard


Monthly Email Notifications

S3 Bucket CloudFormation Console


Infrastructure as Code

All AWS resources are defined in a single declarative file:

infrastructure.yaml

Resources created:

Benefits


Containerization & Deployment

Two containers:

Service Port
Backend 5000
Frontend 3000

Managed via docker-compose.

Benefits:


Security

Authentication

Data Protection

Network Isolation


Scalability

Current Limitation

Future Improvements


Testing

Functional Testing

Security Testing


Project Structure

.
├── backend/
├── frontend/
├── infrastructure.yaml
├── docker-compose.yml
└── README.md

Setup & Deployment

1. Clone Repository

git clone <repository-url>
cd expense-tracker

2. Deploy Infrastructure

aws cloudformation deploy \
  --template-file infrastructure.yaml \
  --stack-name expense-tracker-stack

3. Run Application

docker-compose up --build

Future Enhancements