Skip to content

AtharvPS13/CF-Problem_Recommender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Codeforces Problem Recommender

An intelligent web application that analyzes Codeforces user performance and provides personalized problem recommendations to improve weak areas and enhance competitive programming skills.

✨ Key Features

  • πŸ” Smart User Analysis: Fetches and analyzes user data from Codeforces API
  • πŸ“Š Performance Insights: Analyzes past submissions and identifies weak topics
  • 🧠 ML-Powered Recommendations: Uses machine learning to recommend optimal problems
  • ⚑ Fast & Lightweight: Browser-based with local storage, no database required
  • 🌐 Modern Web Stack: React frontend + FastAPI backend
  • πŸ“± Responsive Design: Works seamlessly on desktop and mobile devices

πŸš€ Live Demo

  • Frontend: Deployed on Vercel
  • Backend: Deployed on Render
  • Demo: Live Application

πŸ› οΈ Tech Stack

Frontend

  • React with Vite
  • React Router for navigation
  • Axios for API calls
  • Recharts for data visualization
  • CSS3 for styling

Backend

  • FastAPI for REST API
  • Scikit-learn for ML models
  • Pandas for data processing

πŸ“ Project Structure

ml-project/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ api.py              # FastAPI endpoints
β”‚   β”œβ”€β”€ main.py             # Core logic for data processing
β”‚   β”œβ”€β”€ model.py            # ML model implementation
β”‚   β”œβ”€β”€ requirements.txt    # Python dependencies
β”‚   └── runtime.txt         # Python version
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ Services/      # API service layer
β”‚   β”‚   β”œβ”€β”€ context/       # React context providers
β”‚   β”‚   └── assets/        # Static assets
β”‚   β”œβ”€β”€ package.json       # Node.js dependencies
β”‚   └── vite.config.js     # Vite configuration
└── README.md

🚦 Quick Start

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • Codeforces account

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the server:
python -m uvicorn api:app --reload

The backend will be available at http://localhost:8000

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start development server:
npm run dev

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

πŸ”Œ API Endpoints

Core Endpoints

Method Endpoint Description
POST /recommend Get personalized problem recommendations
GET /api/rating-accuracy Get accuracy statistics by rating
GET /syncproblems Get user's solved problems

Example Request

curl -X POST "http://localhost:8000/recommend" \
  -H "Content-Type: application/json" \
  -d '{"handle": "tourist"}'

🎯 How It Works

  1. Data Collection: Fetches user submissions from Codeforces API
  2. Feature Extraction: Processes submission data to extract features
  3. Model Training: Trains ML model on user performance patterns
  4. Problem Filtering: Identifies unsolved problems within skill range
  5. Recommendation: Ranks problems based on improvement potential

πŸ“Š Features Breakdown

User Analysis

  • Submission history analysis
  • Rating progression tracking
  • Weak topic identification
  • Performance metrics calculation

Problem Recommendations

  • Personalized difficulty levels
  • Topic-based recommendations
  • Skill gap targeting
  • Progress tracking

Visualizations

  • Rating accuracy charts
  • Topic performance graphs
  • Progress over time
  • Problem difficulty distribution

πŸ§ͺ Development

Running Tests

# Backend tests
cd backend
python -m pytest

# Frontend tests
cd frontend
npm test

Code Quality

# Backend linting
cd backend
flake8 .

# Frontend linting
cd frontend
npm run lint

πŸš€ Deployment

Frontend (Vercel)

cd frontend
npm run build
vercel --prod

Backend (Render)

# Push to GitHub and connect to Render
# Set environment variables in Render dashboard

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors