Skip to content

vansvan17/CPForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPForge

Train your weaknesses. Forge your rating.

A personalized Codeforces training tool that analyzes your submission history, identifies weak topics, and recommends problems to systematically improve your rating.


Problem Statement

Competitive programmers on Codeforces practice randomly without insight into their weak areas, wasting time on topics they're already strong at. There's no single tool that combines:

  • Weakness detection from submission history
  • Curated problem recommendations
  • Solve logging with a live weakness model
  • Quick access to CP learning resources

CPForge solves this by pulling your CF submission history, computing a weakness score per tag, and building a personalized practice plan.


Features

Feature Description
📊 Weakness Dashboard Tag-wise weakness scores from your CF submissions
🎯 Problem Recommendations Filtered by your weakest tags + difficulty range
📝 Solve Logging Auto-fetch problem tags, log time + result
🧠 Live Weakness Model Updates tag scores every time you log a solve
📋 Practice Sheet Save problems with To Do / Attempted / Solved tracking
📚 Resources Panel Quick access to CSES, USACO Guide, CP-Algorithms, and more
🔐 Firebase Auth Email/password login with persistent data

🛠 Tech Stack

  • React 18 (functional components, hooks)
  • React Router v6 (routing + lazy loading)
  • Context API (global state management)
  • Firebase (Authentication + Firestore)
  • Codeforces Public API (submission history + problem metadata)
  • Recharts (data visualization)
  • Vite (build tool)

Setup Instructions

1. Clone and install

git clone <your-repo-url>
cd cpforge
npm install

2. Set up Firebase

  1. Go to Firebase Console
  2. Create a new project
  3. Add a Web App → copy the firebaseConfig object
  4. Enable Authentication → Email/Password
  5. Enable Firestore Database (start in test mode)

3. Add your Firebase config

Edit src/services/firebase.js and replace the placeholder values:

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_PROJECT.firebaseapp.com",
  projectId: "YOUR_PROJECT_ID",
  // ...
}

4. Run the app

npm run dev

Open http://localhost:5173

5. Deploy (optional)

npm run build
# Then deploy the dist/ folder to Vercel or Netlify

📁 Project Structure

src/
├── components/
│   ├── Sidebar.jsx          # Navigation sidebar
│   ├── Onboarding.jsx       # CF handle entry overlay
│   ├── ProblemCard.jsx      # Reusable problem card
│   ├── WeakBar.jsx          # Tag weakness bar
│   └── ProtectedRoute.jsx   # Auth guard
├── pages/
│   ├── Dashboard.jsx        # Main dashboard
│   ├── Weaknesses.jsx       # Full tag analysis
│   ├── Recommendations.jsx  # Problem recommendations
│   ├── Sheet.jsx            # Practice sheet
│   ├── LogSolve.jsx         # Log a solve
│   ├── History.jsx          # Solve history
│   ├── Resources.jsx        # CP resources
│   └── Login.jsx            # Auth page
├── context/
│   ├── AppContext.jsx        # Global app state + weakness engine
│   └── AuthContext.jsx       # Firebase auth state
├── hooks/
│   └── useCFData.js          # CF API fetching hook
├── services/
│   ├── firebase.js           # Firebase init
│   ├── cfApi.js              # Codeforces API wrapper
│   ├── firestoreService.js   # Firestore CRUD
│   └── data.js               # Static problem + resource data
├── App.jsx                   # Root with routing
├── main.jsx                  # Entry point
└── index.css                 # Global styles

Weakness Score Algorithm

weakness_score(tag) =
  (wrong_submissions × 2)
  - (solved_count × 1.5)
  + time_penalty_from_logs

where:
  time_penalty = max(0, (solve_time_mins - 45) / 30)
  solved_clean log → score - 3
  solved_hint  log → score - 1
  partially    log → score + 1

Higher score = weaker topic = prioritized in recommendations.


📜 License

MIT — build something great.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors