DEV Community

Cover image for Postmark Transaction Analyzer
JOHN RATNA KUMAR AKKISETTI
JOHN RATNA KUMAR AKKISETTI

Posted on

Postmark Transaction Analyzer

โœจ Why I Built This

I wanted a dashboard that automatically parses bank transactions from my email, stores them neatly, and visualizes insights using charts โ€” all with FastAPI, MongoDB, and React.


๐Ÿš€ Features

  • ๐Ÿง  AI-based detection of bank transactions from emails
  • ๐Ÿ“Š Frontend dashboard with Pie Chart summary
  • ๐Ÿ› ๏ธ FastAPI backend with MongoDB aggregation
  • โšก Deployed on Render.com

๐Ÿงฑ Tech Stack

  • Backend: FastAPI, MongoDB
  • Frontend: React
  • Email Parsing: Postmark Inbound Webhooks + LLM
  • Deployment: Render.com (single service, no Docker needed)

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ backend
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ routers/
โ”‚   โ””โ”€โ”€ frontend/          # frontend build (dist folder goes here)
โ””โ”€โ”€ frontend
    โ””โ”€โ”€ postmark-dashboard
        โ”œโ”€โ”€ public/
        โ”œโ”€โ”€ src/
        โ””โ”€โ”€ dist/           # built files (copied to backend/frontend)
Enter fullscreen mode Exit fullscreen mode


๐Ÿงช Sample MongoDB Data

You can use the following test data to populate your MongoDB:

[
  {
    "is_transaction": true,
    "bank_name": "ICICI Bank",
    "amount": 2590,
    "currency": "INR",
    "transaction_type": "debit",
    "description": "UPI RRN :904123451122",
    "confidence": 100,
    "created_at": "2025-04-07T07:05:32.997Z"
  },
  {
    "is_transaction": true,
    "bank_name": "Bank Of Maharashtra",
    "amount": 1920,
    "currency": "INR",
    "transaction_type": "debit",
    "description": "UPI RRN :708312128688",
    "confidence": 98,
    "created_at": "2025-04-10T10:21:18.234Z"
  }
]
Enter fullscreen mode Exit fullscreen mode


๐Ÿ How to Run

๐ŸŒ Setup Webhook using ngrok

To receive emails via webhook in local FastAPI:

ngrok http 8000
Enter fullscreen mode Exit fullscreen mode

Copy the public URL shown (e.g. https://abcd1234.ngrok.io)

Set Postmark inbound webhook to
https://abcd1234.ngrok.io/inbound-webhook

Make sure the FastAPI server is running when using ngrok.

๐Ÿ”ง Backend

git clone https://github.com/Johnnaidu619/PostmarkChallenge.git
cd PostmarkChallenge/backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload
Enter fullscreen mode Exit fullscreen mode

โš ๏ธ Make sure MongoDB is running and connection string is set in .env with keys LLM_API_KEY,MONGO_URL,MONGO_DB_NAME
and for frontend .env key is VITE_SITE_URL.

๐Ÿ’… Frontend

cd frontend/postmark-dashboard
npm install
npm run dev
Enter fullscreen mode Exit fullscreen mode

โœ… Live Demo

๐Ÿ‘‰ Check it here

Top comments (1)

Collapse
 
nevodavid profile image
Nevo David •

pretty cool setup, feels like something i'd use to get my mess together - you ever run into stuff that surprised you after seeing the data laid out?