This application uses a machine learning model and Spark Structured Streaming to detect credit card fraud in real-time.
Ensure both are installed on your machine:
- Install Python 3.11.11
- Install required libraries:
pip install -r requirements.txt- Start Docker Containers
docker compose up- Verify Services Are Running
Ensure the following services are up:
- cassandra
- zookeeper
- kafka
- fastapi
- dashboard
- react-dashboard
Run the following steps:
- Initialize the database:
python -m app_initialization.main(Note: You may need to wait for Cassandra to fully initialize before running this.)
- Start the Spark Structured Streaming application:
python -m spark-app-v2.structured_streaming_fraud_detection- Start the transaction producer:
python -m producers.transaction_producer- Set up the frontend dashboard:
- Navigate to the
dashboard-appfolder:
- Navigate to the
cd dashboard-app- Install dependencies:
npm install- Start the development server:
npm run devOpen your browser and navigate to:
http://localhost:5174
to view the real-time fraud detection dashboard.