cd Backend
npm startโ Should see: "Server running on port 3000"
Dashboard: http://localhost:3000/dashboard-live.html
Player: http://localhost:3000/videoplayer-live.html
# Check if backend is responding
curl http://localhost:3000/api/progress/user-stats?userId=1
# Should return JSON with xp_total, level, etc.| File | Purpose | Lines |
|---|---|---|
Backend/routes/progress.js |
5 new API endpoints | +150 |
Frontend/js/sync-manager.js |
Core sync logic | 172 |
Frontend/videoplayer-live.html |
Enhanced player | 550+ |
Frontend/dashboard-live.html |
Live dashboard | 450+ |
| Docs | Setup guides | 2000+ |
Total: ~1,300 lines of new code
โ
Auto-Resume Watch video โ Save position โ Resume later
โ
Live XP +25 XP instantly shown when video completes
โ
Continue Watching Dashboard shows incomplete videos
โ
Auto-Save Every 5 seconds to localStorage + backend
โ
Offline Support Works without internet (localStorage backup)
โ
Live Dashboard Polls every 10s, updates without refresh
โ
No Setup Uses existing database, no migrations
User watches video (30 sec)
โ
Auto-saves: localStorage + backend (every 5s)
โ
User closes player
โ
Dashboard loads โ Shows "Continue Watching"
โ
User clicks Resume
โ
Video jumps to 30-second mark โ
โ
User finishes video
โ
+25 XP awarded โ Dashboard updates live โ
# Save watch progress (called automatically every 5s)
POST /api/progress/save-watch-time
{videoId, userId, watchSeconds}
# Mark video complete & award XP
POST /api/progress/video-complete
{videoId, userId, watchSeconds}
# Get user's continue watching list
GET /api/progress/continue-watching?userId=1
# Get user's stats (XP, videos, level)
GET /api/progress/user-stats?userId=1
# Get specific video progress
GET /api/progress/video-progress?videoId=x&userId=1user_video_progress
โโ watch_seconds (auto-updated every 5s)
โโ completed (0=unfinished, 1=done)
โโ xp_awarded (25 per video)
user_profiles
โโ xp_total (incremented on video complete)
โโ level (calculated from XP)
โโ streak_days- Go to
dashboard-live.html - Click "Resume" on video in "Continue Watching"
- Video plays from saved position
- Complete video โ See +25 XP
- Dashboard updates automatically (no refresh!)
// Create sync manager
const sync = new SyncManager({userId: 1});
// Load data
await sync.loadUserStats();
await sync.loadContinueWatching();
// Auto-called during playback
sync.saveWatchProgress(videoId, currentTime);
// On video end
sync.markVideoComplete(videoId, watchedSeconds);// Backend/routes/progress.js, line 5:
const XP_PER_VIDEO = 25; // โ Change this// videoplayer-live.html, line ~280:
}, 5000); // โ 5000ms = 5 seconds// dashboard-live.html, line ~200:
setInterval(loadDashboardData, 10000); // โ milliseconds| Problem | Solution |
|---|---|
| Video doesn't resume | Check localStorage in console; restart backend |
| XP not updating | Hard refresh: Ctrl+Shift+R; check npm logs |
| Page blank | Check console for errors (F12); start backend |
| "Continue Watching" empty | Watch video 30+ sec, close, refresh |
# 1. Start backend
cd Backend && npm start
# 2. Open dashboard
http://localhost:3000/dashboard-live.html
# 3. Open video player (new tab)
http://localhost:3000/videoplayer-live.html
# 4. Watch video for 30 seconds
# 5. Close player, go to dashboard
# 6. See "Continue Watching" section?
YES โ
System works!
NO โ Check console errorsQUICK_START_LIVE_TRACKING.md
โโ 2-minute setup guide
โโ Basic troubleshooting
LIVE_TRACKING_SETUP.md
โโ Detailed technical guide
โโ All endpoint specs
โโ Advanced customization
TECHNICAL_SUMMARY.md
โโ Architecture & design decisions
โโ Performance benchmarks
โโ Security considerations
VISUAL_REFERENCE.md
โโ System flow diagrams
โโ Data storage strategy
โโ Component communication
VERIFICATION_CHECKLIST.md
โโ Step-by-step testing
โโ API testing examples
โโ Troubleshooting tree
Browser
โ
videoplayer-live.html (plays video)
โ
sync-manager.js (auto-save every 5s)
โโ localStorage (instant)
โโ backend API (async)
โ
Backend/routes/progress.js
โ
MySQL Database
โ
dashboard-live.html (polls every 10s)
โ
Shows live updates WITHOUT refresh โจ
/Backend/routes/progress.js โ Enhanced endpoints
/Frontend/js/sync-manager.js โ Core logic (NEW)
/Frontend/videoplayer-live.html โ Player (NEW)
/Frontend/dashboard-live.html โ Dashboard (NEW)
Old files still work:
/Frontend/videoplayer.html โ Original (unchanged)
/Frontend/dashboard.html โ Original (unchanged)
| Error | Cause | Fix |
|---|---|---|
Cannot fetch/api/progress... |
Backend not running | npm start |
localStorage undefined |
Browser security | Use HTTPS or localhost |
Cannot read property 'classList' |
HTML element missing | Check element IDs match |
xp_total isn't a number |
Database error | Run setup-db.js |
SQLException |
Table doesn't exist | Run setup-db.js |
{
videoId: "video_oops_001",
userId: 1,
watchSeconds: 450,
lastSaved: "2026-04-08T15:30:00Z"
}{
profile: {
xp_total: 75,
level: 1,
streak_days: 3
},
stats: {
total_videos: 5,
completed_videos: 3,
total_xp_earned: 75
}
}- Backend starts without errors
- Dashboard page loads
- Video player page loads
- Can play video for 30+ seconds
- Dashboard shows "Continue Watching" after closing
- Resume works (video jumps to saved position)
- Completing video shows celebration + XP
- Dashboard updates live (no manual refresh)
All checked? โ Ready for hackathon! ๐
# Backend
npm start # Start server
# Database
mysql -u root acadly_db # Connect to DB
node Backend/setup-db.js # Initialize DB
# Testing
curl http://localhost:3000/api/progress/user-stats?userId=1
# Browser Dev Tools (F12)
localStorage.getItem('acadly_video_1_video_oops_001')
Object.keys(localStorage).filter(k => k.includes('acadly'))- Get it working (this checklist)
- Understand it (read TECHNICAL_SUMMARY.md)
- Customize it (adjust XP, intervals, etc.)
- Extend it (add quizzes, badges, leaderboard)
- Deploy it (production security setup)
One command to test everything:
cd Backend && npm start &
open http://localhost:3000/dashboard-live.html
open http://localhost:3000/videoplayer-live.html
# Watch video โ Close โ Refresh dashboard โ See "Continue Watching" โ
"We built a fully dynamic video learning platform that:
โ
Auto-saves where you left off (resume feature)
โ
Tracks XP in real-time
โ
Shows live dashboard with no page refreshes
โ
Works offline with localStorage
โ
Syncs to database automatically
Built with: Node.js backend + Vanilla JS frontend + MySQL
No complex frameworks needed!
All done in ~1,300 lines of clean, documented code."
๐ฏ Ready? Open your browser and test it now!
http://localhost:3000/dashboard-live.html
Questions? Check TECHNICAL_SUMMARY.md or VERIFICATION_CHECKLIST.md
Version 1.0 | April 8, 2026 | Acadly Live Tracking System