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.
- Global fraud heatmap generation
- Server-side rendering with Matplotlib
- Image-based API endpoints
- Simple file-based caching
- Flutter & web dashboard ready
- Python 3
- FastAPI
- Matplotlib
- NumPy, SciPy
- Cartopy
- Uvicorn
GET /heatmap/world
Returns a PNG image representing global fraud risk distribution.
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