This project is a full-stack, containerized code execution platform designed to safely run user-submitted code inside isolated Docker containers. Users can write, execute, and test code directly from the browser, while the backend ensures security, isolation, and consistent runtime environments.
- Next.js
- React.js
- Tailwind CSS
- Styled Components
- Ant Design
- ASP.NET (MVC Architecture)
- Docker (isolated execution per language)
- Docker Compose (multi-service orchestration)
The goal of this platform is to execute code safely without compromising the security of the host machine.
Every time a user submits code, the backend spins up (or uses) a Docker container designed specifically for that language and runs the code inside an isolated environment.
This keeps the system clean, safe, and predictable.
The frontend provides a responsive and modern code editor built using:
- Next.js (routing + SSR)
- React (component system)
- Tailwind + Styled Components (styling)
- Ant Design (UI elements)
- monaco editor (for VS Code like editor)
The user selects a language and hits Run.
A POST request is sent to the ASP.NET backend with:
- Code text
- Selected language
- Additional metadata if needed
To safely isolate each execution:
- A temporary directory is created
- A temporary file is generated based on the language:
file.pyfile.jsfile.cs- etc.
This ensures each execution is isolated and ephemeral.
The backend:
- Mounts the temp folder into a Docker container
- Selects the appropriate runtime container (Python, Node, etc.)
- Executes the generated file inside the container
- Captures:
- Standard output (stdout)
- Error messages (stderr)
- Exit codes
Docker ensures:
- Isolation
- Safety
- Consistent runtime
- No leftover processes
Both the backend and language runtimes run inside containers.
The output of the container is sent back as JSON:
- The result of the program
- Compilation/log errors if any
- Execution time (optional)
- Metadata for UI display
The UI updates the output section instantly.
Once execution ends:
- The temp folder is deleted
- No files remain on the server
- No process continues running
- Containers are cleaned automatically
This keeps the system clean and memory-efficient.