A simple web-based code runner supporting Python and C# using Docker, built with Fastify for the API and modern frontend technologies.
- Run Python and C# functions directly from the browser
- Automated test cases
- Human-readable pass/fail output
- Safe execution inside Docker containers
- Built with Fastify for fast, lightweight API handling
- Interactive frontend with language-specific templates
- Node.js and Fastify for the backend API
- Docker for safe code execution and sandboxing
- TypeScript for type-safe backend code
- HTML/JS for a simple, interactive frontend
- Optional: React or other frontend frameworks for future improvements
- Docker installed
- Node.js >= 20
- npm or yarn
git clone https://github.com/VulcanWM/code-runner.git
cd code-runner
npm installnpm start
# The server will run on http://[::1]:8080- Open
http://[::1]:8080in your browser - Select the language (Python or C#) from the dropdown
- Type your function code in the editor
- Click Run to see the test results
- Switching languages updates the editor with language-specific templates
- Test results are shown immediately in the browser
- Custom test cases can be added in the backend
/runroute
- Add a new language branch in the
/runroute of the server - Create a Docker environment and test runner for the new language
- Update the frontend dropdown and templates accordingly
Contributions are welcome! If you want to help improve the Code Runner, here are some ways you can contribute:
-
Fork the repository and create a new branch for your language.
-
Update the
/runendpoint in the backend:- Add a new case for your language in the request handler.
- Implement a Docker-based test runner for safe execution.
- Define default test cases and output formatting.
-
Update the frontend:
- Add your language to the dropdown menu.
- Add a default code template for your language in the editor.
-
Test your changes locally using
npm start. -
Submit a pull request with a clear description of the added language and any instructions for running it.
- Use the Issues tab to report bugs or request new features.
- Include steps to reproduce the issue or describe the feature clearly.
- Keep code style consistent with the existing TypeScript backend and JavaScript frontend.
- Ensure Docker execution is safe and isolated.
- Write clear commit messages describing your changes.
This project is licensed under the MIT License. See the LICENSE file for details.

