Solution report blog — Bodhi bytes

In a world obsessed with the newest “push” technologies, Team Bodhi Bytes took a different path for the AIORI-2 Hackathon. Tasked with PS-11 (QR-to-Database Real-Time Interaction), we prioritized reliability and architectural pragmatism. Our project proves that you don’t always need complex, stateful WebSockets to create a “real-time” experience; sometimes, the most robust solution is a perfectly tuned HTTP Polling engine.

1. The Core Interaction: The Physical-to-Digital Bridge

The system solves a classic problem: how do you make a static webpage react instantly when someone scans a physical object across the room? Our solution uses the ISO/IEC 18004 (QR Code) standard as the trigger and a Django/DRF backbone as the brain.

The User Journey:

  1. Host Side: Generates a unique QR code via the /generate_qr/ portal.
  2. Attendee Side: Scans the code. Their mobile browser hits a unique URL that updates a MySQL record from pending to completed.
  3. Dashboard Side: Using a 3-second AJAX Polling loop, the dashboard “sees” the database change and injects the new data into the UI—no refresh required.

2. Architecture: Why We Chose Polling over Push

While the hackathon prompt mentioned RFC 6455 (WebSockets), our team conducted a risk-benefit analysis. WebSockets require stateful servers (ASGI), message brokers (Redis), and complex connection management.

Instead, we validated the power of RFC 9110 (HTTP Semantics). By using standard GET requests on a 3-second interval, we achieved:

  • Horizontal Scalability: Our app can run on any standard web server (Gunicorn/NGINX).
  • Stateless Reliability: If a connection drops, the next poll simply picks up where it left off.
  • Reduced Complexity: We traded a 2-second “latency” for a system that is 10x easier to maintain and audit.

3. Technology Stack & Standards Mapping

We built a modern, 3-tier application where every layer adheres to international standards:

Layer Technology Standard
Data Interchange JSON RFC 8259
Transport HTTP/1.1 RFC 9110
API Architecture Django REST Framework REST Principles
Physical Trigger QR Code ISO/IEC 18004

4. Implementation: The AJAX Heartbeat

The “magic” of the real-time update happens in a simple, elegant JavaScript loop. By using the modern fetch() API, we query our DRF endpoint and perform a client-side “diff” to see if new scan events have arrived.

JavaScript

// The heartbeat of the system

setInterval(async () => {

const response = await fetch(‘/api/data/’);

const data = await response.json();

updateDashboardUI(data); // Injects new rows into the table

}, 3000);

 

This ensures the “Live Feed” feel without the overhead of a persistent socket.

5. Lessons Learned & The Road Ahead

Our sprint methodology taught us that “Real-Time” is a spectrum, not a binary. For event check-ins and attendance, a 3-second poll is functionally identical to a sub-second socket push, but significantly more stable.

Future RFC Alignment:

  • Security (RFC 7519): Our next sprint involves securing the scan-capture endpoint with JWT (JSON Web Tokens) to ensure that every check-in is a verifiable credential.
  • Efficiency: We plan to explore HTTP Long-Polling, a middle-ground that reduces empty requests while staying within the stateless RFC 9110 model.

Read the full report

Author

Facebook
Twitter
LinkedIn
WhatsApp

Search

Authors List

Authors

  • Advanced Internet Operations Research in India

    View all posts
  • I’m a tech entrepreneur and researcher who thrives on pushing boundaries and finding innovative solutions in the ever-evolving digital landscape. Currently, I’m deeply immersed in the fascinating realm of Internet resiliency, harnessing my expertise to ensure a robust and secure online space for all. 🚀

    View all posts
  • admin
  • I am a researcher working on security, networks, protocols and DNS. I am a quantum computing enthusiast, a fan of Linux and an advocate for Free & Open Source Softwares. #FOSS

    View all posts
  • A Information Technology Practitioner with leadership experience in IT Public Policy, Corporate Industry Forums, Information Technology Standards, & Program Implementation. An experienced Information Technology trainer, keynote speaker, panelist, leader and key influencer for advocacy and outreach, with wide international exposure across stakeholder groups. Finance Degree from ICAI & ICWAI, India; IT Security Degree from ISACA, USA & Internet Governance Certification from University of Aarhus, Germany & Next Generation Leaders Program of Internet Society in association with DIPLO Foundation.

    View all posts
  • Aindri Mukherjee
  • Debayan Mukherjee

Tag Cloud

Newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *