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 21: Virtual Terminal

40 min read
Command ParsingVirtual File SystemTab CompletionTerminal EmulationState ManagementTheming

📋 Project Brief

Build a web-based terminal emulator that looks and behaves like a real command line interface. Implement a virtual file system, command history navigation, tab completion, and custom theming. This project demonstrates advanced string parsing and state management.

✅ Feature Requirements

Feature 1: Command History

Acceptance Criteria:

  • Pressing ↑ cycles through previous commands (most recent first)
  • Pressing ↓ cycles forward through history
  • History persists in localStorage (max 100 entries)
  • A history command lists all previous commands
  • history clear wipes the history

Feature 2: Virtual File System

Acceptance Criteria:

  • ls — lists files and folders in the current directory
  • cd <dir> — changes directory; cd .. goes up one level
  • mkdir <name> — creates a new directory
  • touch <name> — creates a new file
  • cat <file> — displays file contents
  • rm <name> — removes a file or empty directory
  • pwd — prints the current working directory
  • The file system is represented as a nested JavaScript object and persists in localStorage

Feature 3: Terminal Theming

Acceptance Criteria:

  • Preset themes: "Classic Green" (green on black), "Matrix" (green rain animation), "Ubuntu" (purple/orange), "Dracula"
  • A theme <name> command switches themes
  • Custom prompt format: user@terminal:~/path $
  • Font must be monospace; support for font size adjustment

Feature 4: Tab Completion

Acceptance Criteria:

  • Pressing Tab auto-completes command names and file/directory names
  • If multiple matches exist, show all options (like bash)
  • Double-Tab lists all available commands

Feature 5: Special Commands

Acceptance Criteria:

  • help — lists all available commands with descriptions
  • clear — clears the terminal output
  • echo <text> — prints text to the terminal
  • date — shows current date and time
  • whoami — displays the "username"
  • sudo <anything> — triggers a fun "Access Denied" animation

📊 Command Parser Requirements

InputParsed As
ls{ command: "ls", args: [] }
cd documents{ command: "cd", args: ["documents"] }
echo "hello world"{ command: "echo", args: ["hello world"] }
mkdir "my folder"{ command: "mkdir", args: ["my folder"] }

🧪 Testing Checklist

  • Unit test command parser (handling quotes, spaces, special characters)
  • Unit test file system operations (create, delete, navigate)
  • Unit test tab completion algorithm
  • Integration test: create a folder, navigate into it, create a file, cat it
  • A11y: terminal output must be accessible to screen readers via aria-live

🚀 Stretch Goals

  • Add pipe support: ls | grep .txt
  • Implement nano <file> — a simple in-terminal text editor
  • Add command aliases
  • Implement a "boot sequence" animation on first load

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.