HomeWorkFinTrack: Event-Driven Expense Automation Engine
FinTrack: Event-Driven Expense Automation Engine
2024-03-15Backend Engineering / Cloud InfrastructureProduction Ready

FinTrack: Event-Driven Expense Automation Engine

runtime

Bun.jsNode.js

database

PostgreSQLPrisma ORMRedis (Caching)

infrastructure

Google Cloud Pub/SubGmail Push NotificationsDocker

interface

Telegram Bot APIReact Dashboard

The Problem

Traditional budgeting apps fail because they require manual entry or invasive 'screen-scraping' of bank accounts. Users need a privacy-first, automated way to track spending across multiple credit cards (SBI, PhonePe, etc.) without sharing bank credentials with third-party apps.

Technical Solution

The system utilizes a serverless event-driven architecture. By subscribing to Gmail Push Notifications via Google Cloud Pub/Sub, the backend receives an instant webhook whenever a transaction email arrives. Using Bun's high-performance runtime, the engine parses complex HTML/Multipart email bodies, extracts metadata using optimized regex patterns, and normalizes the data into a unified PostgreSQL schema.

Security And Compliance

Privacy-First Personal Data Handling
End-to-end encryption for all stored financial metadata.
Stateless processing: Emails are parsed in-memory and never stored on disk, reducing data footprint.
Secure Webhook Validation to ensure only authorized Google Pub/Sub signals are processed.

Key Modules

Intelligent Parser Engine

A template-agnostic parser that identifies transaction amount, merchant name, and currency from diverse banking email formats (SBI, ICICI, HDFC).

Reactive Telegram Gateway

A real-time notification layer that pushes 'Spend Alerts' to the user and allows for instant 'One-Tap' categorization of expenses.

Outcome

Achieved 100% automation of personal expense tracking. The system processed over 500+ transactions with 99.2% parsing accuracy, eliminating the need for manual budgeting apps.