Welcome to the Fraud Detection Streaming Demo! This repository provides a robust solution for detecting fraudulent activities in real-time using advanced technologies.
- Overview
- Technologies Used
- Getting Started
- How It Works
- API Documentation
- Usage
- Contributing
- License
- Contact
Fraud detection is a critical aspect of many industries, especially in finance and e-commerce. This project demonstrates how to build a real-time fraud detection system using various technologies. The system analyzes streaming data to identify potential fraudulent transactions as they occur.
You can find the latest releases for this project here. Download the necessary files and execute them to get started!
This project utilizes the following technologies:
- Apache Spark: For big data processing and analytics.
- Apache Superset: For data visualization.
- Docker Compose: To manage multi-container Docker applications.
- Flask: For building the REST API.
- PostgreSQL: For the database.
- RandomForestClassifier: For machine learning classification.
- SQLAlchemy: For database interaction.
- Superset Docker: For deploying Superset with Docker.
To set up the project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/Jaydip0724/fraud-detection-system.git cd fraud-detection-system
-
Install Docker: Ensure you have Docker and Docker Compose installed on your machine. You can download them from the official Docker website.
-
Build the Docker Containers: Use Docker Compose to build the containers.
docker-compose up --build
-
Access the Application: Open your browser and navigate to
http://localhost:5000
to access the Flask application. -
Check PostgreSQL: Ensure that PostgreSQL is running and accessible. You can connect to it using any SQL client.
The fraud detection system processes incoming transaction data in real-time. Here’s a brief overview of its workflow:
- Data Ingestion: The system ingests transaction data streams using Apache Spark.
- Data Processing: Spark processes the data and prepares it for analysis.
- Machine Learning: The RandomForestClassifier analyzes the data to identify fraudulent patterns.
- API Integration: The Flask application serves as a REST API, allowing users to interact with the system.
- Visualization: Apache Superset provides dashboards to visualize the data and insights.
The REST API provides several endpoints to interact with the fraud detection system:
- POST /transactions: Submit a new transaction for analysis.
- GET /transactions: Retrieve past transactions.
- GET /status: Check the status of the fraud detection system.
To submit a transaction, use the following curl command:
curl -X POST http://localhost:5000/transactions \
-H "Content-Type: application/json" \
-d '{"amount": 150.00, "currency": "USD", "user_id": "12345"}'
The API will return a response indicating whether the transaction is fraudulent or not:
{
"transaction_id": "abc123",
"is_fraudulent": false
}
Once the application is running, you can start submitting transactions for analysis. Use the API endpoints to interact with the system. You can also visualize the data using Apache Superset.
- Open Superset at
http://localhost:8088
. - Log in using the credentials provided in the Docker Compose file.
- Create dashboards to visualize transaction data and insights.
We welcome contributions! If you want to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
. - Make your changes and commit them:
git commit -m 'Add your feature'
. - Push to the branch:
git push origin feature/YourFeature
. - Open a pull request.
Please ensure your code adheres to the project's coding standards.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or suggestions, feel free to reach out:
- Author: Jaydip0724
- Email: jaydip@example.com
- GitHub: Jaydip0724
For more information, check the Releases section for updates and downloads.
Thank you for your interest in the Fraud Detection Streaming Demo! We hope you find it useful in your projects.