DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Project 1: The Performance-First Dashboard
  • Project 2: Accessible Video Player
  • Project 3: Markdown Blog Engine
  • Project 4: Browser-Based Code Editor
  • Project 5: Multi-Tab Whiteboard
  • Project 6: Infinite Scroll Image Gallery
  • Project 7: Recipe Optimizer & Converter
  • Project 8: Budget Tracker with Charts
  • Project 9: Typing Speed Test
  • Project 10: Weather App with Time-Travel
  • Project 11: CSS Grid Layout Builder
  • Project 12: Password Vault (Frontend Only)
  • Project 13: Kanban Board (Trello Clone)
  • Project 14: Quiz App with Leaderboard
  • Project 15: Habit Tracker (GitHub Style)
  • Project 16: E-commerce Product Page
  • Project 17: Unit Converter (Expert Mode)
  • Project 18: Music Visualizer
  • Project 19: Flashcard Learning App
  • Project 20: Custom Form Validator
  • Project 21: Virtual Terminal
  • Project 22: Pomodoro Timer (Focus Pro)
  • Project 23: SVG Path Editor
  • Project 24: Movie Database Matchmaker
  • Project 25: Interactive Resume / Portfolio
  • Project 26: Recipe Scraper UI
  • Project 27: Crypto Tracker (Real-Time)
  • Project 28: Find My Pet (PWA)
  • Project 29: Markdown-to-Slide Tool
  • Project 30: Browser Health Dashboard
← From Beginner to Expert in Fundamentals of Frontend

Project 1: The Performance-First Dashboard

60 min read
Virtual ScrollingWeb WorkersrequestAnimationFrameMemory ManagementCSS Custom PropertiesAdaptive Polling

📋 Project Brief

Build a data-intensive monitoring dashboard that handles high-frequency updates (1,000+ data points/second) without dropping frames. This simulates real-world scenarios like stock exchanges, server farms, or IoT monitoring systems. The primary objective is to demonstrate mastery over the browser's main thread, memory management, and rendering pipeline.

🎯 Learning Objectives

  • Understand the browser rendering pipeline (Style → Layout → Paint → Composite)
  • Implement Virtual Scrolling to keep the DOM lean with 10,000+ rows
  • Use Web Workers to offload heavy computation from the main thread
  • Master requestAnimationFrame for smooth, 60FPS visual updates
  • Build adaptive polling systems that respond to user activity

📐 Architecture Overview

The application consists of four major systems working together:

SystemResponsibilityKey Challenge
Data LayerFetches, buffers, and manages incoming data streamsHandling 1,000+ updates/second without memory leaks
Virtual Scroll EngineRenders only visible rows in the viewportCalculating row positions and recycling DOM nodes
Worker ThreadSorts, filters, and aggregates data off the main threadSerialization overhead of postMessage
Render PipelineUpdates the UI at 60FPS using requestAnimationFrameBatching DOM writes to avoid layout thrashing

✅ Feature Requirements

Feature 1: Virtual Scrolling

What it does: Only renders the rows currently visible in the viewport, plus a small buffer above and below.

Acceptance Criteria:

  • The dashboard must display a dataset of 10,000+ rows
  • The DOM should never contain more than ~50 rendered row elements at any time
  • Scrolling must remain smooth at 60FPS (use Chrome DevTools Performance tab to verify)
  • The scrollbar height must accurately reflect the total number of rows
  • Rapid scrolling (flicking) must not cause blank/white flashes

Technical Hints: Research "windowing" techniques. Calculate startIndex and endIndex from scrollTop, rowHeight, and viewportHeight. Use a container with a calculated total height to give the scrollbar the correct proportional size.

Feature 2: Memory Monitor Widget

What it does: A live widget displaying the app's current heap usage.

Acceptance Criteria:

  • Display usedJSHeapSize, totalJSHeapSize, and jsHeapSizeLimit in a human-readable format (MB)
  • Update every 2 seconds
  • Show a visual progress bar that turns red when heap usage exceeds 80%
  • Gracefully handle browsers that don't support performance.memory (show "Not Supported")

Feature 3: Web Worker Processing

What it does: Offloads all data sorting, filtering, and aggregation to a background thread.

Acceptance Criteria:

  • Clicking "Sort by Price" must NOT freeze the UI, even with 50,000 rows
  • The Worker must accept messages like { type: "SORT", column: "price", direction: "asc" }
  • The Worker must post back the sorted result, which the main thread then renders
  • Include a loading indicator while the Worker is processing
  • The Worker file must be separate and independently testable

Feature 4: Theme Engine

What it does: Instant light/dark mode switching with zero flicker.

Acceptance Criteria:

  • All colors must be defined as CSS Custom Properties (no hardcoded hex/rgb in components)
  • Toggling the theme must update in under 16ms (one frame)
  • The user's preference must persist in localStorage
  • On first load, respect the system preference via prefers-color-scheme

Feature 5: Dynamic Polling

What it does: Adapts the data-fetching interval based on user activity and tab visibility.

Acceptance Criteria:

  • When the tab is active and the user is interacting: poll every 1 second
  • When the tab is active but the user is idle (no mouse/keyboard for 30s): poll every 5 seconds
  • When the tab is in the background (visibilitychange event): poll every 30 seconds or pause entirely
  • Resuming the tab must immediately fetch the latest data

🏗️ Suggested File Structure

File / FolderPurpose
src/components/VirtualList/The virtual scrolling engine component
src/components/MemoryMonitor/The heap usage widget
src/workers/dataWorker.jsThe Web Worker for sorting/filtering
src/hooks/usePolling.jsCustom hook for adaptive data fetching
src/styles/theme.cssCSS Custom Properties for theming
src/utils/generateData.jsMock data generator for development

📊 Performance Benchmarks (Pass/Fail)

MetricTargetHow to Measure
Frame Rate during scroll≥ 55 FPSChrome DevTools → Performance → FPS meter
DOM Node Count< 200 nodes in the listDevTools → Elements → Count rendered rows
Heap Growth over 5 min< 5MB increaseDevTools → Memory → Heap snapshot comparison
Sort 50K rows (Worker)< 500msConsole timer in Worker
Theme Switch< 16msPerformance.measure() around toggle

🧪 Testing Checklist

  • Unit test the virtual scroll index calculations (given scrollTop X, expect rows Y-Z)
  • Unit test the Worker sorting logic independently
  • Integration test: scrolling to the bottom loads the correct last row
  • Accessibility: all interactive elements must be keyboard-navigable
  • Lighthouse Performance score ≥ 95

🚀 Stretch Goals

  • Add column resizing via drag handles
  • Implement "sticky" header rows that remain visible during scroll
  • Add a "CSV Export" button that generates a file from the current filtered view
  • Implement sparkline mini-charts inside table cells

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.