A comprehensive problem tracking application built with Next.js, featuring the exact same UI and functionality as the original React/Vite + Express.js version, but with a unified Next.js architecture.
- Dashboard: Overview of your progress with statistics and charts
- Problem Management: Add, edit, delete, and track coding problems
- Spaced Repetition: Smart review system for better retention
- Contest Tracking: Track your performance in coding contests
- Company Problems: Filter and organize problems by company
- Problem of the Day: Integration with LeetCode's daily challenges
- Analytics: Detailed statistics and progress visualization
- Multi-platform Support: LeetCode, CodeForces, AtCoder
- Dark/Light Theme: Toggle between themes
- Responsive Design: Works on all devices
- RESTful API: Complete API with authentication
- Database Integration: MongoDB with Prisma ORM
- JWT Authentication: Secure user authentication
- Data Validation: Input validation and error handling
- External API Integration: LeetCode GraphQL API
- CORS Support: Proper cross-origin resource sharing
- Next.js 15 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Styling
- Shadcn/UI - UI components
- Lucide React - Icons
- Recharts - Data visualization
- React Hook Form - Form handling
- Sonner - Toast notifications
- Next.js API Routes - Server-side API
- Prisma - Database ORM
- MongoDB - Database
- JWT - Authentication
- bcryptjs - Password hashing
- AI Review Insights - Personalized learning strategies and recommendations
- Similar Problems - AI-powered problem recommendations with reasoning
- Smart Analysis - Pattern recognition and skill assessment
- Learning Optimization - Adaptive study plans based on performance
-
Clone the repository:
git clone <repository-url> cd nextjs-leetcode-tracker
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local
Update
.env.localwith your values:NEXT_PUBLIC_DATABASE_URL="mongodb://localhost:27017/leetcode-cf-tracker" JWT_SECRET="your-super-secret-32-character-jwt-key" JWT_EXPIRES_IN="7d" NEXTAUTH_SECRET="your-nextauth-secret" NEXTAUTH_URL="http://localhost:3000"
-
Set up the database:
npx prisma generate npx prisma db push
-
Run the development server:
npm run dev
-
Open your browser: Navigate to http://localhost:3000
This app uses OpenRouter exclusively for AI features (hints, explanations, bug detection, code review, suggestions).
Setup:
- Get a key: https://openrouter.ai/keys
- Add to your
.env.local:- OPENROUTER_API_KEY="sk-or-v1-..."
- (Optional) OPENROUTER_MODELS="deepseek/deepseek-chat-v3.1:free,deepseek/deepseek-chat-v3.1,openai/gpt-4o-mini"
- (Optional) OPENROUTER_SITE_URL, OPENROUTER_SITE_NAME
Health check:
- Start dev:
npm run dev - Visit: http://localhost:3000/api/ai/health (should return ok: true and a model sample)
More details and migration guide: docs/OPENROUTER_MIGRATION.md
The application uses MongoDB with Prisma ORM. The schema includes:
- Users: User accounts with settings
- Problems: Coding problems with spaced repetition data
- Contests: Contest participation records
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile
GET /api/problems- Get user problems (with filters)POST /api/problems- Create new problemPUT /api/problems/[id]- Update problemDELETE /api/problems/[id]- Delete problem
GET /api/contests- Get user contestsPOST /api/contests- Create new contestPUT /api/contests/[id]- Update contestDELETE /api/contests/[id]- Delete contest
POST /api/potd- Get LeetCode Problem of the Day
GET /api/health- API health check
- Push your code to GitHub
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically
-
Build the application:
npm run build
-
Start the production server:
npm start
This Next.js version maintains 100% feature parity with the original React/Vite + Express.js version:
- β Identical UI and user experience
- β All components and functionality
- β Same data models and API contracts
- β Authentication and authorization
- β Spaced repetition algorithm
- β External API integrations
- π Unified Next.js architecture (no separate backend)
- π Prisma ORM instead of Mongoose
- π API routes instead of Express controllers
- π Built-in optimizations and performance improvements
- Register/Login: Create an account or sign in
- Add Problems: Use the "Add Problem" button to track solved problems
- Review System: Problems will appear for review based on spaced repetition
- Track Contests: Record your contest performances
- View Analytics: Monitor your progress with detailed statistics
- Company Filter: Organize problems by target companies
- AI Features: Get personalized insights and problem recommendations
This application is production-ready and can be deployed on multiple platforms:
- Vercel (Recommended):
npm run deploy:vercel - Docker:
npm run deploy:docker - Traditional VPS: See DEPLOYMENT.md
- Copy
.env.exampleto.env.local - Configure required environment variables:
DATABASE_URL- MongoDB connection stringJWT_SECRET- Secure JWT secret keyNEXTAUTH_SECRET- NextAuth secret keyNEXTAUTH_URL- Your production domainGEMINI_API_KEY- Google Gemini API key for AI features
- Visit
/api/healthto verify deployment status - Monitor database connectivity and environment configuration
For detailed deployment instructions, see DEPLOYMENT.md.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
- Original React/Vite + Express.js implementation
- LeetCode for the Problem of the Day API
- Shadcn/UI for the beautiful components
- Next.js team for the amazing framework