# Cross-Platform Coding Problem Search Engine
A search engine built with Flask and FastAPI that helps developers find coding problems across multiple platforms (LeetCode, CodeForces, and CodeChef) using TF-IDF based search.
## Features
- Search across multiple competitive programming platforms
- TF-IDF based relevance ranking
- Challenge name and direct link in results
- Clean and simple REST API endpoints
- Cross-platform compatibility
- Score-based result ranking
## Technology Stack
- Backend: Flask/FastAPI
- Frontend: React + TypeScript + Vite
- Search Algorithm: TF-IDF (Term Frequency-Inverse Document Frequency)
## Project Structure
project/ ├── server/ │ ├── app.py # Main server file │ └── data/ # Data files │ ├── leetcode/ │ ├── codeforces/ │ └── codechef/ ├── client/ │ ├── src/ │ ├── package.json │ └── vite.config.ts └── requirements.txt
## Installation
1. Clone the repository:
```bash
git clone [repository-url]
- Install Python dependencies:
pip install -r requirements.txt- Install frontend dependencies:
cd client
npm installEach platform (leetcode, codeforces, codechef) needs the following files in its respective directory under data/:
vocab.txt: Vocabulary termsdocuments.txt: Problem documentsinverted-index.txt: Search indexquestion-links.txt: Problem URLsidf-values.txt: IDF values for terms
GET /leetcode?query=<search_term>: Search LeetCode problemsGET /codeforces?query=<search_term>: Search CodeForces problemsGET /codechef?query=<search_term>: Search CodeChef problems
- Start the backend server:
# For Flask
python app.py
# For FastAPI
uvicorn app:app --reload- Start the frontend development server:
cd client
npm run devThe search engine uses TF-IDF (Term Frequency-Inverse Document Frequency) to rank results:
- Documents are preprocessed and indexed
- Query terms are processed similarly
- Results are ranked based on TF-IDF scores
- Results include challenge names and direct links
- The backend is built with Flask/FastAPI
- Frontend uses React with TypeScript
- Vite is used for frontend tooling
- CORS is enabled for development
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.