Code Editor Frontend: https://github.com/nikhil-babar/code-editor.git
code_executor_backend.mp4
Code-Xpert is a micro-service code execution engine designed for fast, secure, and isolated code execution. It supports multiple programming languages, including C, C++, Python, Java, and Node.js. Built using Node.js, Docker, and RabbitMQ, Code-Xpert ensures that each code execution runs in an isolated environment, providing a robust and scalable solution for various coding needs.
Before setting up Code-Xpert locally, ensure you have the following installed on your machine:
- Docker
- Node.js
- Docker Compose
Follow these steps to set up Code-Xpert locally:
Ensure Docker is installed on your machine. You can download Docker from here.
Clone the Code-Xpert repository to your local machine:
git clone https://github.com/nikhil-babar/code-executor-engine.git
cd code-executor-engine
Navigate to the worker/images
directory and run the build.sh
script to create Docker images for all supported languages:
cd worker/images
./build.sh
This script will create the necessary Docker images for each language, which will be used to create isolated containers for code execution.
Navigate back to the root directory and build and run the Docker Compose file:
cd ../..
docker-compose up --build
Examine the service logs to ensure that the database connection is established and the server is listening:
docker-compose logs
Navigate to the test
directory and run the run.js
file to test the code execution service:
cd test
node run.js
You should see that each code execution has a separate container running.
Collect the logs and check the database for the output of the executed code. Ensure that each execution is isolated and secure.
If you would like to contribute to Code-Xpert, please follow the standard GitHub flow:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature-branch
) - Create a new Pull Request
Code-Xpert is licensed under the MIT License.
For any questions or suggestions, please contact [nikhilbabarjee@gmail.com].
By following these steps, you should be able to set up and run Code-Xpert locally, enabling you to execute code in an isolated and secure environment.