Giter Club home page Giter Club logo

compilerd's Introduction

Kalvium Kalvium


Table of contents :

  1. About The Project
  2. Quick Usage
  3. Contribution
  4. License

About The Project :

Compilerd is a online code judge for evaluating code submissions passed to it. It compiles and executes code in several languages and returns the result and various other properties in the response. The judge supports several languages including C++, Python, C, JavaScript (Node.js) and Java. This is a service that is build using nodejs and express in the backend. It is fully customizable and can be adjusted as per requirement. Also, it has been tried and tested on Google Cloud Run and it just works seamlessly.

Quick Usage :

We will run the project locally and try to make a request to see a sample use case :

  • Clone the repo : git clone <web-url>
  • Change directory to the project's root folder.
  • Install dependencies : npm install
  • Build docker image : docker build -t <tag> .
  • Run the docker container with the built image : docker run -p 3000:3000 -e OPENAI_API_KEY=<your-api-key> -e ALLOWED_RAM=<allowed-ram-value> <image-name>
  • Now we have the service running on localhost http://localhost:3000/
  • Open postman and try to make a POST request on http://localhost:3000/api/execute/ with given payload :
        {
            "language" : "nodejs", 
            "script" : "console.log('hello world')"
        } 
  • You should see something like this in the response :
        {
            "output": "hello world\n",
            "execute_time": null,
            "status_code": 200,
            "memory": null,
            "cpu_time": null,
            "output_files": [],
            "compile_message": "",
            "error": 0
        }

Languages supported :

  • C
  • CPP
  • Python
  • Java
  • Node.js
  • Ruby

Contribution :

Prerequisites:

For local development we should have the following dependencies set up locally in our system

  • Nodejs : nodejs
  • Npm : this comes automatically with nodejs installation
  • Docker : docker
  • Postman or alternative : Postman
  • Git : Git

Setting up :

  • Fork the repository using Github UI.
  • Clone locally from the forked repo.

Making changes:

  • Make sure to create a new branch on top of the main branch : git checkout -b <name>
  • After making changes we can commit them using git commit -am <commit-name>

Running tests :

  • It is important to make sure that changes are not breaking, hence they should be tested aginst provided suite of test cases in repo.
  • Run the server in a docker container by using below commands :
    • docker build -t <tag-name> .
    • docker run -p 3000:3000 -e OPENAI_API_KEY=<your-api-key> -e ALLOWED_RAM=<allowed-ram-value> <image-name>
  • Execute the test script by running command node ./tests/test.js
  • Summary can be seen on the console when all the tests have finished.

Guidelines :

  • Provide Detailed Pull Requests
    • Clearly describe the problem you're solving or the feature you're adding
    • Provide context, background, and any relevant information
  • Adhere to the project's coding standards and style guides
  • Update documentation as needed for your changes
    • Ensure that your code is well-documented and easy for others to understand
  • Ensure that your contributions are well-tested
  • Maintain consistency with the existing codebase

License :

compilerd's People

Contributors

anipnwr7777 avatar shashanksingh2002 avatar kailashchoudhary11 avatar harshsharma2002 avatar tanmaynewatia avatar talk2cerlin avatar jaas666 avatar virajp4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.