Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 CFanatic

AI-Powered Codeforces Performance Analyzer

Unlock your competitive programming potential with intelligent insights powered by Google Gemini

Made with React FastAPI TypeScript Python TailwindCSS

FeaturesQuick StartDemo VideoTech StackContributing


✨ Features

🤖 AI-Powered Analysis

Leveraging Google Gemini and LangGraph to provide:

  • Deep performance insights
  • Personalized problem recommendations
  • Contest strategy suggestions
  • Weakness identification and improvement paths

📊 Comprehensive Metrics

Real-time analysis of your Codeforces profile:

  • Rating trends and predictions
  • Topic-wise problem distribution
  • Contest performance analytics
  • Submission history analysis

💬 Persistent Chat History

Never lose your insights:

  • Multi-session conversation support
  • Searchable chat history
  • Context-aware responses
  • Session management

🔒 Security First

Your data, your control:

  • End-to-end API key encryption
  • Secure authentication (JWT)
  • No API key storage on servers
  • Privacy-focused architecture

🎯 Why CFanatic?

Traditional practice tracking tools show you what you solved.
CFanatic tells you why it matters and what to do next.

  • 💡 Smart Recommendations: Not just random problems - get personalized suggestions based on your strengths and weaknesses
  • 🎓 Learning Path: AI-curated problem sets that match your skill level and learning goals
  • 📈 Performance Tracking: Visualize your growth and identify patterns in your problem-solving journey
  • 🤝 Conversational Interface: Ask questions naturally - "What topics should I focus on?" or "Why did my rating drop?"

🎬 Demo Video

CFanatic Demo Video

👆 Click to watch CFanatic in action - AI-powered Codeforces analysis

---

🚀 Quick Start

Prerequisites

Before you begin, ensure you have:

Installation

1️⃣ Clone the Repository

git clone https://github.com/yourusername/cfanatic.git
cd cfanatic

2️⃣ Backend Setup

# Navigate to backend directory
cd backend

# Install Python dependencies
pip install -r requirements.txt

# Generate encryption keys
python ../generate_keys.py

# Create .env file
# Copy the generated keys to .env (see env.template)

Create a .env file in the backend directory:

SECRET_KEY=<generated-from-script>
ENCRYPTION_KEY=<generated-from-script>
PORT=8000

3️⃣ Frontend Setup

# Navigate to frontend directory
cd ../frontend

# Install dependencies
npm install

# Start development server
npm run dev

4️⃣ Start the Backend

# In a new terminal, from the backend directory
cd backend
uvicorn main:app --reload

5️⃣ Access the Application

Open your browser and navigate to:


🛠️ Tech Stack

Frontend

  • ⚛️ React 19.2 - Modern UI library
  • 📘 TypeScript - Type-safe JavaScript
  • 🎨 TailwindCSS - Utility-first CSS framework
  • ✨ Framer Motion - Smooth animations
  • 🔥 Vite - Lightning-fast build tool
  • 🧭 React Router - Client-side routing

Backend

  • ⚡ FastAPI - High-performance Python web framework
  • 🗄️ SQLAlchemy - SQL toolkit and ORM
  • 🔐 JWT Authentication - Secure user sessions
  • 🔒 Cryptography - API key encryption
  • 🤖 LangChain - LLM application framework
  • 🧠 LangGraph - Agentic workflow orchestration

AI & Data

  • 🌟 Google Gemini - Advanced language model
  • 📊 Codeforces API - Contest and user data
  • 🔍 Sentence Transformers - Semantic search
  • 📚 FAISS - Vector similarity search (RAG)

DevOps

  • 🐳 Docker - Containerization
  • 🤗 Hugging Face Spaces - Deployment platform
  • 🔄 Git - Version control

📁 Project Structure

cfanatic/
├── backend/                # FastAPI backend
│   ├── main.py            # Application entry point
│   ├── auth.py            # Authentication logic
│   ├── models.py          # Database models
│   ├── mcp_server.py      # LangGraph agent
│   ├── cf_api.py          # Codeforces API integration
│   ├── rag.py             # RAG system for embeddings
│   ├── database.py        # Database configuration
│   └── requirements.txt   # Python dependencies
│
├── frontend/              # React frontend
│   ├── src/
│   │   ├── components/    # Reusable UI components
│   │   ├── pages/         # Page components
│   │   ├── config.ts      # API configuration
│   │   └── App.tsx        # Main app component
│   ├── package.json       # Node dependencies
│   └── vite.config.ts     # Vite configuration
│
├── Dockerfile             # Docker build configuration
├── .dockerignore          # Docker ignore patterns
├── README.md              # This file
├── DEPLOYMENT.md          # Deployment guide
├── generate_keys.py       # Security key generator
└── env.template           # Environment template

🎮 Usage Guide

1. Create an Account

Register with your username, email, and password.

2. Configure API Keys

  • Get a free Gemini API key from Google AI Studio
  • Enter your Codeforces handle
  • API keys are encrypted and stored securely

3. Start Analyzing

Ask questions like:

  • "Analyze my recent contest performance"
  • "What topics should I focus on to reach Expert?"
  • "Give me 5 problems to improve my DP skills"
  • "Why did my rating drop in the last contest?"

4. Track Progress

  • View your chat history
  • Continue previous conversations
  • Export insights for future reference

🤝 Contributing

Contributions are welcome! Here's how you can help:

  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.


🙏 Acknowledgments

  • Codeforces for providing the amazing competitive programming platform
  • Google for the powerful Gemini AI model
  • LangChain team for the excellent LLM framework
  • The open-source community for all the amazing tools

⭐ Star this repo if you find it useful!

Made with ❤️ for the competitive programming community

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages