๐ Live App: https://payshield-dashboard.onrender.com/
๐ฅ Demo Video: Watch the attack simulation on Google Drive
Modern web applications trust the browser by default. When a user clicks "Pay โน25", the server assumes the incoming API request is genuine.
The reality? Attackers use proxy tools, developer consoles, and browser extensions (like Requestly) to intercept and silently modify API requests mid-flightโchanging the amount, the currency, or the destination account before it even reaches the server.
Current Web Application Firewalls (WAFs) and traditional fraud models do not catch this. They scan for malicious code or score data after it arrives, unaware it was tampered with in transit. This is the number one attack vector causing an estimated $48B in digital payment fraud annually.
PayShield is an end-to-end, microservice-driven fraud intelligence system designed to detect and block API tampering in milliseconds, backed by an AI scoring engine.
Unlike most security projects that use static datasets to "detect fraud", PayShield actively defends against live, simulated attacks in real-time.
- Live Attack Simulation: We prove our security works by attacking our own API during the demo using Requestly (a browser interception extension), demonstrating how invisible tampering is caught live.
- The "Replay Engine": A powerful dashboard feature that visually reconstructs the entire lifecycle of a transaction (Browser โ Gateway โ ML Engine โ Decision), explaining exactly why a payment was blocked.
- Middleware-Level Interception: We catch tampered requests (e.g., injected headers, modified signatures) at the API edge before they ever reach business logic servers.
A fully containerized, 4-tier microservice architecture that communicates via REST and WebSockets.
| Origin | Service | Technology | Purpose |
|---|---|---|---|
| Client | ๐ React Dashboard | Next.js, Tailwind, WebSockets | Real-time threat visualization & Replay Engine |
| Edge | ๐ก๏ธ API Gateway | Node.js, Express | JWT Auth, Rate Limiting, Idempotency, Tamper Detection Middleware |
| Brain | ๐ง Fraud AI | Python, FastAPI, XGBoost | ML scoring on device/geo features; returns risk (0.0 - 1.0) in <50ms |
| Data | ๐๏ธ In-Memory Stack | Redis (Pub/Sub & Cache) | Instant event broadcasting & idempotency key storage |
- The browser initiates a payment request.
- An attacker (simulated via Requestly) intercepts the request and injects a tampering payload or header.
- The PayShield Gateway catches the anomaly in
< 2ms, flaggingreq.tampered = true. - The transaction routes to the Fraud Engine for historical scoring (even if blocked, we want the ML score).
- The Gateway immediately drops the transaction (
402 FRAUD_FLAGGED). - Redis Pub/Sub pushes the block event to the Next.js Dashboard, instantly showing a red alert and logging the lifecycle in the Replay Engine.
We built this to be frictionless for judges to review. The entire system is orchestrated with Docker Compose.
- Docker & Docker Compose installed.
# Clone the repository
git clone https://github.com/your-username/payshield.git
cd payshield
# Launch the entire microservice stack
docker-compose up -d --build- Live Dashboard:
http://localhost:4000 - API Gateway:
http://localhost:3000 - Fraud Engine (Swagger Docs):
http://localhost:8000/docs
payshield/
โ
โโโ ๐ dashboard/ # Next.js Frontend Dashboard (React + WebSocket)
โ โโโ app/
โ โ โโโ components/ # React UI Components
โ โ โ โโโ AIModelStatus.tsx # AI model performance display
โ โ โ โโโ HeatmapClient.tsx # Geographic heatmap visualization
โ โ โ โโโ LatencyChart.tsx # Real-time latency metrics
โ โ โ โโโ ReplayEngine.tsx # Transaction lifecycle analyzer
โ โ โ โโโ RequestlyDemoButton.tsx # Requestly attack simulator
โ โ โ โโโ RiskPipeline.tsx # Risk scoring pipeline viz
โ โ โ โโโ SeedDataButton.tsx # Demo data seeder
โ โ โ โโโ StatsPanel.tsx # Key metrics panel
โ โ โ โโโ TamperAlert.tsx # Tampering alerts
โ โ โ โโโ TrackingStatus.tsx # Request tracking status
โ โ โ โโโ Waterfall.tsx # Request waterfall diagram
โ โ โโโ hooks/ # Custom React Hooks
โ โ โ โโโ useLatencyStats.ts # Latency statistics hook
โ โ โ โโโ useWebSocket.ts # WebSocket connection hook
โ โ โโโ types/ # TypeScript Type Definitions
โ โ โ โโโ transaction.ts # Transaction type schemas
โ โ โโโ layout.tsx # Root layout component
โ โ โโโ page.tsx # Main dashboard page
โ โ โโโ globals.css # Global styles
โ โโโ public/ # Static assets
โ โโโ package.json
โ โโโ tsconfig.json
โ โโโ tailwind.config.ts
โ โโโ postcss.config.js
โ โโโ Dockerfile
โ โโโ next.config.mjs
โ
โโโ ๐ gateway/ # Node.js Express API Gateway (Edge Layer)
โ โโโ src/
โ โ โโโ middleware/ # Express middleware stack
โ โ โ โโโ auth.js # JWT authentication
โ โ โ โโโ errorHandler.js # Centralized error handling
โ โ โ โโโ idempotency.js # Idempotency key management
โ โ โ โโโ notFound.js # 404 handler
โ โ โ โโโ rateLimit.js # Rate limiting
โ โ โ โโโ security.js # Security headers & XSS protection
โ โ โโโ routes/ # API endpoint routes
โ โ โ โโโ auth.js # Authentication routes
โ โ โ โโโ payment.js # Payment processing routes
โ โ โโโ services/ # Business logic services
โ โ โ โโโ fraudClient.js # Fraud engine integration
โ โ โ โโโ keyRotation.js # Cryptographic key rotation
โ โ โ โโโ redisClient.js # Redis cache/pub-sub client
โ โ โโโ ws/ # WebSocket handlers
โ โ โ โโโ broadcaster.js # Real-time event broadcaster
โ โ โโโ scripts/
โ โ โ โโโ seedDemo.js # Demo data seeding script
โ โ โโโ config.js # Configuration management
โ โ โโโ index.js # Server entry point
โ โ โโโ swagger.js # OpenAPI/Swagger docs
โ โโโ package.json
โ โโโ Dockerfile
โ โโโ .gitignore
โ
โโโ ๐ fraud/ # Python FastAPI Fraud Detection Engine (ML Brain)
โ โโโ src/
โ โ โโโ features/ # Feature engineering
โ โ โ โโโ extractor.py # Transaction feature extraction
โ โ โโโ model/ # Machine Learning Models
โ โ โ โโโ isolation.py # Isolation forest anomaly detection
โ โ โ โโโ online.py # Online learning pipeline
โ โ โ โโโ rules.py # Rule-based fraud detection
โ โ โโโ dependencies.py # FastAPI dependency injection
โ โ โโโ main.py # FastAPI application entry
โ โ โโโ middleware.py # Request/response middleware
โ โ โโโ router.py # API route definitions
โ โ โโโ schemas.py # Pydantic request/response schemas
โ โโโ requirements.txt # Python dependencies
โ โโโ Dockerfile
โ โโโ .gitignore
โ
โโโ ๐ k8s-manifests/ # Kubernetes Deployment
โ โโโ payshield-stack.yaml # Complete K8s stack manifest
โ
โโโ ๐ payshield-demo/ # HTML Interactive Demo
โ โโโ index.html # Browser-based attack simulator
โ
โโโ ๐ postman/ # API Testing Collection
โ โโโ collection.json # Postman API endpoints
โ
โโโ ๐ requestly/ # Requestly Browser Extension Rules
โ โโโ rules.json # Request tampering rules config
โ
โโโ ๐ test/ # Integration Tests
โ โโโ integration.sh # End-to-end test suite
โ
โโโ ๐ณ docker-compose.yml # Docker Compose orchestration
โโโ ๐ render.yaml # Render.com deployment config
โโโ README.md # This file
โโโ ๐ Documentation Files
โโโ cmd.md # Command reference
โโโ doc.md # Detailed documentation
โโโ guide.md # User guide
โโโ full_deployment_guide.md # Deployment instructions
โโโ k8s_deployment_guide.md # Kubernetes guide
โโโ railway_deployment_guide.md # Railway.app guide
โโโ info.md # Project information
โโโ process.md # Development process
โโโ [other documentation]
- ๐ Directories - Logical service boundaries
- ๐ณ Docker Files - containerization configs
- ๐ Config Files - deployment and build configuration
- ๐ Documentation - guides and references
See PayShield in action intercepting a live API tampering attack:
๐ Watch Demo on Google Drive
The entire PayShield stack is deployed publicly on Render.com. No local setup required.
๐ Live Dashboard: https://payshield-dashboard.onrender.com/
Step 1: Open the Dashboard
- Go to https://payshield-dashboard.onrender.com/
- You will see the PayShield Intelligence System in dark mode with 4 stat cards at the top.
- The "๐ข Connected" badge in the top right confirms a live WebSocket connection to the backend.
Step 2: Seed Demo Data (Inject 25 Transactions)
- Click the "Seed Data ๐" button in the top header.
- Within 5-8 seconds, you will see 25 transactions populate the Transaction Stream waterfall table in real time.
- The stats cards will update automatically: Total Transactions = 25, Fraud Flagged = 1, Critical Alerts = 2.
Step 3: Explore the Transaction Stream
- Each row shows:
Transaction ID | Amount | Merchant | Risk Score | Status | Latency | Time - Green rows = Safe (
SUCCESS). Red rows = Blocked (FRAUD_FLAGGED/TAMPERED). - Use the Search bar to filter by merchant name or transaction ID.
Step 4: View the Global Threat Map
- Click the "Global Threat Map" tab.
- You will see geo-located dots on the world map showing where the suspicious transactions originated (US, IN, SG, AU).
- Color coding: ๐ก Medium Risk, ๐ด High Risk, ๐ฃ Critical / Tampered.
Step 5: Simulate a Live Attack (The Wow Moment)
- Click the "โก TEST TAMPER" button in the top-right header.
- Alternatively, install the Requestly Chrome Extension and add a Modify Headers rule:
- URL Contains:
payment/initiate - Request Header:
X-Requestly-Modifiedโtrue
- URL Contains:
- The moment the tampered request hits the Gateway, a red banner appears at the top of the screen:
โ ๏ธ TAMPER DETECTED โ 1 modified request intercepted - The transaction appears as
๐จ BLOCKEDin the stream with a402 FRAUD_FLAGGEDstatus.
Step 6: Analyze the Attack in the Replay Engine
- Click the "Replay Engine" tab.
- Select the red
TAMPERED / BLOCKEDtransaction. - The Replay Engine visually reconstructs the entire lifecycle:
Browser โ [TAMPERED] โ Gateway (Middleware Caught It) โ ML Engine (Scored 1.0) โ BLOCKED - This is the exact proof that PayShield caught the attack before it reached the database.
Step 7: Check the Right Sidebar
- Risk Pipeline: Shows the last 20 transactions as color-coded dots. Look for the red dot (the tampered transaction).
- System Latency Chart: Shows P50/P95 latency across the sessionโshould remain under 500ms SLA.
- AI Model Status: Confirms the ML model version and accuracy metrics.
๐ Important for Judges: Even if you have the Requestly extension installed, you would still need to manually create and configure the specific header injection rule. To avoid this friction, we strongly recommend watching the pre-recorded demo first:
๐ฅ Watch the full attack simulation on Google Drive
The video shows the exact Requestly rule setup, the header injection, theโ ๏ธ TAMPER DETECTEDalert, and the live402 FRAUD_FLAGGEDblock โ step by step.
If you still want to test it yourself, here's how:
We have pre-built the exact Requestly rule and saved it in the repo. No manual configuration needed.
- Install the Requestly Chrome Extension.
- Open Requestly โ Click Import Rules โ Upload the file
requestly/rules.jsonfrom this repository. - Open the live dashboard, click Seed Data ๐, then click any transaction to trigger an API call.
- Watch the
โ ๏ธ TAMPER DETECTEDred banner fire on the dashboard instantly.
If you'd rather create the rule yourself in Requestly:
- Rule Type: Modify Headers
- URL Contains:
payshield-gateway.onrender.com/api/v1/payment - Request Header:
X-Requestly-Modifiedโ valuetrue
No extension needed! Click the โก TEST TAMPER button directly in the PayShield Dashboard header. It sends a pre-tampered payload straight to the Gateway and triggers the full detection flow instantly.
- Behavioral Biometrics: Tracking typing speed and mouse movements to detect bots mimicking user behavior.
- Graph Database Integration: Linking fraud rings together by mapping shared IP addresses and device fingerprints (Neo4j).
- Automated Webhooks: Instant Slack/PagerDuty alerts for critical threshold breaches.
- Pusalapati Devesh Reddy
- M Tanusree Reddy
- Nihal DR
Stop trusting the client. Start proving it.