CPCoach is a modern, full-stack web application designed to be your personal competitive programming coach. It automatically analyzes your Codeforces history, discovers your weakest areas, and provides tailored problem recommendations that dynamically adjust to your skill level.
This project is built using a modern, scalable JavaScript/TypeScript ecosystem:
- Framework: React + Vite
- Styling: Tailwind CSS + Lucide Icons
- Deployment: Vercel
- Framework: Node.js + Express
- Language: TypeScript
- Authentication: JWT (JSON Web Tokens) with robust Email/Password flow (bcrypt hashing)
- Deployment: Render
- ORM: Prisma
- Database: PostgreSQL (hosted on Neon)
The frontend is deployed on Vercel and the backend is deployed on Render. 👉 Play with CPCoach Live Here 👈
- Secure Authentication:
- Robust Email and Password registration system.
- Secure Bearer token architecture for seamless cross-domain API calls.
- Codeforces Integration:
- Connects directly to the public Codeforces API to ingest user submissions.
- Weak-Area Analysis:
- Calculates weighted weakness scores based on your solve rates for specific algorithm tags (e.g., Dynamic Programming, Graphs).
- Dynamic Target Rating:
- Recommends problems at exactly the right difficulty. Passes bump the difficulty up, failures drop it down.
- Modern UI:
- Glassmorphism, animated transitions, and a dark-mode optimized interface built with Tailwind CSS.
The application is deployed using a decoupled microservices architecture:
- Frontend (Vercel): The React application is built and served globally via Vercel's edge network. It uses environment variables (
VITE_API_URL) to communicate securely with the backend. - Backend (Render): The Express API is hosted on Render, handling all heavy computation, Codeforces API rate-limiting, and database interactions.
- Database (Neon): Serverless PostgreSQL database for instant scaling and secure data persistence.
To run this project locally on your machine:
- Create a free PostgreSQL database on Neon.
- Get your connection string.
cd backend
npm installCreate a .env file in the backend/ directory:
DATABASE_URL="your-neon-postgres-url"
JWT_SECRET="your-secret-key"
FRONTEND_URL="http://localhost:5173"Run the database migrations and start the server:
npx prisma db push
npm run devcd frontend
npm installCreate a .env file in the frontend/ directory:
VITE_API_URL="http://localhost:5001"Start the development server:
npm run devContributions are welcome! Please feel free to submit a Pull Request.