A spaced repetition system for LeetCode problems based on the Ebbinghaus forgetting curve.
AnkiCode helps you efficiently review LeetCode problems by automatically scheduling reviews based on your confidence level. The system uses a scientifically-proven spaced repetition algorithm to optimize learning retention.
- Intelligent review scheduling using the forgetting curve algorithm
- LeetCode problem integration and metadata fetching
- Personalized study dashboard with progress tracking
- Daily review queue management
- Confidence-based review intervals
- Problem notes and solution tracking
Frontend: React 18, TypeScript, Vite, React Query, React Router
Backend: Node.js, Express, TypeScript, MongoDB, JWT Authentication
Other: Mongoose ODM, Bcrypt, Zod validation
- Node.js 20+
- MongoDB Atlas account
# Clone repository
git clone <repository-url>
cd AnkiCode
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your MongoDB connection string
# Seed database (optional)
npm run seed
# Start development servers
npm run devAccess the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
Email: demo@example.com
Password: password123
AnkiCode/
├── backend/
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── models/ # MongoDB models
│ │ ├── routes/ # API routes
│ │ ├── middleware/ # Auth & error handling
│ │ ├── services/ # Business logic
│ │ └── utils/ # Helper functions
│ └── package.json
│
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page views
│ │ ├── api/ # API client
│ │ ├── contexts/ # React contexts
│ │ └── hooks/ # Custom hooks
│ └── package.json
│
└── database_scripts/ # Database utilities
npm run dev # Start frontend and backend
npm run dev:frontend # Start frontend only
npm run dev:backend # Start backend only
npm run seed # Seed database with demo data
npm run wipe # Clear databasePOST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/problems- List problems with filtersPOST /api/problems- Create new problemGET /api/problems/:id- Get problem detailsPUT /api/problems/:id- Update problemDELETE /api/problems/:id- Delete problemPOST /api/problems/:id/practice- Record practice session
GET /api/dashboard/today- Get today's review queueGET /api/dashboard/stats- Get user statistics
GET /api/leetcode/problem/:id- Fetch problem from LeetCode
See .env.example for required configuration:
MONGODB_URI=<your-mongodb-connection-string>
PORT=3001
JWT_SECRET=<your-jwt-secret>
VITE_API_URL=http://localhost:3001{
name: string
email: string
passwordHash: string
leetcodeUsername?: string
problemIds: ObjectId[]
settings: {
notifications: { optIn: boolean }
skipWeekends: boolean
}
}{
name: string
leetcodeId?: number
difficulty?: string
deadline: Date
rating: number
notes: string
tags: string[]
status: 'todo' | 'in_progress' | 'done'
lastPracticedAt?: Date
confidenceHistory: Array<{
date: Date
level: 'hard' | 'medium' | 'easy'
}>
ownerId: ObjectId
}{
problemId: ObjectId
userId: ObjectId
scheduledFor: Date
status: 'pending' | 'completed' | 'skipped'
createdFrom: 'practice' | 'manual'
meta: {
confidence?: string
durationSec?: number
}
}The review intervals are calculated based on confidence level:
- Easy: Review in 7 days
- Medium: Review in 3 days
- Hard: Review in 1 day
Additional reviews can be scheduled manually or triggered automatically after practice sessions.
TODO: More advanced forgetting curve algorithms will be implemented in the future.
MIT