Behind the Scenes of ParrotEdu: Real-Time Learning Dashboards with Django 5.2.4

By hientd, at: July 5, 2025, 11:35 a.m.

Estimated Reading Time: __READING_TIME__ minutes

Behind the Scenes of ParrotEdu: Real-Time Learning Dashboards with Django 5.2.4
Behind the Scenes of ParrotEdu: Real-Time Learning Dashboards with Django 5.2.4

At Glinteco, we’re building ParrotEdu, an AI-powered English learning platform designed for K-12 students. One of the most exciting and challenging features of this platform is the real-time learning dashboard for both students and teachers.

 

As students interact with exercises, the system tracks performance, learning materials, streaks, and more. The dashboard must instantly reflect changes, showing live feedback and analytics, all while handling thousands of concurrent users.

 

Sounds simple? It’s not. But here’s how we solved it using Django 5.2.4, Redis, Celery, and Django Channels.

 

The Challenge

 

We needed to build a backend that could:

 

  • Handle student exercise submissions instantly.
     

  • Process large volumes of learning data without delay.
     

  • Update dashboards in real time without hammering the database.
     

  • Scale across multiple classrooms and schools.

 

While Django is powerful, getting it to perform real-time tasks at scale takes more than just Model.objects.all().

 

Our Architecture at a Glance

 

Component Role
Django 5.2.4 Core backend (now with async support)
Django Channels Real-time WebSocket support
Redis Cache + Pub/Sub + leaderboard storage
Celery Background task queue for heavy processing
PostgreSQL Primary database with smart indexing and views

 

How We Solved Speed & Real-Time Issues in ParrotEdu

 

1. Async Views in Django 5.2.4

 

Django 5.2’s native async def support gave us a big performance boost on I/O-heavy endpoints.

 

from django.http import JsonResponse
from asgiref.sync import sync_to_async

async def get_user_progress(request):
    data = await sync_to_async(fetch_progress)(request.user.id)
    return JsonResponse(data)

 

We used sync_to_async() to bridge between legacy ORM and async views.

 

2. Real-Time Updates via WebSockets

 

With Django Channels, we were able to:

 

  • Push progress updates as students completed exercises.
     

  • Send live leaderboard updates to all students in a class.
     

  • Show teachers when students are actively working.

 

# Send live leaderboard update
async def send_leaderboard(class_id, data):
    await get_channel_layer().group_send(
        f"class_{class_id}",
        {"type": "leaderboard.update", "data": data}
    )

 

Redis was used as the channel layer to support multiple worker processes.

 

3. Celery for Heavy Processing

 

We quickly realized that calculating:

 

  • streaks
     

  • XP points
     

  • progress badges
     

  • and leaderboard rankings

 

…in real time would block views and slow down the API. So we offloaded everything heavy to Celery tasks:

 

@shared_task
def update_metrics(user_id, exercise_id):
    # Update XP, streaks, badges
    ...

 

This allowed us to respond instantly to users while handling logic behind the scenes.

 

ParrotEdu Student Dashboard

 

4. Redis for Instant Caching

 

We cache all frequently-read data (like progress bars and leaderboards) in Redis with a TTL.

 

cache.set(f"user:{user_id}:xp", 2500, timeout=300)

 

When a Celery task updates the XP or streak, it writes directly to Redis, and a WebSocket broadcast triggers a frontend refresh.

 

This keeps reads blazing fast without hitting the database every time.

 

5. Smart PostgreSQL Usage

 

Our exercise_attempts table grows quickly. To keep queries fast:

 

  • We use select_related() and prefetch_related() to avoid N+1 queries.
     

  • We created materialized views for teacher dashboards (like average scores over time).
     

  • We added GIN indexes on JSON fields for flexible metadata searching.

 

ParrotEdu Teacher Dashboard

 

Live Result Flow in ParrotEdu

 

  1. Student completes exercise
     

  2. Result saved → Celery task fires
     

  3. Redis cache is updated
     

  4. WebSocket pushes live update to dashboard
     

  5. PostgreSQL batch jobs update long-term aggregates (every few minutes)

 

 Lessons Learned

 

  • Django 5.2’s async capabilities are a game-changer.
     

  • Celery is your best friend when things start getting heavy.
     

  • WebSockets make the user experience feel magical.
     

  • Redis is indispensable when building truly responsive UIs.
     

  • Performance isn’t about doing things faster (50% faster) it’s about doing less at runtime.

 

What We’re Building Next

 

For future versions of ParrotEdu, we’re exploring:

 

  • Using SSE (Server-Sent Events) for ultra-lightweight streaming
     

  • AI-powered insights processed in batch via Celery
     

  • A GraphQL API layer for more flexibility in dashboard queries

 

Final Thoughts

 

Building ParrotEdu has challenged our team to push Django to its limits and it delivered.

 

If you’re working on a high-performance educational platform, or building a real-time dashboard for any use case, this architecture can give you the best of both worlds: developer speed and production-grade performance.

 

👉 Need help with real-time Django apps? Let’s talk at Glinteco.com

 

Tag list:

Subscribe

Subscribe to our newsletter and never miss out lastest news.