Skip to content

A fast API endpoint using matplotlib to generate a heatmap as a .png file to visualize global transaction frauds.

Notifications You must be signed in to change notification settings

prayagupa23/Heatmaps-matplotlib

Repository files navigation

NexusPay – Heatmap Service (FastAPI)

Backend service for generating and serving fraud heatmaps for the NexusPay AI-powered UPI Fraud & Anomaly Detection system.

Heatmaps are rendered server-side using Python and exposed as PNG images via FastAPI. Clients (Flutter / Web) only display images—no analytics runs on the frontend.


Features

  • Global fraud heatmap generation
  • Server-side rendering with Matplotlib
  • Image-based API endpoints
  • Simple file-based caching
  • Flutter & web dashboard ready

Tech Stack

  • Python 3
  • FastAPI
  • Matplotlib
  • NumPy, SciPy
  • Cartopy
  • Uvicorn

API Endpoint

Global Heatmap

GET /heatmap/world

Returns a PNG image representing global fraud risk distribution.


Run Locally

pip install -r requirements.txt
python -m uvicorn app.main:app --reload

http://127.0.0.1:8000/heatmap/world


Caching

Heatmaps are generated once and reused from output/heatmaps/

Prevents unnecessary recomputation

About

A fast API endpoint using matplotlib to generate a heatmap as a .png file to visualize global transaction frauds.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages