Skip to content

notamitgamer/cloud-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Caution

UI BUG: TERMINAL OVERFLOW ON DESKTOP

Affected Pages: C++ and Python.
(Note: The C compiler is currently unaffected.)

Issue: On PCs and Tablets, extremely long lines of code push the terminal section completely off-screen to the right. This does not affect mobile users, as the terminal is positioned below the editor.

Planned Fixes:

  • Auto-Wrap: Implementing overflow-wrap or white-space: pre-wrap to keep code within bounds.
  • Resizable Divider: Adding a draggable slider to manually restore the layout.

Status: Investigating layout constraints for the C++ and Python environments.

TO DEVELOPERS: If you'd like to fix this, please fork the repository, apply your changes (e.g., CSS wrapping or a divider script), and submit a Pull Request. I appreciate the help!

Cloud Code Compiler

A real-time, low-latency code execution platform. > Built with raw WebSockets, Python aiohttp, and a custom C/C++ runner.

πŸš€ Live Demo

Try the Compiler

⚑ Key Features

  • Real-time I/O: Uses WebSockets to stream output character-by-character, allowing for interactive programs (e.g., input() in Python or std::cin in C++).

  • Multi-Language Support:

    • 🐍 Python 3: With Auto-Pip technology (detects imports and installs packages on the fly).

    • βš™οΈ C / C++: Full GCC/G++ compilation with standard stream handling.

  • Cyberpunk UI: A retro-futuristic, responsive interface built with Tailwind CSS and Xterm.js.

  • Low Latency: Persistent connections avoid the overhead of repeated HTTP requests.

πŸ›  Tech Stack

Component Technology
Frontend HTML5, Tailwind CSS, Xterm.js (WebSockets)
Backend Python 3.10, aiohttp, asyncio
Compilers GCC 11, G++, CPython
Deployment Docker (Planned), Linux Host

πŸ— Architecture

The Backend (backend.py)

The core is an asynchronous Python server using aiohttp. It upgrades HTTP requests to WebSocket connections.

  • Session Handling: Each tab gets a unique session.

  • Execution: Spawns subprocess threads to run user code safely on the host.

  • Stream Redirection: Captures stdout and stderr pipes and pushes them to the frontend in real-time.

The Frontend

  • Editor: A custom textarea overlay for code input.

  • Terminal: xterm.js renders ANSI escape codes (colors) and handles user input during execution.

πŸ“¦ Installation & Setup

Prerequisites

  • Python 3.10+

  • GCC / G++ Compiler

  • Linux/MacOS (Recommended) or Windows (WSL)

1. Clone the Repository

git clone [https://github.com/notamitgamer/cloud-compiler.git](https://github.com/notamitgamer/cloud-compiler.git)
cd cloud-compiler

2. Install Dependencies

pip install -r requirements.txt

3. Run the Backend Server

python backend.py

The server will start on port 8080 (or the port defined in backend.py).

πŸ›‘ Disclaimer & Liability

This compiler is a demonstration project created by a Computer Science undergraduate.

  • Security: Code is currently executed on the host machine without sandboxing. Do not run malicious code.

  • Liability: Amit Dutta assumes no responsibility for any data loss, security breaches, or damages resulting from the use of this code. Use at your own risk.

  • Rights: The author reserves the right to modify or take down the service at any time.

πŸ‘¨β€πŸ’» Author

Amit Dutta

Built with ❀️ and β˜• in Kolkata, India.

About

A real-time, low-latency code execution platform for C, C++, and Python. Built with WebSockets, Python aiohttp, and Xterm.js for a seamless browser-based IDE experience.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors