Skip to content

HarshTanwar1/QuestionOverflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 QuestionOverflow

Search Stack Overflow without leaving your browser tab.

A lightweight Django web app that turns any plain-English question into the most relevant Stack Overflow results — complete with smart caching and abuse protection baked in.


Python Django SQLite Stack Exchange API


✨ Overview

QuestionOverflow lets you type a question, hit search, and instantly browse the top matching Stack Overflow posts as clickable links. Under the hood it talks to the Stack Exchange API, caches results to stay fast, and throttles requests per IP to play nicely with API limits — the kind of production-minded details that separate a toy project from a real one.


🚀 Features

Feature Description
🔎 Live Stack Overflow search Query the Stack Exchange API and get the 10 most relevant questions, sorted by recent activity.
🔗 Clickable results Every result links straight to the original Stack Overflow post.
📄 Pagination Browse up to 25 pages of results with Previous / Next navigation.
Response caching Search pages are cached for 10 minutes — fewer API calls, faster repeat searches.
🛡️ Rate limiting Throttled to 5 requests/min and 100 requests/day per IP to prevent abuse.
🔧 Admin panel Standard Django admin available at /admin/.

🛠️ Tech Stack

Layer Technology
Language Python 3.10.10
Framework Django 4.1.6
HTTP Client requests
Rate Limiting django-ratelimit
External API Stack Exchange API v2.3 (search/advanced)
Database SQLite
Caching Django LocMemCache
Frontend HTML + Django Templates

⚙️ Getting Started

# 1. Clone the repository
git clone https://github.com/HarshTanwar1/QuestionOverflow.git
cd QuestionOverflow

# 2. (Recommended) Create and activate a virtual environment
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate

# 3. Install dependencies
pip install django==4.1.6 requests django-ratelimit

# 4. Apply database migrations
python manage.py migrate

# 5. Start the development server
python manage.py runserver

Then open http://127.0.0.1:8000/ in your browser, type a question, and search away! 🎉


📚 What I Learned

  • 🌐 Consuming a third-party REST API from a Django view with requests — building query payloads and parsing JSON responses.
  • 🛡️ Request throttling using django-ratelimit decorators with IP-based keys across multiple time windows (per-minute and per-day).
  • View caching via Django's cache_page decorator and a configured cache backend.
  • 🧩 Template rendering — passing dynamic context (titles, links, pagination state) into Django templates.
  • 🔀 URL routing with path converters (<int:no>) to drive pagination through the URL.

🔮 Roadmap & Improvements

  • 🚢 Production readinessDEBUG = False, configured ALLOWED_HOSTS, PostgreSQL + Redis/Memcached.
  • 🧯 Robust error handling — gracefully handle API failures, timeouts, empty results, and HTTP 429 responses.
  • 🏷️ Richer results — show tags, scores, answer counts, and "is answered" status, not just titles.
  • 🎨 Improved UI/UX — add styling (Bootstrap/Tailwind), loading states, and a friendly "no results" message.
  • 🔑 API key support — register a Stack Exchange key to raise the request quota and surface remaining quota.


⭐ If you found this project useful, consider giving it a star!

About

A Django web app to search Stack Overflow questions via the Stack Exchange API, with response caching and per-IP rate limiting

Topics

Resources

Stars

Watchers

Forks

Contributors