Skip to content

vking1996/450-dsa

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

392 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

450 DSA Tracker

🌐 Live Demo: https://450-ds.vercel.app

Track your progress through Love Babbar's 450 DSA problems β€” with platform sync, leaderboard, and more.

Open For PR Python Flask MongoDB


What is this?

A full-stack Flask web app to help you track, manage, and share your DSA journey. Originally a React + LocalBase project, it's been completely rewritten in Python with MongoDB as the database.


Features

  • Topic-wise tracking β€” browse all 24 DSA topics and mark questions done
  • Bookmarks β€” save questions for quick review
  • Notes β€” write and save personal notes per question
  • Search β€” full-text search with topic, difficulty, platform, and status filters
  • OAuth login β€” sign in with GitHub or Google, or register with email/password
  • Platform sync β€” connect LeetCode, GFG, GitHub, HackerRank, Coding Ninjas and pull your stats
  • Profile dashboard β€” activity heatmap, rating chart, difficulty breakdown, badges
  • Leaderboard β€” ranked by C-Score (composite score across all platforms)
  • Public profiles β€” shareable profile cards
  • Admin panel β€” manage users and content
  • Export notes β€” download your notes as Markdown
  • Docker support β€” run the whole app with one command

Quick Start

Option 1 β€” Local setup

1. Clone and set up environment

git clone https://github.com/mohitkumhar/450-dsa.git
cd 450-dsa
python -m venv venv

# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate

pip install -r requirements.txt

# For development, linting, and tests
pip install -r requirements-dev.txt

2. Configure environment variables

cp .env.example .env   # macOS/Linux
copy .env.example .env  # Windows

Edit .env and fill in your values:

# REQUIRED - generate your own first:
# python -c "import secrets; print(secrets.token_hex(32))"
SECRET_KEY=replace-this-with-a-real-secret

# MongoDB β€” use Atlas (free) or local
MONGO_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/dsa_tracker

# GitHub OAuth (optional)
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret

# Google OAuth (optional)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Cloudinary β€” for profile photo uploads (optional)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret

The app warns and generates a temporary SECRET_KEY if the variable is missing or still set to an insecure placeholder. Set a real generated secret in deployed environments so user sessions persist across restarts. If a secret was ever committed or shared, rotate it before running the app again.

3. Run

python run.py

Open http://localhost:5000 in your browser. The app seeds all 450+ questions from data.json on first run.


Option 2 β€” Docker

git clone https://github.com/mohitkumhar/450-dsa.git
cd 450-dsa
docker compose up

Open http://localhost:5000.


Project Structure

450-dsa/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ __init__.py          # App factory
β”‚   β”œβ”€β”€ extensions.py        # Shared Flask extensions (db, bcrypt, limiter...)
β”‚   β”œβ”€β”€ utils.py             # Helpers, search logic, leaderboard scoring
β”‚   β”œβ”€β”€ auth/                # Login, register, OAuth (GitHub, Google)
β”‚   β”œβ”€β”€ tracker/             # Topics, questions, bookmarks, notes
β”‚   β”œβ”€β”€ profile/             # Profile page, platform sync, photo upload
β”‚   β”œβ”€β”€ search/              # Search API with filters
β”‚   β”œβ”€β”€ leaderboard/         # Leaderboard routes and API
β”‚   β”œβ”€β”€ admin/               # Admin dashboard
β”‚   β”œβ”€β”€ public/              # Public profile pages
β”‚   β”œβ”€β”€ faq/                 # FAQ page
β”‚   └── platforms/
β”‚       └── fetchers.py      # LeetCode, GFG, GitHub, HackerRank, Coding Ninjas fetchers
β”œβ”€β”€ templates/               # Jinja2 HTML templates
β”œβ”€β”€ static/                  # CSS and JS assets
β”œβ”€β”€ tests/                   # Pytest test suite
β”œβ”€β”€ data.json                # All 450+ DSA questions
β”œβ”€β”€ run.py                   # App entry point
β”œβ”€β”€ requirements.txt         # Python dependencies
β”œβ”€β”€ requirements-dev.txt     # Dev/test dependencies
β”œβ”€β”€ .env.example             # Environment variable template
β”œβ”€β”€ Dockerfile
└── docker-compose.yml

Database

The app uses MongoDB (via Flask-PyMongo). There is no SQLite or SQLAlchemy β€” those were part of an earlier version.

Collections:

  • user β€” user accounts, progress, platform usernames, external stats
  • topic β€” DSA topic names and ordering
  • question β€” all 450+ problems with URLs

MongoDB is accessed through app.extensions.db (a LocalProxy to mongo.db). All indexes are created on startup in app/__init__.py.

You can use MongoDB Atlas (free M0 tier) or a local MongoDB instance.


API Endpoints

Method Endpoint Description
GET / Dashboard β€” all topics with progress
GET /topic/<id> Questions for a topic
GET /search Search page
GET /bookmarks Saved bookmarks
GET /profile User profile dashboard
GET /leaderboard Global leaderboard
GET /u/<user_id> Public profile
GET /api/search_questions Search API (supports q, topic_id, difficulty, platform, status, limit)
GET /api/leaderboard Leaderboard API (supports mode: cscore, questions, rating, college)
POST /update_question/<id> Update done/bookmark/notes for a question
POST /sync_platforms Sync external platform stats
POST /edit_profile Update profile fields
POST /upload_photo Upload profile photo
POST /delete_account Permanently delete account (GDPR)
GET /search_universities University autocomplete

Tech Stack

Layer Technology
Backend Flask 2.3
Database MongoDB (Flask-PyMongo)
Auth Flask-Login, Flask-Bcrypt, Authlib (OAuth)
Rate limiting Flask-Limiter
Frontend Jinja2, Bootstrap Icons, Chart.js
Photo storage Cloudinary
Testing Pytest
Deployment Docker, Vercel

Running Tests

pip install -r requirements-dev.txt
pytest

Environment Variables Reference

Variable Required Description
SECRET_KEY Recommended Flask session secret. Must be a real generated secret, not a placeholder. Missing or insecure values fall back to a temporary key and reset sessions on restart.
MONGO_URI Yes MongoDB connection string
GITHUB_CLIENT_ID No GitHub OAuth app client ID
GITHUB_CLIENT_SECRET No GitHub OAuth app client secret
GOOGLE_CLIENT_ID No Google OAuth client ID
GOOGLE_CLIENT_SECRET No Google OAuth client secret
CLOUDINARY_CLOUD_NAME No Cloudinary cloud name for photo uploads
CLOUDINARY_API_KEY No Cloudinary API key
CLOUDINARY_API_SECRET No Cloudinary API secret

Credits


Contributing

PRs are welcome! Please read CONTRIBUTING.md before opening one.

GSSoC Flask Redis Caching Guide

  • Enable Redis cache invalidation on list updates.

About

Repository with 450+ DSA problems covering all major patterns like arrays, DP, graphs, trees, and more. Includes clean, optimized solutions focused on pattern-based learning for coding interviews and problem-solving.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 60.2%
  • HTML 30.4%
  • CSS 7.5%
  • JavaScript 1.8%
  • Dockerfile 0.1%