{"id":46292863,"url":"https://github.com/the-mrinal/algoreps","last_synced_at":"2026-03-04T09:00:18.544Z","repository":{"id":341910762,"uuid":"1171665015","full_name":"the-mrinal/algoreps","owner":"the-mrinal","description":"Stop grinding. Start retaining. A spaced repetition platform for mastering DSA.","archived":false,"fork":false,"pushed_at":"2026-03-03T21:02:49.000Z","size":507,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"ralph/dsa-spaced-repetition-platform","last_synced_at":"2026-03-04T00:29:17.568Z","etag":null,"topics":["algorithms","dsa","learning-tool","nextjs","spaced-repetition","typescript"],"latest_commit_sha":null,"homepage":"https://reps.mrinal.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/the-mrinal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-03T13:30:50.000Z","updated_at":"2026-03-03T21:02:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/the-mrinal/algoreps","commit_stats":null,"previous_names":["the-mrinal/algoreps"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/the-mrinal/algoreps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-mrinal%2Falgoreps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-mrinal%2Falgoreps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-mrinal%2Falgoreps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-mrinal%2Falgoreps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the-mrinal","download_url":"https://codeload.github.com/the-mrinal/algoreps/tar.gz/refs/heads/ralph/dsa-spaced-repetition-platform","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-mrinal%2Falgoreps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30076935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","dsa","learning-tool","nextjs","spaced-repetition","typescript"],"created_at":"2026-03-04T09:00:17.101Z","updated_at":"2026-03-04T09:00:18.523Z","avatar_url":"https://github.com/the-mrinal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eAlgoReps\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    Stop grinding. Start retaining.\n    \u003cbr /\u003e\n    A spaced repetition platform for mastering Data Structures \u0026 Algorithms.\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://reps.mrinal.dev\"\u003eLive Demo\u003c/a\u003e\n    \u0026middot;\n    \u003ca href=\"https://github.com/the-mrinal/algoreps/issues\"\u003eReport Bug\u003c/a\u003e\n    \u0026middot;\n    \u003ca href=\"https://github.com/the-mrinal/algoreps/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n## Screenshots\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/screenshots/landing-hero.png\" alt=\"Landing Page\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/screenshots/landing-features.png\" alt=\"Features \u0026 How It Works\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/screenshots/progress-dashboard.png\" alt=\"Progress Dashboard\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n---\n\n## The Problem\n\nYou solve 200+ LeetCode problems. Two weeks later, you blank on a medium-difficulty question in an interview. Sound familiar?\n\nThe issue isn't practice volume -- it's the **forgetting curve**. Without systematic review, retention drops exponentially within days.\n\n## The Solution\n\nAlgoReps applies **spaced repetition** (the same science behind Anki and language-learning apps) to DSA practice. An SM-2 variant algorithm schedules reviews at optimal intervals based on how well you performed, so you revisit problems right before you'd forget them.\n\nStruggled? You'll see it again tomorrow. Nailed it? See you in two weeks.\n\n---\n\n## Features\n\n### Spaced Repetition Engine\nSM-2 variant scheduling based on self-assessed performance scores (1-5). The algorithm calculates optimal review intervals to maximize retention with minimal reviews.\n\n| Score | Meaning | Next Review |\n|-------|---------|-------------|\n| 1-2   | Struggled / couldn't solve | +1 day |\n| 3     | Solved with difficulty | +4 days |\n| 4-5   | Solved confidently | +14 days |\n\n### Built-in Code Editor\nMonaco-powered editor with **Python 3** and **Go** support. Write, run, and test your solutions directly in the browser with a 10-second execution timeout and stdout/stderr capture.\n\n### AI Code Review (Optional)\nGemini 2.5 Flash integration that analyzes your solution for:\n- Time and space complexity\n- Code quality and readability\n- Edge case coverage\n- Alternative approaches\n- Interview readiness score\n\n### Live Attempt Timer\nBuilt-in stopwatch that starts when you begin a problem and tracks elapsed time throughout your attempt. Time spent is automatically logged with each submission, helping you build interview-pace awareness and identify problems that take longer than expected.\n\n### Trust Mode Logger\nSolved a problem on LeetCode, CodeChef, Codeforces, HackerRank, GeeksforGeeks, or in a notebook? Log it without submitting code. Add the problem URL, your approach, and remarks -- it still gets scheduled for review.\n\n### Progress Dashboard\n- Total problems solved, current streak, average score\n- Topic mastery chart (Recharts)\n- Full submission history with sorting and filtering\n- Due today / due this week counters\n\n### Problem Bank\n300+ curated problems from **NeetCode-150** and **Blind-75**, each with:\n- Full description, examples, and constraints\n- Python 3 and Go code stubs\n- Hints and NeetCode video links\n- Difficulty and topic tags\n\n### Discord Notifications\n- **Morning briefing** (8:00 AM): Lists all due revisions grouped by difficulty\n- **Evening wrap-up** (9:00 PM): Daily stats, streak, and weak topics\n\n### Multi-Platform Support\nAdd problems from any major competitive programming site -- LeetCode, CodeChef, Codeforces, HackerRank, and GeeksforGeeks. The platform is auto-detected from the URL, and problem titles are auto-filled from the slug.\n\n### CSV Import\nBulk import problems from Google Sheets exports with automatic deduplication by slug. Supports both `problem_url` and `leetcode_url` columns.\n\n### Theme System\nDark, light, and system modes with a neon hacker aesthetic (cyan/green/purple glow effects).\n\n---\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|------------|\n| Framework | [Next.js 14](https://nextjs.org) (App Router) |\n| Language | TypeScript |\n| UI | React 18, [Tailwind CSS](https://tailwindcss.com) |\n| Editor | [Monaco Editor](https://microsoft.github.io/monaco-editor/) |\n| Database | [Supabase](https://supabase.com) (PostgreSQL + Auth + RLS) |\n| Auth | Passwordless magic links (Supabase Auth) |\n| AI | [Google Gemini 2.5 Flash](https://ai.google.dev) |\n| Code Execution | Node.js child process (Python 3, Go) |\n| Notifications | Discord Webhooks |\n| Scheduling | node-cron |\n| Charts | [Recharts](https://recharts.org) |\n| Deployment | DigitalOcean + PM2 + Nginx + Let's Encrypt |\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- **Node.js 18+**\n- **Python 3** (for code execution)\n- **Go** (for code execution)\n- A [Supabase](https://supabase.com) project (free tier works)\n- A [Google AI Studio](https://aistudio.google.com) API key (optional, for AI review)\n\n### 1. Clone and install\n\n```bash\ngit clone https://github.com/the-mrinal/algoreps.git\ncd algoreps\nnpm install\n```\n\n### 2. Configure environment\n\n```bash\ncp .env.local.example .env.local\n```\n\nFill in your keys:\n\n```env\n# Required\nNEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key\nSUPABASE_SERVICE_ROLE_KEY=your-service-role-key\n\n# Optional -- AI code review\nGEMINI_API_KEY=your-gemini-api-key\n\n# Optional -- Discord notifications\nDISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...\nCRON_SECRET=your-random-secret\n```\n\n### 3. Set up the database\n\nRun the schema file in your Supabase SQL Editor:\n\n```bash\n# Copy the contents of supabase/schema.sql and run it in the\n# Supabase Dashboard → SQL Editor\n```\n\nThis creates:\n- **`profiles`** -- auto-created on signup via database trigger\n- **`problems`** -- problem bank with full metadata\n- **`user_progress`** -- submissions, SRS state, AI reviews\n- Row-Level Security policies for all tables\n\n### 4. Seed the problem bank\n\n```bash\nnpx tsx scripts/seed-problems.ts\n```\n\nThis loads 300+ curated problems from `data/problems.json` into your Supabase instance.\n\n### 5. Start the dev server\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000).\n\n---\n\n## Project Structure\n\n```\nsrc/\n├── app/\n│   ├── page.tsx                     # Landing page\n│   ├── login/                       # Magic link auth\n│   ├── auth/callback/               # OAuth callback handler\n│   ├── dashboard/\n│   │   ├── page.tsx                 # SRS revision queue\n│   │   ├── practice/                # Code editor + problem browser\n│   │   ├── log/                     # Trust mode submission form\n│   │   ├── progress/                # Stats, charts, history\n│   │   └── import/                  # CSV problem import\n│   └── api/\n│       ├── run-code/                # Python 3 / Go code execution\n│       ├── analyze/                 # Gemini AI code review\n│       ├── submissions/             # CRUD for user_progress\n│       ├── problems/                # Problem CRUD\n│       └── cron/                    # Morning \u0026 evening notification jobs\n├── components/                      # UI components organized by feature\n│   ├── srs/                         # RevisionQueue, RevisionCard\n│   ├── practice/                    # EditorPane, ProblemPane, AIReview\n│   ├── progress/                    # StatsOverview, TopicChart, HistoryTable\n│   ├── logger/                      # TrustModeForm\n│   ├── import/                      # SheetImportForm\n│   ├── dashboard/                   # Sidebar, DesktopOnly\n│   └── theme/                       # ThemeProvider, ThemeToggle\n├── lib/\n│   ├── supabase/                    # Browser, server, and admin clients\n│   ├── srs.ts                       # SM-2 variant algorithm\n│   ├── url-parser.ts                # Multi-platform URL parser\n│   ├── ai-review.ts                 # Gemini prompt builder\n│   ├── discord.ts                   # Discord webhook sender\n│   └── problems.ts                  # Problem query helpers\n├── contexts/                        # React contexts (user/premium state)\n└── types/                           # Shared TypeScript interfaces\n\nscripts/                             # Seed, deploy, and cron scripts\ndata/                                # Problem bank JSON + solution templates\nsupabase/                            # Schema SQL + migrations\n```\n\n---\n\n## Database Schema\n\n### `profiles`\nExtends Supabase Auth. Auto-created via trigger on signup.\n\n| Column | Type | Description |\n|--------|------|-------------|\n| `id` | UUID (PK) | References `auth.users` |\n| `email` | text | User email |\n| `display_name` | text | Optional display name |\n| `is_premium` | boolean | Unlocks AI features |\n| `theme_preference` | text | `light`, `dark`, or `system` |\n\n### `user_progress`\nTracks every submission and its SRS state.\n\n| Column | Type | Description |\n|--------|------|-------------|\n| `id` | UUID (PK) | Submission ID |\n| `user_id` | UUID (FK) | References `profiles` |\n| `problem_id` | text | Problem slug |\n| `performance_score` | int | Self-assessed score (1-5) |\n| `next_revision_date` | timestamp | SRS-calculated next review |\n| `code` | text | Submitted solution |\n| `approach` | text | Notes on approach taken |\n| `time_taken_mins` | int | Time spent |\n| `ai_review` | JSONB | Gemini analysis response |\n| `is_self_reported` | boolean | Trust mode flag |\n| `source_url` | text | External problem URL |\n| `topics` | text[] | Topic tags |\n\n### `problems`\nThe problem bank. Publicly readable by authenticated users.\n\n| Column | Type | Description |\n|--------|------|-------------|\n| `id` | UUID (PK) | Problem ID |\n| `title` | text | Problem title |\n| `slug` | text (unique) | URL-safe identifier |\n| `difficulty` | text | Easy / Medium / Hard |\n| `category` | text | Problem category |\n| `sheets` | text[] | Source sheets (neetcode-150, blind-75) |\n| `topics` | text[] | Topic tags |\n| `description` | text | Full problem statement |\n| `examples` | JSONB[] | Input/output examples |\n| `code_snippets` | JSONB | Language-keyed code stubs |\n\nAll tables are protected by **Row-Level Security** -- users can only access their own data.\n\n---\n\n## API Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/run-code` | Execute Python 3 / Go code with stdin |\n| `POST` | `/api/analyze` | AI code review (premium) |\n| `POST` | `/api/submissions` | Create a submission |\n| `PATCH` | `/api/submissions` | Update score / AI review |\n| `GET` | `/api/problems` | Fetch problems (with filters) |\n| `POST` | `/api/import-problems` | Bulk CSV import |\n| `DELETE` | `/api/user-data` | Clear all user submissions |\n| `GET` | `/api/cron/morning` | Trigger morning briefing |\n| `GET` | `/api/cron/evening` | Trigger evening wrap-up |\n\nCron endpoints are protected by a `CRON_SECRET` header.\n\n---\n\n## Deployment\n\nSee [DEPLOYMENT.md](./DEPLOYMENT.md) for full production setup instructions covering:\n- DigitalOcean droplet provisioning\n- PM2 process management\n- Nginx reverse proxy configuration\n- Let's Encrypt SSL certificates\n- Crontab setup for notifications\n\n---\n\n## Scripts\n\n```bash\nnpm run dev                          # Start dev server (port 3000)\nnpm run build                        # Production build\nnpm start                            # Start production server\nnpm run lint                         # Run ESLint\nnpx tsx scripts/seed-problems.ts     # Seed problem bank into Supabase\nnpx tsx scripts/merge-problems.ts    # Rebuild problem bank from sources\n```\n\n---\n\n## Contributing\n\nContributions are welcome! Here's how to get started:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feat/your-feature`)\n3. Make your changes\n4. Run lint checks (`npm run lint`)\n5. Commit your changes (`git commit -m 'feat: add your feature'`)\n6. Push to your branch (`git push origin feat/your-feature`)\n7. Open a Pull Request\n\nPlease follow the existing code style and conventions.\n\n---\n\n## Roadmap\n\n- [ ] Multi-language support (Java, C++, JavaScript)\n- [ ] Collaborative problem sets\n- [ ] Streak calendar visualization\n- [ ] Mobile app \n- [ ] Custom SRS intervals\n- [ ] Public problem set sharing\n\n---\n\n## License\n\nThis project is licensed under the MIT License -- see the [LICENSE](./LICENSE) file for details.\n\n---\n\n## Acknowledgments\n\n- Problem bank sourced from [NeetCode](https://neetcode.io) and [Blind 75](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU)\n- Spaced repetition algorithm based on [SM-2](https://www.supermemo.com/en/archives1990-2015/english/ol/sm2)\n- Built with [Next.js](https://nextjs.org), [Supabase](https://supabase.com), and [Monaco Editor](https://microsoft.github.io/monaco-editor/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-mrinal%2Falgoreps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-mrinal%2Falgoreps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-mrinal%2Falgoreps/lists"}