Sandcode is a web-based code execution environment that allows users to write and run code in multiple programming languages. It consists of a Next.js frontend and a Rust backend server.
demo_video.mp4
.
├── apps
│ ├── client (Next.js frontend)
│ └── server (Rust backend)
└── docker
└── Dockerfile (Sandbox for CodeExecution)
- Support for multiple programming languages (Python, Rust, C++, TypeScript, JavaScript)
- Real-time code execution
- Monaco Editor for enhanced code editing experience
- Input support for interactive programs
- Code download and copy functionality
Here's a visual representation of the execution flow in Sandcode:
- Bun (v1.2.27 or higher)
- Rust (latest stable version)
- Docker (for sandboxing)
-
Navigate to the client directory:
cd apps/client
-
Install dependencies:
bun install
-
Start the development server:
bun dev
The client will be available at
http://localhost:3000
.
-
Navigate to the server directory:
cd apps/server
-
Build and run the Rust server:
cargo run
The server will start on
http://localhost:8000
.
To run the server we need this image on the local system:
-
Build the Docker image:
docker build -t executor -f docker/Dockerfile .
Contributions are welcome! Please feel free to submit a Pull Request.