Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Typing SVG


Status Language Framework Language License




🏢 Exterior — Project Overview

"Bringing desktop-grade C++ compilation directly to your browser."

Attribute Details
Name C++ Online Compiler
Version v1.0.0
Status 🟢 Active
Type Web-based IDE
Primary Language Python
Target Compiler g++ (C++17)
License MIT
Author prithishmisra23


🚪 Reception — About the Project

C++ Online Compiler is a lightweight, web-based Integrated Development Environment (IDE) built entirely in Python using Streamlit. It allows users to write, compile, and execute C++ code in a secure, sandboxed environment directly from their browser, complete with custom CSS styling to mimic professional IDEs.

👥 Who is it for?

User Type Core Use Case
Students Quickly testing algorithms and assignments without local setup.
Instructors Demonstrating C++ concepts in live environments.
Developers Scratchpad for testing C++17 features on the go.

🛠 The Core Problem

❌ Before C++ Online IDE:
- Cumbersome local setup required for g++ and MinGW.
- Difficulty sharing code snippets that compile reliably.
- Heavy IDEs taking up gigabytes of disk space.

✅ After C++ Online IDE:
+ Zero-configuration cloud compilation.
+ Instant execution with standard input/output support.
+ Lightweight, beautifully styled interface accessible anywhere.


👔 Vision Floor

Purpose: To lower the barrier to entry for systems programming by providing an accessible, instant C++ environment.

Principle Application
Simplicity A single app.py architecture that is easy to deploy and scale.
Security First utilizing tempfile and subprocess sandboxing to prevent host compromise.
Aesthetic UX Custom CSS overriding default Streamlit styles for a true "Dark Mode" IDE feel.


📦 Product Floor

✨ Feature Matrix

Feature Status Description
Multi-File Support 🟢 Live Manage and compile multiple .cpp and .h files simultaneously.
Sandboxed Execution 🟢 Live Safe code execution with timeout limits to prevent infinite loops.
Custom Input 🟢 Live Provide stdin directly via the UI for algorithmic testing.
Real-time Compilation Logs 🟢 Live Detailed g++ output and error tracing.

🔄 User Flow Diagram

flowchart TD
    A[Open IDE] --> B[Write C++ Code]
    B --> C{Provide Input?}
    C -->|Yes| D[Enter Stdin]
    C -->|No| E[Compile Code]
    D --> E
    E --> F{Compilation Success?}
    F -->|Yes| G[Execute Binary in Sandbox]
    F -->|No| H[Display Compiler Errors]
    G --> I[Show Output & Execution Time]
Loading


⚙️ Engineering Floor

🏗 System Architecture

graph TB
    UI[Streamlit Frontend] --> App[app.py Logic]
    App --> FS[Temp File System]
    App --> GCC[g++ Compiler]
    GCC --> Bin[Executable (a.out)]
    Bin --> App
    App --> UI
Loading

💻 Technology Stack

Layer Technology Purpose
Frontend UI Streamlit, Custom CSS Rapid web UI development with a bespoke IDE theme.
Backend Logic Python 3, subprocess Handling state, compiling, and executing binaries securely.
Compiler GNU C++ Compiler (g++) Compiling C++17 standard code.


☁️ Infrastructure Floor

🚀 Local Setup

  1. Ensure Dependencies are Installed: You must have g++ installed and accessible in your system's PATH.

  2. Clone the repository:

    git clone https://github.com/prithishmisra23/cpp-online-compiler.git
    cd cpp-online-compiler
  3. Install Python dependencies:

    pip install -r requirements.txt
  4. Run the IDE:

    streamlit run app.py


🔒 Security Center

Component Status Recommendation
Execution Sandbox 🔒 Secured Uses tempfile.TemporaryDirectory for isolated compilation.
Timeout Limits 🔒 Secured Subprocess timeouts prevent infinite loop DOS attacks.
System Calls ⚠️ Warning C++ code can technically make system calls. Consider Docker for production.


📊 Operations Room

🌿 Git Branching Strategy

gitGraph
    commit id: "Initial Commit"
    branch feature/streamlit-ui
    checkout feature/streamlit-ui
    commit id: "Add custom CSS"
    checkout main
    merge feature/streamlit-ui
    branch feature/secure-compiler
    checkout feature/secure-compiler
    commit id: "Add subprocess timeout"
    checkout main
    merge feature/secure-compiler tag: "v1.0.0"
Loading


📚 Archive


"Code. Compile. Conquer."

GitHub Profile

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages