Student starter code (30% baseline)
index.html
- Main HTML pagescript.js
- JavaScript logicstyles.css
- Styling and layoutpackage.json
- Dependenciessetup.sh
- Setup scriptREADME.md
- Instructions (below)💡 Download the ZIP, extract it, and follow the instructions below to get started!
This StackBlitz template demonstrates various real-time data update mechanisms including polling, WebSockets, and Server-Sent Events.
activity-10-polling/
├── index.html # Main demo interface
├── polling-manager.js # Universal polling system
├── dashboard.js # Dashboard controls and notifications
├── data-sources.js # API data fetchers
├── visualizer.js # Live data visualization
├── real-time-demos.js # WebSocket and SSE demos
├── app.js # Main application logic
├── package.json # Dependencies and scripts
└── README.md # This file
After completing this activity, you'll understand:
Track your polling performance with:
{
'iss': { defaultInterval: 10000, adaptiveRange: [5000, 30000] },
'crypto': { defaultInterval: 15000, adaptiveRange: [5000, 60000] },
'pokemon': { defaultInterval: 30000, adaptiveRange: [10000, 60000] }
}
Technology | Latency | Bandwidth | Complexity | Use Case |
---|---|---|---|---|
Polling | High (7.5s avg) | Medium | Low | Simple updates |
Long Polling | Medium (2s) | Low | Medium | Moderate real-time |
WebSockets | Low (50ms) | Low | High | Full real-time |
Server-Sent Events | Low (100ms) | Low | Medium | Server push |
By the end of this activity, you'll have hands-on experience with:
Ready to explore the exciting world of real-time web applications? Start by clicking one of the demo buttons above! 🚀