Overview
Platzi Viewer includes a comprehensive progress tracking system that monitors your learning journey, saves your progress locally, and syncs it to the server for backup and cross-device access.How Progress Works
Progress States
Each class in every course can have one of three states:- Not Started - Default state for all classes
- In Progress - Video has been played but not completed
- Complete - Class has been marked as finished
Class Keys
Progress is tracked using unique class identifiers:Automatic Progress Tracking
Video Playback Tracking
In Progress Marking: When you start playing a video, it’s automatically marked as “in progress”:- Video
playevent fires - Current playback time is recorded
- Timestamp is saved
Auto-Complete on Finish
Classes are automatically marked complete when:- Video plays to the end (
endedevent) - Progress is saved with completion timestamp
- Next class auto-advances after 1.5 seconds
Manual Progress Management
Mark Complete Button
Manually mark a class as complete:- Open any class in the player
- Click Completada button below the video
- Button updates to show checkmark: ✅ Completada
- Sidebar updates to reflect completion
- Mark non-video content (readings, HTML) as complete
- Skip videos you’ve already watched elsewhere
- Track progress through text-based lessons
Progress Indicators
Course View:- Module headers show progress: “5/12 clases”
- Progress bars show percentage completion
- Class numbers change to checkmarks (✓) when complete
- Active class shows play icon (▶)
- Complete classes show checkmark (✓)
- Not started classes show class number
- Progress rings display completion percentage
- “X% completado” text shows exact progress
- Completed/remaining class counts
Local Storage (Browser)
localStorage Implementation
Progress is saved in your browser’slocalStorage:
Storage Key: platzi_progress
Data Structure:
Advantages of localStorage
✅ Instant Access - No network latency ✅ Offline Support - Works without server connection ✅ Privacy - Data stays on your device ✅ Fast Updates - No API calls neededlocalStorage Limitations
⚠️ Browser-Specific - Not shared across different browsers ⚠️ Device-Specific - Not shared across different devices ⚠️ Can Be Cleared - Browser cache clearing removes progress ⚠️ Storage Limit - Typically 5-10MB per originServer Synchronization
Automatic Sync
Progress syncs to the server automatically: Sync Triggers:- Any progress change (complete, in-progress)
- Debounced to 400ms to batch updates
- Saves to
/api/progressendpoint
- Saves to
progress.jsonfile on server - Acts as backup and cross-device sync
- Survives browser cache clearing
Sync Strategy
Queue-Based Syncing:- Batches rapid changes (e.g., marking multiple classes complete)
- Reduces server load
- Prevents race conditions
Server Progress Backup
Server-sideprogress.json format:
Progress Merging
Conflict Resolution
When local and server progress conflict, the system uses intelligent merging: Merge Priority:- Status Rank:
complete>in_progress>not_started - Timestamp: Newer timestamp wins if status is equal
Initialization Merge
On app load, progress merges automatically:Progress Calculation
Course Progress
Calculated by counting completed classes:- Courses with detailed class arrays
- Courses with only class counts (bootstrap mode)
- Empty courses (0% progress)
Route Progress
Aggregates progress across all courses in a route:Overall Progress
Global statistics across all content:Progress Views
Course Detail Page
Progress Ring:- Large circular progress indicator
- Percentage displayed in center
- Completion stats below
- Ring turns green when 100% complete
- Mini progress bars on each module header
- “X/Y” class count
- Checkmark (✅) on module number when 100% complete
Learning View
In-Progress Courses:Player Sidebar
Visual Indicators:- Active:
▶ Class Name - Complete:
✓ Class Name(styled with completion color) - Not Started:
1 Class Name(number badge)
Notes and Personal Tracking
Course Notes
Each course has a personal notes section: Features:- Large textarea for notes, code snippets, ideas
- Auto-saves to localStorage on input
- Persists per course (unique storage key)
- Supports markdown-style text
- Take notes during video lessons
- Save code snippets for reference
- Track personal insights
- Create quick reference guides
API Endpoints
Get Progress
Save Progress
200 OK or error with code
Cross-Device Progress
Syncing Across Devices
To sync progress across multiple devices:- Same Server Required: All devices must connect to the same server
- Automatic Sync: Progress syncs on each change
- Merge on Load: Opening the app merges server progress
- No Manual Sync Needed: Everything is automatic
Progress Persistence
Survives:- Browser restarts
- Server restarts (saved to
progress.json) - Network interruptions (localStorage backup)
- Browser cache/data clearing (unless synced to server)
- Changing to different server
- Deleting
progress.jsonon server
Privacy and Data
What’s Tracked
✓ Class completion status ✓ Completion timestamps✓ Last watched timestamps ✓ Watch time (seconds) ✓ Personal course notes (localStorage only)
What’s NOT Tracked
✗ Video viewing analytics ✗ Detailed playback statistics ✗ Personal information ✗ Usage patterns/metrics ✗ Search queriesData Location
- localStorage: Your browser’s local storage
- Server:
progress.jsonfile in server directory - Not Sent: No external services, no analytics, no telemetry
Troubleshooting Progress
Progress Not Saving
Check:- Browser console for errors
- localStorage availability (private browsing may block)
- Server connectivity (
/api/health) - Disk space on server for
progress.json
Progress Lost After Browser Clear
Solution:- Progress should restore from server on next load
- If server progress was also lost, it cannot be recovered
- Recommendation: Don’t clear browser data unnecessarily
Syncing Issues
Check:/api/progressendpoint returns data- POST requests succeed (check Network tab)
- Server has write permissions for
progress.json - Check server logs for sync errors
Progress Not Merging
Verify:- Server progress loads successfully on init
- No errors during merge (check console)
- localStorage has space available
- Timestamps are valid ISO 8601 format
Best Practices
- Let Auto-Tracking Work: Videos auto-complete on finish
- Manual Complete for Non-Video: Use button for readings/HTML content
- Use Notes Feature: Track insights and code snippets per course
- Check Learning View: Monitor overall progress regularly
- Don’t Clear Browser Data: If you must, ensure server sync is working
- Multiple Devices: Wait a few seconds after completing to ensure sync
Technical Details
State Management
Progress is managed by theStateService class:
File: /js/services/state.js
Key Methods:
markClassComplete(classKey)- Mark class as completemarkClassInProgress(classKey, time)- Mark class as in progressisClassComplete(classKey)- Check completion statusgetClassStatus(classKey)- Get current statusgetCourseProgress(catIdx, routeIdx, courseIdx)- Calculate course progressgetRouteProgress(catIdx, routeIdx)- Calculate route progress
Progress Data Schema
Performance Considerations
- Debounced Sync: 400ms delay batches rapid changes
- Minimal Server Calls: Only on actual progress changes
- localStorage First: Instant reads, no network latency
- Efficient Merging: O(n) merge algorithm on initialization
- No Polling: Server doesn’t poll for updates (push-based)