A real-time fraud detection platform for financial transactions
M2 Fraud Detection is a real-time fraud detection platform for financial transactions. It integrates:
- Node.js API for transaction ingestion
- Kafka for real-time streaming
- Machine Learning (Isolation Forest) for anomaly detection
- Redis for caching and blacklisting
- Decision Engine for automatic actions (
APPROVE,FLAG,BLOCK) - React/Next.js Dashboard for live monitoring
- Author: Md Mahbubur Rahman
- GitHub: https://github.com/m-a-h-b-u-b
- Website/Portfolio: https://m-a-h-b-u-b.github.io
- Modular Architecture Includes modules for API, dashboard, decision engine, ML service, Kafka messaging, and Redis caching.
- Real-Time Fraud Detection Processes transaction streams and applies ML models to identify suspicious activity.
- Docker & Docker-Compose Support Containerized deployment for all services ensures easy setup and scaling.
- Transaction Generator Simulate transactions for testing and ML model training.
- Scalable Messaging System Uses Kafka for real-time transaction streaming and asynchronous processing.
- Backend: Node.js, Express.js
- Frontend: React.js / Dashboard
- Database & Cache: Redis
- Messaging: Apache Kafka
- ML Service: Python (Scikit-learn / TensorFlow / PyTorch)
- Containerization: Docker & Docker-Compose
- Other Tools: Git, ESLint, Prettier
+----------------+ +----------------+
| Transaction | ----> | API | ----> CRUD & Stream
| Generator | +----------------+
+----------------+ |
v
+--------------------+
| Decision Engine | --> Fraud Detection Logic
+--------------------+
|
v
+--------------------+
| ML Service | --> Predicts Fraud Probability
+--------------------+
|
v
+------------------+
| Kafka Broker | --> Stream Processing
+------------------+
|
v
+--------------------+
| Dashboard | --> Real-time Visualization
+--------------------+
- Docker & Docker-Compose installed
- Node.js & npm installed (for local development)
- Python 3.x (for ML service)
- Kafka & Redis (or via Docker containers)
git clone https://github.com/m-a-h-b-u-b/M2-Fraud-Detection.git
cd M2-Fraud-Detectiondocker-compose up --buildThis will start all modules:
- API server
- Dashboard
- Decision engine
- ML service
- Kafka broker
- Redis server
- API Service
cd api
npm install
npm start- Dashboard
cd dashboard
npm install
npm start- ML Service
cd ml-service
pip install -r requirements.txt
python ml_service.py- Transaction Simulation:
Use
generate_transactions.jsto simulate transactions:
node generate_transactions.js-
Access Dashboard: Open
http://localhost:3000in your browser to monitor transactions in real-time. -
API Endpoints: The API provides CRUD operations for transactions and fraud analysis. Example:
GET /api/transactions
POST /api/transactions
GET /api/fraud/:transactionIdContributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-name) - Make your changes
- Commit your changes (
git commit -m "Add feature") - Push to the branch (
git push origin feature-name) - Create a Pull Request
Please ensure code follows the project’s style and ESLint rules.
This project is dual-licensed:
- Open-Source / Personal Use: Apache 2.0
- Commercial / Closed-Source Use: Proprietary license required
For commercial licensing inquiries or enterprise use, please contact: mahbub.aaman.app@gmail.com