API Gateway with ML
Intelligent API Gateway with Anomaly Detection using Isolation Forest
Project Overview
API Gateway with ML is a robust, scalable, and intelligent API management system that acts as a single entry point for multiple backend services.
It incorporates Machine Learning (Isolation Forest) to detect anomalies and potential threats in real-time API traffic.
The project includes a modern frontend built with Next.js, a Node.js backend, a Python-based ML microservice, and PostgreSQL as the primary database.
It supports both Dockerized and non-Docker deployments for maximum flexibility.
Key Features
- Centralized API routing and management
- Real-time anomaly detection using Isolation Forest ML model
- Rate limiting, authentication, and logging
- Separate Python ML microservice for high-performance inference
- Support for Docker and non-Docker environments
- PostgreSQL database for storing logs, metrics, and user data
- Scalable microservices architecture
- Comprehensive monitoring and analytics
Tech Stack
Next.js
Node.js
Python
PostgreSQL
Isolation Forest
Docker
Express.js
TypeScript
Architecture
The system is designed with modularity in mind:
- Frontend: Next.js for admin dashboard and monitoring interface
- API Gateway: Node.js + Express.js handles routing, authentication, and request validation
- ML Service: Python FastAPI service running Isolation Forest model for anomaly detection
- Database: PostgreSQL for persistent storage
Deployment Options
- Docker Compose (recommended for production-like setup)
- Non-Docker local development setup
Contribution & Collaboration
This project is open for contributions. Feel free to improve the ML model, enhance the dashboard, add new features, or optimize performance by submitting pull requests.
If you find this project useful, consider giving it a ⭐ on GitHub.