A free, open-source web application for tracking your Data Structures & Algorithms progress with spaced repetition and automated email reminders.
- GitHub Integration: Connect your DSA repository (e.g., synced by LeetSync)
- Automatic Problem Parsing: Intelligently detects platform, difficulty, and language
- Spaced Repetition: Smart scheduling system for optimal retention
- Email Reminders: Automated daily reminders for due problems
- Code Viewer: Beautiful syntax highlighting for all languages
- Search & Filters: Quickly find problems by platform, difficulty, or language
- Webhook Support: Auto-sync on new commits
- 100% Free: Built on free-tier services
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Database: PostgreSQL (Supabase/Neon free tier)
- ORM: Prisma
- Auth: NextAuth v5 with GitHub OAuth
- Styling: TailwindCSS + Shadcn UI
- Email: Nodemailer (SMTP)
- Hosting: Vercel Free Tier
- Node.js 18+ and npm
- PostgreSQL database (local or cloud)
- GitHub OAuth App
- SMTP server access (Gmail, Outlook, etc.)
git clone <your-repo-url>
cd dsa-trainer
npm installOption A: Supabase (Recommended)
- Create a free account at supabase.com
- Create a new project
- Copy the connection string from Settings → Database
Option B: Neon
- Create a free account at neon.tech
- Create a new project
- Copy the connection string
Option C: Local PostgreSQL
brew install postgresql
brew services start postgresql
createdb dsa_trainerCopy .env.example to .env:
cp .env.example .envFill in the values:
DATABASE_URL=postgresql://user:password@localhost:5432/dsa_trainerGenerate a secret:
openssl rand -base64 32NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=<generated_secret>- Go to GitHub Settings → Developer settings → OAuth Apps → New OAuth App
- Application name:
DSA Trainer - Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github - Copy Client ID and generate a Client Secret
GITHUB_CLIENT_ID=<your_client_id>
GITHUB_CLIENT_SECRET=<your_client_secret>Option A: Gmail
- Enable 2FA on your Google account
- Generate an App Password: Google Account → Security → 2-Step Verification → App passwords
- Use these settings:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your.email@gmail.com
SMTP_PASS=<app_password>
SMTP_FROM="DSA Trainer <your.email@gmail.com>"Option B: Outlook
SMTP_HOST=smtp-mail.outlook.com
SMTP_PORT=587
SMTP_USER=your.email@outlook.com
SMTP_PASS=<your_password>
SMTP_FROM="DSA Trainer <your.email@outlook.com>"Option C: Mailtrap (Testing)
SMTP_HOST=sandbox.smtp.mailtrap.io
SMTP_PORT=2525
SMTP_USER=<mailtrap_username>
SMTP_PASS=<mailtrap_password>
SMTP_FROM="DSA Trainer <test@example.com>"NEXT_PUBLIC_APP_URL=http://localhost:3000Generate a random string:
openssl rand -hex 32CRON_SECRET=<generated_secret>npm run prisma:generate
npm run prisma:pushFor production, use migrations:
npm run prisma:migratenpm run devVisit http://localhost:3000
- Push your code to GitHub
- Import project on vercel.com
- Add all environment variables from
.env - Update
NEXTAUTH_URLandNEXT_PUBLIC_APP_URLto your Vercel URL - Deploy
- Go to your GitHub repo → Settings → Secrets and variables → Actions
- Add secrets:
APP_URL: Your deployed app URL (e.g.,https://your-app.vercel.app)CRON_SECRET: Same value as in your.env
The workflow will run daily at 1 AM UTC to send email reminders.
To test manually:
- Go to Actions tab → Daily Revision Reminders → Run workflow
- Sign in with GitHub
- Go to Settings
- Select your DSA repository from the dropdown
- Click "Connect"
- The app will scan and import all code files
- Go to your GitHub repository
- Settings → Webhooks → Add webhook
- Copy values from the app's Settings page:
- Payload URL
- Content type:
application/json - Secret
- Select "Just the push event"
- Click "Add webhook"
Now your problems will auto-sync on every push!
- View all problems on the Problems page
- Use filters to find specific problems
- Click "View" to see the code
- Open any problem
- Click "Add to Revision"
- The problem will be scheduled for revision in 7 days
- Go to the Revision page
- See problems grouped by:
- Due Today
- Due This Week
- Overdue
- Click "Review" to view the problem
- Click "Mark as Revised" when done
- This doubles the interval (7 → 14 → 28 days, etc.)
- Automatically sent daily at 1 AM UTC
- Only sent if you have problems due
- Contains direct links to problems
The app works with any reasonable DSA repository structure. It auto-detects:
Platform (from path):
leetcode/→ LeetCodegfg/orgeeksforgeeks/→ GeeksforGeekscodeforces/→ Codeforcescodechef/→ CodeChef
Difficulty (from path):
/easy/→ Easy/medium/→ Medium/hard/→ Hard
Language (from extension):
.cpp,.cc,.cxx→ C++.py→ Python.java→ Java.js→ JavaScript.ts→ TypeScript- And more...
Example structure:
DSA/
├── leetcode/
│ ├── easy/
│ │ ├── two-sum.cpp
│ │ └── valid-parentheses.py
│ ├── medium/
│ │ └── longest-substring.java
│ └── hard/
│ └── median-sorted-arrays.cpp
├── gfg/
│ └── arrays/
│ └── kadanes-algorithm.cpp
└── codeforces/
└── problem-1234A.cpp
- Check your
DATABASE_URLis correct - Ensure the database exists
- For cloud databases, check IP allowlist
- Verify
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRET - Check callback URL matches:
<your-url>/api/auth/callback/github - Ensure
NEXTAUTH_URLis correct
- Verify SMTP credentials
- For Gmail, use App Password, not regular password
- Check firewall/network restrictions on port 587
- Verify the secret matches
- Check webhook delivery logs on GitHub
- Ensure your app is publicly accessible
npx prisma generate
npx prisma db pushnpm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run prisma:generate- Generate Prisma Clientnpm run prisma:migrate- Run database migrationsnpm run prisma:push- Push schema to database (no migrations)npm run prisma:studio- Open Prisma Studio
POST /api/repos- List user repositoriesPOST /api/repos/connect- Connect a repositoryPOST /api/repos/sync- Sync repository problemsPOST /api/github/webhook- GitHub webhook handlerGET /api/problems- List problems with filtersGET /api/problems/[id]- Get problem detailsGET /api/revisions- List revisionsPOST /api/revisions- Add problem to revisionPOST /api/revisions/[id]/complete- Mark as revisedDELETE /api/revisions/[id]- Remove from revisionPOST /api/cron/daily- Send daily reminders
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for personal or commercial purposes.
For issues, questions, or suggestions, please open an issue on GitHub.
Built with ❤️ for the DSA community