This project is a full-stack application that provides a B2B sales dashboard with predictive analytics. It consists of a React frontend, a Flask backend for ML model serving, and a servlet backend (Java) for additional server-side logic.
ML Model Training.ipynb # Jupyter notebook for model training
flask_backend/ # Python Flask backend for ML inference
server.py # Main Flask server
util.py # Utility functions
__pycache__/ # Python bytecode cache
.vscode/ # VSCode settings
artifacts/ # Model artifacts
model.pickle # Trained ML model
dictionary/ # Feature dictionaries
encoders/ # Encoders for categorical features
react_frontend/ # React frontend
public/ # Static files
src/ # React source code
servlet_backend/ # Java servlet backend
h2h_milestone_3/Servers/ # Additional server resources
- Interactive Dashboard: Visualize B2B sales data.
- Predictive Analytics: Make predictions using a trained ML model.
- REST API: Flask backend serves predictions to the frontend.
- Modular Frontend: Built with React and modern best practices.
- Extensible Backend: Java servlet backend for additional business logic.
-
Navigate to the backend directory:
cd flask_backend -
Install dependencies:
pip install -r requirements.txt
-
Run the Flask server:
python server.py
The server will start on
http://localhost:5000by default.
-
Navigate to the frontend directory:
cd react_frontend -
Install dependencies:
npm install
-
Start the React app:
npm start
The app will run on
http://localhost:3000.
- The servlet backend is located in servlet_backend/.
- Setup and deployment instructions depend on your Java environment and servlet container (e.g., Tomcat).
- Open http://localhost:3000 in your browser to access the dashboard.
- The frontend communicates with the Flask backend for predictions.
- Ensure both the Flask and React servers are running for full functionality.
- Trained model and encoders are stored in artifacts/.
- The Flask backend loads these artifacts for inference.
npm start— Runs the app in development mode.npm test— Launches the test runner.npm run build— Builds the app for production.npm run eject— Ejects the configuration (irreversible).
See react_frontend/README.md for more details.
python server.py— Starts the Flask server.
This project is for educational purposes. Please see individual files for license information if applicable.
- Create React App
- Flask
- scikit-learn, pandas, and other Python ML libraries
For more details, refer to the documentation in each subdirectory.