Built to order

Online Code Editor with Live Preview

This project builds a browser-based code editor with file tabs, regex-based JavaScript syntax highlighting, an execution console, a live preview pane that genuinely runs the demo page in a sandboxed iframe, a snippet library, keyboard shortcuts and a run-history table. The edit-to-preview loop is real, and each pipeline stage — tokenizing, execution, sandboxing — is visible in the UI. Suitable for B.E./B.Tech final-year projects in Computer Science and IT.

Online Code Editor with Live Preview — project thumbnail preview
More project photos (2)

The problem

Online editors are how most students first meet a new language, yet building one is an excellent systems exercise: tokenizing source for highlighting, capturing execution output, and sandboxing untrusted preview content. This project implements CodeForge, a complete browser-based code editor in a single file. The editor pane shows JavaScript source with syntax highlighting produced by a hand-written tokenizer (keywords, strings, numbers, comments, function names in distinct colors). File tabs switch between index.html, styles.css and script.js. The console panel shows realistic execution output with timing and exit codes. The live preview pane renders an interactive Fibonacci visualizer inside a sandboxed iframe — genuinely executing, not a screenshot. Around the editor sit the tools of real IDEs: a snippet library with six insertable patterns, a keyboard-shortcut reference, and a run-history table with per-run status.

How it works

  1. Source text is fed through a small tokenizer that wraps language tokens in styled spans for highlighting.
  2. File tabs switch the editor content and the language label without reloading the page.
  3. The preview pane loads the demo page in a sandboxed iframe, isolated from the editor chrome.
  4. The console panel renders execution results (program output, timing, exit code) for the demo program.
  5. Snippet cards and the shortcut table provide the surrounding IDE tooling views.
  6. The run-history table records each execution with status, mirroring real tooling behavior.

Tech stack:

  • HTML5, CSS3, vanilla JavaScript (ES6)
  • Regex-based syntax tokenizer (no highlighting library)
  • Sandboxed iframe for live preview isolation
  • Catppuccin-style dark editor theme
  • Static deployment (no server or database)
Parameter Value
Views 3 (Editor + Preview, Snippets, Run History)
File tabs 3 (HTML, CSS, JS) with language labels
Highlighting Hand-written tokenizer; 6 token classes
Preview Sandboxed iframe running a real interactive page
Snippets 6 across JavaScript, Python, Node.js
Dependencies None (single HTML file)
Deployment Any static host

Project features

  • [Syntax highlighting] A hand-written tokenizer colors keywords, strings, numbers, comments and function names in the editor pane.
  • [File tabs] index.html, styles.css and script.js tabs with language labels, switchable in one click.
  • [Live preview pane] A sandboxed iframe that genuinely runs the interactive demo page beside the editor.
  • [Execution console] Terminal-style output showing program results, execution time and exit code.
  • [Snippet library] Six categorized snippets (debounce, fetch-with-retry, binary search, quicksort, JWT middleware, CSV parser) with one-click insert affordance.
  • [Keyboard shortcuts] Reference table for save, run, find, comment and line operations.
  • [Run history] Table of past executions with time, file, language, duration and success/error status.

What is included

  • Complete source code (single-file editor with all views)
  • Syntax tokenizer with documented token classes
  • Interactive preview demo page (Fibonacci visualizer)
  • Snippet library content and shortcut reference
  • Setup guide (extending the tokenizer, adding real execution)
  • Project report PDF (tokenizing, sandboxing, methodology)
  • PPT presentation for final review
  • Viva Q&A preparation document (parsers, iframes, developer tools)

Limitations & prerequisites

  • Execution is simulated with realistic output; real multi-language execution needs a sandboxed backend (documented extension).
  • The tokenizer covers JavaScript essentials, not every language grammar.
  • Files are not persisted between sessions in the demo build.
  • No collaboration, linting or debugging features in this build.

Frequently Asked Questions

Does it really run code?

The preview pane genuinely executes the embedded demo page in a sandboxed iframe. Console execution output is simulated realistically; wiring a real execution backend is documented as the extension.

How does syntax highlighting work?

A hand-written tokenizer scans the source with regex patterns and wraps keywords, strings, numbers, comments and function names in colored spans — no highlight.js, so you own the code.

What is the iframe sandbox for?

It isolates the preview page's scripts from the editor chrome, which is exactly how real playgrounds contain untrusted user code.

Can I add more languages?

Yes. The tokenizer is organized by token class; adding a language means adding its keyword set and patterns.

What will I learn?

Tokenizing and lexical analysis, iframe sandboxing, editor UI design and developer-tool architecture.

Is this project suitable for a final-year project?

Yes — for Computer Science and IT programs. It demonstrates compilers-adjacent concepts (tokenizing) and systems thinking in a visible product. Suitable for B.E./B.Tech final-year projects in Computer Science and IT.

Components & software requirements
  • HTML5, CSS3, vanilla JavaScript (ES6)
  • Regex-based syntax tokenizer (no highlighting library)
  • Sandboxed iframe for live preview isolation
  • Catppuccin-style dark editor theme
  • Static deployment (no server or database)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Illustration of JWT authentication: a brass key handing a glowing sealed token to a server rack and a laptop login screen, linked by a chain motif.B.E./B.Tech Computer Science and IT students adding login and protected APIs to their final-year web projects

JWT Authentication for Students: Tokens, Signatures, Refresh Flows and a Node.js Implementation

How does JWT login actually work? When a user logs in, the server issues a signed token in three parts — header, payload, signature. The client sends it back as an Authorization: Bearer header, and the server verifies the signature instead of looking up a session. This guide decodes a real token by hand, walks through the full login and refresh flow, and builds a working Node.js implementation with bcrypt password hashing, token rotation, and storage rules that survive a viva.

Read guide
Illustration of SQL versus NoSQL: neat filing-cabinet table rows on one side against flexible nested document cards on the other, joined by dotted lines.B.E./B.Tech Computer Science and IT students choosing and designing the database for their final-year project

SQL vs NoSQL for Final-Year Projects: Which Database Should You Pick?

MySQL or MongoDB for your final-year project? SQL databases store data in related tables with enforced schemas, joins and transactions — the right default when your data is structured and money or records must stay consistent. NoSQL document stores trade the rigid schema for flexible, nested documents that ship faster when your data shape keeps changing. This guide compares them with a worked hospital-appointment example in both, a decision table, and rules matched to common project archetypes.

Read guide
Editorial illustration of shipping containers transforming into glowing software windows beside a laptop showing container layers, in blue and teal tones.B.E./B.Tech Computer Science and IT final-year students shipping web/backend projects

Docker for Student Projects: Images, Containers and Compose from Zero

End ‘it works on my machine’ failures: learn what Docker images and containers actually are, write lean Dockerfiles that exploit layer caching, persist data with volumes, orchestrate app-plus-database with Compose, and package an evaluator-proof submission — with the debugging table for every error you will definitely meet.

Read guide
Get a quotation