This repository contains the complete backend for the sample Risk Radar application. It includes files for data generation, database management, machine learning model training, and a Flask web server to serve the application
Make sure you have Python installed. Then, install the required libraries by running:
pip install -r requirements.txt
Update your database credentials in the database.py file.
Important Note: For security reasons, avoid hardcoding credentials in production. Use a .env
file and load the credentials dynamically in database.py.
If you want to re-train the machine learning model:
Open and run model.ipynb and run all cells to train the model. This will generate the model artifacts required by the application.
Generate sample data by running the following script:
python setup/data_sample_generator.py
Load the generated sample data into your database using:
python setup/data_loader.py
Test the backend logic by running:
python service.py
Start the Flask web server with:
python app.py
The application should now be running locally. Access it via: http://localhost:5000