A modern, full-stack DSA problem tracking and analytics platform
Track your coding journey, sync LeetCode stats, and visualize your progress with beautiful analytics.
Features β’ Tech Stack β’ Getting Started β’ API Reference β’ Project Structure β’ Deployment
- Add & Organize Problems - Track DSA problems with difficulty levels, topics, and custom notes
- Progress Monitoring - Mark problems as solved and track your completion rate
- Category Filtering - Filter problems by difficulty (Easy, Medium, Hard) and topics
- Profile Sync - Connect your LeetCode profile and auto-sync statistics
- Real-time Stats - View solved problems, acceptance rate, ranking, and streaks
- Difficulty Breakdown - Visualize your progress across Easy, Medium, and Hard problems
- Submission History - Track your recent submissions and activity
- Secure Auth System - Email/password authentication with bcrypt hashing
- Role-based Access - User and Admin roles with protected routes
- Session Management - Persistent sessions with secure localStorage handling
- Dark/Light Mode - Beautiful theme toggle with system preference detection
- Responsive Design - Fully responsive across all device sizes
- Smooth Animations - Polished micro-interactions and transitions
- Accessible Components - Built with accessibility best practices
- User Dashboard - Personal statistics, recent activity, and progress charts
- Admin Dashboard - User management and platform-wide analytics
- Visual Charts - Progress bars, stats cards, and achievement tracking
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15.5 | React framework with App Router |
| React | 19.1 | UI library |
| TypeScript | 5.x | Type-safe development |
| Tailwind CSS | 4.x | Utility-first styling |
| Zustand | 5.x | State management |
| Lucide React | Latest | Icon library |
| next-themes | 0.4 | Theme management |
| Technology | Version | Purpose |
|---|---|---|
| Next.js API Routes | 15.5 | RESTful API endpoints |
| MongoDB Atlas | 7.x | Cloud database |
| Mongoose | 9.x | MongoDB ODM |
| bcryptjs | 3.x | Password hashing |
| Technology | Purpose |
|---|---|
| Vercel | Deployment & Hosting |
| ESLint | Code linting |
| Turbopack | Fast bundling |
| Git | Version control |
- Node.js 18.x or higher
- npm 9.x or higher (or yarn/pnpm)
- MongoDB Atlas account (Create free account)
-
Clone the repository
git clone https://github.com/AdityaRaj019/codelitics.git cd codelitics -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Update
.env.localwith your credentials:# MongoDB Atlas Connection MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/codelitics # NextAuth Configuration NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-secret-key-here # LeetCode API LEETCODE_API_BASE=https://alfa-leetcode-api.onrender.com
-
Run the development server
npm run dev
-
Open your browser
http://localhost:3000
npm run build
npm start| Endpoint | Method | Description |
|---|---|---|
/api/auth/register |
POST | Register a new user |
/api/auth/login |
POST | Login with credentials |
/api/auth/me |
GET | Get current user data |
| Endpoint | Method | Description |
|---|---|---|
/api/problems |
GET | Get all problems for user |
/api/problems |
POST | Add a new problem |
/api/problems/[id] |
GET | Get problem by ID |
/api/problems/[id] |
PATCH | Update problem |
/api/problems/[id] |
DELETE | Delete problem |
| Endpoint | Method | Description |
|---|---|---|
/api/platforms/leetcode/connect |
POST | Connect LeetCode profile |
/api/platforms/leetcode/sync |
POST | Sync LeetCode statistics |
/api/platforms/leetcode/stats |
GET | Get LeetCode stats |
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Database connection status |
/api/test-db |
GET | Database collection stats |
codelitics/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API Routes
β β β βββ auth/ # Authentication endpoints
β β β βββ problems/ # Problem CRUD endpoints
β β β βββ platforms/ # Platform integrations
β β β βββ health/ # Health check endpoint
β β βββ dashboard/ # Dashboard pages
β β βββ login/ # Login page
β β βββ register/ # Registration page
β β βββ problems/ # Problems page
β β βββ profile/ # Profile page
β β βββ page.tsx # Home page
β β
β βββ components/ # React Components
β β βββ ui/ # Base UI components
β β βββ Header.tsx # Navigation header
β β βββ Footer.tsx # Page footer
β β βββ LeetCodeStats.tsx # LeetCode statistics display
β β βββ ProblemList.tsx # Problem list component
β β βββ ConnectLeetCode.tsx
β β βββ ...
β β
β βββ stores/ # Zustand State Management
β β βββ authStore.ts # Authentication state
β β βββ problemStore.ts # Problems state
β β βββ profileStore.ts # User profile state
β β βββ index.ts # Store exports
β β
β βββ lib/ # Utilities & Database
β βββ db/
β βββ connect.ts # MongoDB connection
β βββ models/ # Mongoose schemas
β β βββ User.ts
β β βββ Problem.ts
β β βββ PlatformStats.ts
β β βββ UserProblemProgress.ts
β βββ index.ts
β
βββ public/ # Static assets
βββ .env.example # Environment template
βββ .env.local # Local environment (git-ignored)
βββ package.json
βββ tailwind.config.ts
βββ tsconfig.json
βββ next.config.ts
-
Push to GitHub
git push origin main
-
Import to Vercel
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
-
Configure Environment Variables
Add these in Vercel's Settings β Environment Variables:
Variable Value MONGODB_URIYour MongoDB Atlas connection string NEXTAUTH_URLYour Vercel deployment URL NEXTAUTH_SECRETGenerated secret key LEETCODE_API_BASEhttps://alfa-leetcode-api.onrender.com -
Deploy
- Vercel will automatically build and deploy your app
- Create a free cluster at MongoDB Atlas
- Create a database user with read/write permissions
- Whitelist
0.0.0.0/0in Network Access (for Vercel) - Get your connection string from Database β Connect β Drivers
| Command | Description |
|---|---|
npm run dev |
Start development server with Turbopack |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
- Password Hashing - All passwords hashed with bcrypt (12 rounds)
- Input Validation - Server-side validation on all endpoints
- Environment Variables - Sensitive data stored in environment variables
- Unique Constraints - Database-level uniqueness for emails
- Error Handling - Proper error responses without leaking sensitive info
- OAuth Integration - Google & GitHub login
- Password Reset - Email-based password recovery
- Middleware Protection - Route-level authentication
- More Platforms - Codeforces, HackerRank integration
- Progress Charts - Visual analytics with charts
- Achievements System - Gamification features
- Export Data - Download your progress data
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Aditya Raj
- GitHub: @AdityaRaj019
β Star this repository if you found it helpful!
Made with β€οΈ using Next.js and TypeScript