Inspiration

Practicing Data Structures and Algorithms in C# often requires installing the .NET SDK, configuring an IDE, and managing projects before writing a single line of code. Existing online compilers lack a real IDE experience, while desktop IDEs can be overkill for interview preparation. We wanted to create a platform that combines the familiarity of Visual Studio Code with the simplicity of an online coding environment, allowing anyone to start solving problems instantly from their browser.

What it does

C# Playground is a browser-based development environment for practicing Data Structures and Algorithms in C#. Users write code in the Monaco Editor, organize solutions into projects, create and run custom test cases, provide standard input, and execute code securely inside isolated Docker containers. The platform includes inline compiler diagnostics, persistent error markers, keyboard shortcuts, a command palette, dark mode, configurable storage, and a responsive IDE-like interface—all without requiring a local .NET installation.

How we built it

The frontend is built with React, Vite, Chakra UI, and Monaco Editor to deliver a fast, desktop-like coding experience. A Node.js and Express backend manages solutions, files, configuration, and execution requests. Code execution is handled inside isolated .NET 8 Docker containers with strict memory, timeout, and network restrictions. Docker Compose orchestrates the entire stack, while a shared Docker volume enables efficient communication between the backend and execution environment.

Challenges we ran into

  • Securely executing untrusted C# code without compromising the host system.
  • Providing a responsive IDE experience while keeping compilation and execution isolated.
  • Synchronizing editor state, compiler diagnostics, test cases, and execution results.
  • Designing a project structure that feels familiar while remaining lightweight.
  • Balancing performance with security through Docker resource limits.

Accomplishments that we're proud of

  • Built a complete browser-based C# IDE with zero local setup.
  • Created a secure Docker-powered execution pipeline for compiling and running code.
  • Delivered an experience that closely resembles a desktop IDE using Monaco Editor.
  • Added first-class support for test cases, inline compiler diagnostics, and per-file standard input.
  • Designed an intuitive workspace with solution management, keyboard shortcuts, resizable panels, and a command palette.

What we learned

This project reinforced the importance of sandboxing when executing user code and highlighted the trade-offs between security, usability, and performance. We also gained valuable experience integrating Monaco Editor, orchestrating Docker containers, and designing an IDE-like workflow that remains simple enough for interview preparation and learning.

What's next for csharp-compiler

  • AI-powered code review and optimization suggestions.
  • Built-in DSA question library with difficulty levels.
  • Performance benchmarking and execution analytics.
  • Support for additional programming languages.
  • Cloud synchronization and user accounts.
  • Collaborative coding sessions and code sharing.
  • Automated test generation and hidden test cases.
  • Competitive programming mode with timers and leaderboards.

Built With

Share this project:

Updates