Master Competitive Programming with AI-Powered Analytics, ICPC Practice, and Smart Training Tools
🌐 Live Demo • ✨ Features • 🏗️ Architecture • 💻 Tech Stack • 🧠 Engineering
- Problem Statement
- Features
- Feature Demos
- Architecture
- Tech Stack
- Engineering Highlights
- System Flow Diagrams
- Performance Metrics
- Security & Scalability
- Roadmap
- Team
- Contact
Competitive programmers face significant challenges in their learning journey:
| Challenge | Impact |
|---|---|
| 📊 Fragmented Progress Tracking | Hard to understand growth across platforms |
| 🎯 Random Problem Selection | Inefficient practice without structured approach |
| 📈 No Personalized Analytics | Missing insights about strengths and weaknesses |
| 🧠 Limited Learning Resources | Lack of quality editorials and explanations |
| 🏆 ICPC Preparation Gap | No dedicated platform for ICPC-style training |
MyCPTrainer solves all of this with an integrated, AI-powered platform.
|
Real-time analytics with 18+ performance metrics including:
|
Spotify Wrapped-style annual review featuring:
|
|
Interactive visualizations for:
|
Curated ICPC practice system with:
|
|
Smart problem curation featuring:
|
Intelligent problem analysis with:
|
| Feature | Description |
|---|---|
| 💰 Coin System | Gamification layer encouraging consistent practice |
| 🔄 Profile Comparison | Compare metrics with other competitive programmers |
| 🤖 Telegram Bot | Daily problem delivery and streak tracking |
| 🔐 Dual Authentication | Google OAuth + Codeforces verification |
| 📱 PWA Support | Installable progressive web app |
| 🌙 Dark Mode | Eye-friendly dark theme throughout |
🤖 AI-Powered Editorials (Click to expand)
Step-by-step problem explanations powered by Google Gemini
📝 ICPC Problem Bank (Click to expand)
Curated collection of ICPC-style competitive programming problems
💻 Online Judge & Compiler (Click to expand)
Integrated code editor with real-time compilation and verdict
🎄 Codeforces Wrapped (Click to expand)
Spotify Wrapped-style annual review with brutalist-chaos aesthetic
🧮 Algorithm Visualizer - BFS (Click to expand)
Interactive BFS algorithm visualization with step-by-step execution
📊 Dashboard Walkthrough (Click to expand)
Real-time analytics dashboard with comprehensive performance metrics
Platform growth and user engagement metrics
┌─────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Browser │ │ Mobile │ │ Telegram │ │
│ │ (React) │ │ PWA │ │ Bot │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
└─────────┼────────────────┼────────────────┼─────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────┐
│ EDGE/CDN LAYER │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Cloudflare CDN │ │
│ │ (Caching, DDoS Protection, Edge Workers) │ │
│ └──────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Next.js 15 Application │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │ React UI │ │ SSR │ │ API Routes │ │ │
│ │ │ Components │ │ Rendering │ │ Handlers │ │ │
│ │ └────────────┘ └────────────┘ └────────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────┐
│ SERVICE LAYER │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Redis │ │ Google │ │ Sentry │ │Cloudflare│ │
│ │ (Upstash)│ │ GenAI │ │ Monitor │ │ Workers │ │
│ │ Cache │ │ (Gemini) │ │ Errors │ │ Crons │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────┐
│ EXTERNAL APIs │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Codeforces │ │ Razorpay │ │ Supabase │ │
│ │ API │ │ Payments │ │ Auth │ │
│ └────────────────┘ └────────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ DATA LAYER │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ PostgreSQL Database │ │
│ │ (Managed via Prisma ORM) │ │
│ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │ │
│ │ │ Users │ │ Sheets │ │ Orders │ │Problems│ │Submits │ │ │
│ │ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
- User Request → Cloudflare CDN (edge caching, DDoS protection)
- Cloudflare → Next.js Application (cached/proxied requests)
- Next.js → Supabase Auth (authentication & session management)
- Next.js ↔ Redis (rate limiting, caching layer)
- Next.js → PostgreSQL (database queries via Prisma)
- Next.js → Codeforces API (user data, submissions)
- Next.js → Google GenAI (AI-powered features)
- Next.js → Razorpay (payment processing)
- Next.js → Sentry (error tracking & monitoring)
- Cloudflare Workers → Scheduled cron jobs (data sync)
|
Next.js 15 App Router, SSR |
React 19 React Compiler |
TypeScript 5 Strict Mode |
Tailwind 4 CSS Framework |
Framer Motion Animations |
|
PostgreSQL Primary DB |
Prisma ORM |
Redis Upstash Cache |
Supabase Auth Provider |
Zod Validation |
|
Cloudflare CDN + Workers |
Vercel Deployment |
Google Cloud GenAI (Gemini) |
Sentry Error Tracking |
Razorpay Payments |
| Category | Technologies |
|---|---|
| State Management | Zustand, TanStack React Query |
| UI Components | Radix UI, Lucide Icons, Recharts |
| Visualization | D3.js, ReactFlow |
| Code Editing | Monaco Editor, Prism.js |
| Math Rendering | KaTeX |
⚡ Rate Limiting Architecture
// Upstash Redis with sliding window algorithm
const ratelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.slidingWindow(100, "15m"),
analytics: true,
});
// Per-endpoint rate limiting with user identification
export async function checkRateLimit(identifier: string) {
const key = `ratelimit:${identifier}`;
const { success, remaining, reset } = await ratelimit.limit(key);
return { success, remaining, retryAfter: reset };
}Design Rationale:
- Sliding window prevents burst attacks while allowing legitimate usage
- Redis-backed for distributed rate limiting across serverless functions
- Per-user and per-IP limiting for granular control
🗃️ Database Optimization
-- Strategic indexing for high-frequency queries
CREATE INDEX idx_users_handle ON Users(handle);
CREATE INDEX idx_users_email ON Users(email);
CREATE INDEX idx_submissions_problemid ON Submission(problemId);
CREATE INDEX idx_testcases_problem_index ON Testcase(problemId, index);Optimizations:
- Composite indexes on frequently joined columns
- Connection pooling optimized for serverless (connection limit: 3)
- Prepared statements for repeated queries
- Query result caching with React Query
🔐 Authentication Flow
┌────────────────────────────────────────────────────────────────┐
│ DUAL AUTHENTICATION SYSTEM │
├────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Google │ │ Codeforces │ │
│ │ OAuth │ │ OAuth │ │
│ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Supabase Auth │ │
│ │ (PKCE Flow + Popup Authentication) │ │
│ └──────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────┐ │
│ │ Session Management │ │
│ │ (Server-side + Cookie-based) │ │
│ └──────────────────────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────────────┘
Features:
- PKCE flow for enhanced security
- Popup-based OAuth for better UX
- Server-side session validation via middleware
- Secure cookie handling with httpOnly flags
📊 Caching Strategy
┌───────────────────────────────────────────────────────────────┐
│ MULTI-LAYER CACHING │
├───────────────────────────────────────────────────────────────┤
│ │
│ Layer 1: Cloudflare Edge (CDN) │
│ ├── Static assets: max-age=31536000 (1 year) │
│ ├── API responses: max-age=300 (5 minutes) │
│ └── Pages: max-age=604800 (7 days) │
│ │
│ Layer 2: Redis (Upstash) │
│ ├── Rate limit counters: TTL 60s │
│ ├── API response cache: TTL 300s │
│ └── Session data: TTL 86400s │
│ │
│ Layer 3: React Query (Client) │
│ ├── staleTime: 30 seconds │
│ ├── refetchOnWindowFocus: intelligent │
│ └── Cache persistence across navigation │
│ │
└───────────────────────────────────────────────────────────────┘
| Optimization | Implementation | Impact |
|---|---|---|
| React Compiler | Enabled in Next.js 15 | Auto-memoization |
| Code Splitting | Per-route lazy loading | Reduced initial bundle |
| Image Optimization | Next.js Image component | 40% faster loads |
| Bundle Analysis | Webpack bundle analyzer | Identified bloat |
| SSR + ISR | Server rendering + revalidation | SEO + freshness |
Complete authentication flow with Google OAuth and Codeforces verification
Data flow between services, caching layers, and external APIs
Complete user journey from signup to feature utilization
| Metric | Value | Target |
|---|---|---|
| ⚡ Lighthouse Performance | 95+ | 90+ |
| 🚀 Time to First Byte | <200ms | <300ms |
| 📦 First Contentful Paint | <1.2s | <1.5s |
| 🎯 Largest Contentful Paint | <2.5s | <3.0s |
| 📱 Mobile Score | 90+ | 85+ |
| 🔍 SEO Score | 100 | 95+ |
- ✅ Rate Limiting - Upstash Redis sliding window algorithm
- ✅ Input Validation - Zod schema validation on all inputs
- ✅ CORS Configuration - Strict origin policies
- ✅ HTTPS Only - SSL/TLS enforcement via Cloudflare
- ✅ Environment Isolation - Secrets in environment variables
- ✅ SQL Injection Prevention - Prisma parameterized queries
- ✅ XSS Protection - React's built-in escaping + CSP headers
- ✅ Authentication - PKCE OAuth flow with Supabase
- 🚀 Serverless First - Vercel edge functions
- 🌍 Global CDN - Cloudflare edge caching
- 📊 Connection Pooling - Optimized for serverless
- 💾 Multi-layer Caching - CDN → Redis → Client
- 📈 Horizontal Scaling - Stateless application design
- 🔄 Background Jobs - Cloudflare Workers for cron
- Core Dashboard with Analytics
- Codeforces Integration
- Algorithm Visualizer (Tree, Graph, Sorting, Binary Search)
- ICPC Problem Bank with Online Judge
- Personalized Sheets System
- AI-Powered Editorials
- Codeforces Wrapped Feature
- Payment Integration (Razorpay)
- Telegram Bot
- Coin & Gamification System
- LeetCode Integration
- CodeChef Integration
- Enhanced AI Recommendations
- Mobile Application (React Native)
- Browser Extension
- Contest Calendar Integration
- Virtual Contest Mode
- Team Collaboration Features
- Advanced Analytics Dashboard
Uday Raj Vadeghar Co-Founder & Full Stack Developer |
Naivedyam Mishra Co-Founder & CP Expert |
Nithin Raj Chouhan Founding Engineer |














