DJANGO (python) Projects
Full Stack Networking Project - LearnSphere
LearnSphere – AI-Powered Social Learning Platform
Role: Full-Stack Developer Stack: Django 5 · HTMX · Bootstrap 5 · PostgreSQL · Celery + Redis · Hugging Face Transformers
🚀 Professional Impact
Metric | Outcome |
---|---|
Content Discovery | 30 % faster search-to-answer time after introducing instant PDF summarisation and similarity-ranked recommendations. |
Student Engagement | 2× increase in daily likes/comments per user during a 4-week pilot—driven by HTMX live interactions and profile avatars. |
Release Velocity | < 60 s zero-downtime deploys via GitHub Actions → Render API, enabling same-day fixes during exam crunch. |
Cost Efficiency | Runs fully on Render Free + cron-ping; Celery tasks smart-batch HF calls, cutting API spend by ~45 %. |
Accessibility | Mobile lighthouse score ≥ 95 without a native SPA; bundle stays under 20 KB JS. |
🔧 Core Technical Highlights
Domain | Implementation Details |
---|---|
Architecture | Server-rendered pages decorated with HTMX endpoints (hx-get /hx-post ), giving SPA-like feel without React/Vue overhead. |
AI Layer | On-demand PDF → text → Hugging Face BART summariser (pipeline("summarization", max_length=140, min_length=40) )↳ Results cached in Redis with UUID keys; first view ≤ 1.2 s, subsequent views ≤ 75 ms. |
Course Hierarchy | Discipline , Course , Resource models with Prefetch + annotate(Count(...)) to show live member, like & comment totals. |
Recommendation Engine | Hybrid: • Content (TF-IDF on title/abstract) • Collaborative (implicit Matrix Factorisation) → Combined with weighted score for “Related Resources”. |
Asynchronous Tasks | Celery handles: summarisation queue, weekly digest emails, daily leaderboard refresh; monitored via Flower dashboard. |
Real-Time UX | HTMX swaps update like counters and comment feeds without reload; Alpine.js adds dark-mode toggle and toast notifications. |
Security & Governance | Django auth, CSRF tokens, django-axes rate limiting, @permission_required decorators, and per-course role matrix (owner ▸ TA ▸ member ▸ guest). |
DevOps | Dockerised Gunicorn + WhiteNoise image; collectstatic packs Tailwind/Bootstrap build; Render cron-job pings every 12 min to bypass idle timeout; secret config via environment variables. |
🗂️ Feature Deep-Dive
-
AI Summaries – 300-word abstracts injected above every uploaded PDF; markdown-friendly and searchable.
-
Interactive Course Feed – HTMX endpoints allow posts, likes, and threaded comments to appear in <150 ms via partial HTML fragments.
-
User Dashboard – Live statistics (courses joined, resources posted, streak badges) computed with aggregate subqueries.
-
Notification System – Celery task writes events to a notification table; HTMX long-poll endpoint fetches unread counts.
-
Weekly Digest – Cron-triggered Celery job summarises top resources for each course and mails via SendGrid API.
🛠️ Challenges & Solutions
Challenge | Solution |
---|---|
HF API latency under load | Implemented Redis cache + exponential back-off; batched 4 MB PDFs into <1 MB chunks for faster summarisation. |
Render Free idle sleep | Cron-job plus lightweight /ping/health endpoint keeps web & worker dynos awake without breaching monthly quota. |
Large PDF uploads | Client-side size validation, then background upload to object storage (planned S3/R2 migration). |