Skip to content

suryavirkapur/sandcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sandcode Icon

Sandcode

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

demo_video.mp4

Project Structure

.
├── apps
│   ├── client (Next.js frontend)
│   └── server (Rust backend)
└── docker
    └── Dockerfile (Sandbox for CodeExecution)

Features

  • 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

Execution Flow

Here's a visual representation of the execution flow in Sandcode:

Execution Flow

Getting Started

Prerequisites

  • Bun (v1.2.27 or higher)
  • Rust (latest stable version)
  • Docker (for sandboxing)

Running the Client

  1. Navigate to the client directory:

    cd apps/client
  2. Install dependencies:

    bun install
  3. Start the development server:

    bun dev

    The client will be available at http://localhost:3000.

Running the Server

  1. Navigate to the server directory:

    cd apps/server
  2. Build and run the Rust server:

    cargo run

    The server will start on http://localhost:8000.

Running the Execution Container

To run the server we need this image on the local system:

  1. Build the Docker image:

    docker build -t executor -f docker/Dockerfile .

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

web-based remote code execution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published