Skip to content

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bug Prediction System

Live Demo on Vercel Hugging Face Spaces

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.

Features

  • 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.

Tech Stack

Frontend (client/)

  • 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

Backend (bug_prediction-system_v1/)

  • Framework: FastAPI
  • Machine Learning: Scikit-Learn, XGBoost, Pandas
  • Database ORM: SQLAlchemy (Async)
  • Model: Isotonic-calibrated XGBoost classifier

Project Structure

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

Getting Started

Prerequisites

  • Node.js (v18+)
  • Python (3.9+)

1. Backend Setup (Local & Hugging Face)

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_v1

Install the dependencies:

pip install -r requirements.txt

Run the FastAPI server:

uvicorn main:app --reload

The local API will be available at http://localhost:8000. You can view the API documentation at http://localhost:8000/docs.

2. Frontend Setup

Navigate to the frontend directory:

cd client

Install the dependencies:

npm install

Note: 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 dev

The frontend application will be available at http://localhost:5173.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages