Live on GCP

AI-Powered Expense Tracker

A microservices backend that auto-detects bank SMS, uses Mistral AI to extract transaction data, and tracks expenses — all through event-driven Kafka pipelines.

Java 21Spring Boot 3Apache KafkaMySQL FlaskMistral AIDocker ComposeNginx GCPJWT AuthReact Native ExpoLet's Encrypt SSL
Microservices & API Docs

Auth Service Java

:9898

Handles signup, login, and JWT token management. On signup, publishes user creation event to Kafka for downstream services.

POST/auth/v1/signup
POST/auth/v1/login
POST/auth/v1/refreshToken
Open Swagger UI →

User Service Java

:9810

Manages user profiles. Listens to Kafka user_service topic — auto-creates profile when Auth Service publishes signup event.

GET/user/v1/profile
POST/user/v1/update
Open Swagger UI →

Expense Service Java

:9820

Core business logic — expenses, budgets, spending limits with reset timestamps, category detection, and time-filtered analytics (7D/30D/3M/6M).

POST/expense/v1/addExpense
GET/expense/v1/summary?days=30
POST/expense/v1/setLimit
POST/expense/v1/resetLimit
Open Swagger UI →

AI SMS Parser Python

:8000

Flask service that receives raw bank SMS, filters using keywords (Dr./Cr./Debited), extracts amount via regex, and uses Mistral AI to identify the merchant. Publishes parsed data to Kafka.

POST/v1/ds/message
Open Flasgger Docs →
🔄 How It Works — End to End
1

User Signs Up

Mobile app sends credentials → Auth Service creates account, generates JWT tokens, publishes event to Kafka topic user_service

2

Profile Auto-Created

User Service consumes Kafka event → automatically creates user profile. Zero manual API calls needed.

3

Bank SMS Detected

React Native app's SMS listener hook detects incoming bank SMS on Android (filters by keywords: Dr., Cr., Debited, AvlBal). Duplicate prevention with 5-second window.

4

AI Parses Transaction

SMS sent to DS Service → regex extracts amount (Rs./INR/₹) → Mistral AI extracts merchant name → maps to known merchants (Paytm, Amazon, Flipkart etc.) → determines credit/debit type

5

Expense Auto-Logged

Parsed data published to Kafka topic expense_service → Expense Service consumes it → expense saved with category, amount, merchant, and timestamp

6

Analytics & Budgeting

User views spending summaries (7D/30D/3M/6M), sets budget limits with reset capability, sees credit vs debit breakdown — all on the mobile dashboard.

📨 Kafka Event Pipeline
user_serviceAuth → User Service (signup events)
expense_serviceDS Service → Expense Service (parsed SMS data)
🛠 Key Engineering Decisions

Database per Service

Each microservice owns its MySQL schema — true data isolation, independent scaling.

Event-Driven

Services communicate via Kafka, not REST calls. Loose coupling, async processing, fault tolerance.

AI Integration

Mistral AI for intelligent merchant extraction from unstructured bank SMS text.

JWT + Refresh

Stateless auth with short-lived access tokens and UUID-based refresh tokens.

Docker Compose

Full stack (7 containers) defined in one file — one command to spin up the entire system.

HTTPS + Nginx

Reverse proxy with SSL termination, path-based routing to all services behind a single domain.