Online Compiler IDE
Browser-based multi-language code compiler
Overview
The Online Compiler IDE is a browser-based coding environment that lets users write and execute code in multiple languages without installing anything. Each execution runs inside an isolated Docker container with resource limits, preventing abuse and ensuring security. Results stream back to the browser in real-time via WebSockets.
Key Features
How It Works
Write Code
User writes code in the Monaco editor in the browser. Language is auto-detected from selection.
Submit Execution
Frontend sends code + language to the Executor Service via REST or WebSocket.
Docker Spawn
Executor Service creates a short-lived Docker container with the appropriate language runtime, injects the code, and runs it.
Stream Output
stdout and stderr stream back to the browser in real-time via WebSocket. Container is destroyed after execution or timeout.
Tech Stack
Frontend
- Next.js
- TypeScript
- Monaco Editor
- WebSockets
Executor
- Python FastAPI
- Docker SDK
- Container isolation
Infrastructure
- Docker
- Docker Compose
- Nginx
Architecture
A lightweight two-tier architecture: Next.js frontend talks to a Python executor service that spins up isolated Docker containers per code run.
Data Flow
- 1User writes code in Monaco editor → clicks Run → WebSocket payload sent to Executor Service.
- 2Executor validates language and code size → Docker SDK spawns an isolated container with memory/CPU caps.
- 3Code is injected into the container and executed — stdout/stderr piped back through WebSocket in real-time.
- 4Container auto-destroyed after execution completes or hits 10-second timeout.
Interested in building something similar?
Get in Touch