MCPSERV.CLUB
LiveCodes

LiveCodes

Self-Hosted

Client‑side code playground for 90+ languages

Active(100)
1.2kstars
0views
Updated 2 days ago
LiveCodes screenshot

Overview

Discover what makes LiveCodes powerful

LiveCodes is a **client‑side code playground** that runs entirely in the browser, offering instant compilation and execution for over 90 languages and frameworks such as React, Vue, Svelte, Solid, Typescript, Python, Go, Ruby, and PHP. The application is deliberately server‑agnostic: all core features—editor, syntax highlighting, language tooling (formatters, linters), and sandboxed execution—operate in the user's browser via WebAssembly or native JavaScript runtimes. The only server‑bound responsibilities are optional services like URL shortening, broadcasting, or persistent project storage, which can be self‑hosted through the provided Docker stack.

Front‑end

Runtime Engines

State Management

Docker Backend

Overview

LiveCodes is a client‑side code playground that runs entirely in the browser, offering instant compilation and execution for over 90 languages and frameworks such as React, Vue, Svelte, Solid, Typescript, Python, Go, Ruby, and PHP. The application is deliberately server‑agnostic: all core features—editor, syntax highlighting, language tooling (formatters, linters), and sandboxed execution—operate in the user's browser via WebAssembly or native JavaScript runtimes. The only server‑bound responsibilities are optional services like URL shortening, broadcasting, or persistent project storage, which can be self‑hosted through the provided Docker stack.

Architecture

  • Front‑end: Built with modern React (or similar) and bundled via Vite/Webpack, the UI leverages a modular plugin architecture. Each language runtime is encapsulated in a WebAssembly module or native JS shim, enabling isolated sandboxing with iframe sandboxes and strict CSP headers.
  • Runtime Engines: The playground uses a mix of in‑browser interpreters (e.g., ts-node, pyodide for Python, go-wasm) and transpilers (Babel, SWC) to provide instant feedback. For languages without native browser support, Docker‑based micro‑services can be spun up via the optional backend.
  • State Management: Projects are stored in localStorage or optionally in a self‑hosted persistence layer exposed via a REST API. The editor state is managed by Redux/Context and serialized to JSON for sharing or embedding.
  • Docker Backend: The Docker compose stack exposes lightweight services for URL shortening, broadcasting (WebSocket), and optional language runtimes that require server execution. Each service runs in its own container, allowing horizontal scaling or removal based on feature needs.

Core Capabilities

  • Multi‑language support: 97+ languages with syntax highlighting, code formatting, linting, and live compilation.
  • Editor: Monaco‑based editor with IntelliSense, theming, and breakpoint support for debugging.
  • Execution Sandbox: Secure iframe sandboxes with configurable timeouts and memory limits; WebAssembly runtimes for fast, client‑side execution.
  • APIs & Webhooks: REST endpoints for project persistence, URL shortening, and broadcasting; WebSocket support for real‑time collaboration.
  • Extensibility: Plugin system allows developers to add new runtimes or UI components via a simple JSON schema and optional npm package.
  • Embedding: Exportable iframe snippets for embedding in documentation or blogs; shareable links with optional short URLs.

Deployment & Infrastructure

  • Self‑hosting: The static build can be served from any CDN or static file server (GitHub Pages, Netlify, Cloudflare Pages). No backend is required for core functionality.
  • Docker: The included docker-compose.yml bundles optional backend services. Each container is lightweight (under 50 MB) and can be scaled horizontally if needed.
  • Scalability: Because the heavy lifting happens client‑side, server load is minimal. The optional backend can be horizontally scaled behind a reverse proxy (NGINX, Traefik) for high‑traffic deployments.

Integration & Extensibility

  • Plugin API: Developers can ship new language runtimes as npm packages that expose a LiveCodesRuntime interface. The core loads these at runtime via dynamic imports.
  • Webhooks: External services (CI/CD pipelines, chatbots) can trigger project builds or broadcasts via the exposed REST endpoints.
  • Custom Themes & Configs: The editor accepts custom theme JSON and configuration files, enabling integration with existing design systems or tooling pipelines.

Developer Experience

  • Zero Configuration: No .env files or build scripts are required for the core. The documentation is concise, with a focus on API references and plugin development guides.
  • Community & Docs: The project hosts exhaustive documentation on GitBook, a growing community on X/Twitter, and an active GitHub issue tracker. The MIT license ensures unrestricted use in commercial or internal projects.
  • Testing: The repo includes unit and integration tests for both the front‑end and Docker services, encouraging contributors to add features confidently.

Use Cases

  1. Educational Platforms: Embed LiveCodes snippets in learning portals to provide instant, interactive coding exercises without server costs.
  2. Internal Tooling: Teams can host a private playground for quick prototyping, sharing, and debugging across multiple languages.
  3. Documentation: Libraries or frameworks can showcase live examples directly in their docs, improving onboarding.
  4. Hackathons: Organizers can provide a ready‑to‑use, self‑hosted playground that participants can clone or embed.

Advantages

  • Performance: Client‑side execution eliminates round‑trip latency, providing near real‑time feedback.
  • Flexibility: The plugin architecture allows adding niche languages or custom runtimes without touching the core codebase.
  • Cost‑Effectiveness: Zero server maintenance for core features; optional Docker services can be run on inexpensive VPS or cloud instances.
  • Open Source & MIT: No licensing fees, full control over the codebase, and freedom to modify for internal needs.

LiveCodes delivers a fully functional, extensible, and low‑overhead code playground that empowers developers to prototype, teach, or embed interactive coding experiences with minimal operational burden.

Open SourceReady to get started?

Join the community and start self-hosting LiveCodes today