A full-stack application that analyzes GitHub commits and predicts the likelihood of them introducing a bug. It leverages an XGBoost machine learning model trained on over 16,000 real-world Python and TypeScript commits to evaluate changes in real-time.
- Commit Risk Analysis: Evaluates commits based on size, complexity, developer history, and timing features to assign a Bug Risk level (Low, Medium, High).
- Batch Processing: Supports predicting risks for multiple commits simultaneously (up to 500).
- User Authentication: Secure sign-up and login system for users.
- Search History: Authenticated users can save their repository scans and revisit their past bug prediction results.
- Leaderboard: A gamified public leaderboard ranking users by the number of repositories they have checked and bugs they've detected.
- Framework: React 19 + TypeScript + Vite
- Styling: RadianUI + Tailwind CSS + Radix UI + class-variance-authority
- Routing: React Router
- Data Visualization: Recharts
- Forms & Validation: React Hook Form + Zod
- Framework: FastAPI
- Machine Learning: Scikit-Learn, XGBoost, Pandas
- Database ORM: SQLAlchemy (Async)
- Model: Isotonic-calibrated XGBoost classifier
final-project/
├── bug_prediction-system_v1/ # FastAPI backend API and ML models
├── client/ # React Vite frontend application
├── data/ # Datasets used for training
├── diagram/ # System architecture diagrams
├── docs/ # Project documentation
└── notebook_versions/ # Jupyter notebooks for data exploration and model training
- Node.js (v18+)
- Python (3.9+)
The backend code is actively hosted on Hugging Face Spaces: yube08/bug_prediction-system_v1.
To run the backend locally, navigate to the backend directory:
cd bug_prediction-system_v1Install the dependencies:
pip install -r requirements.txtRun the FastAPI server:
uvicorn main:app --reloadThe local API will be available at http://localhost:8000. You can view the API documentation at http://localhost:8000/docs.
Navigate to the frontend directory:
cd clientInstall the dependencies:
npm installNote: By default, the frontend is configured (via client/.env) to connect to the Hugging Face deployed backend at https://yube08-bug-prediction-system-v1.hf.space. To connect to a local backend, update the VITE_SERVER_URL in the .env file to http://localhost:8000.
Run the development server:
npm run devThe frontend application will be available at http://localhost:5173.