Skip to content

An online complier and editor for various programming languages.

Notifications You must be signed in to change notification settings

PedroASA/online-complier

Repository files navigation

online-complier

Docker Tests Node.js CI Go Tests

An online complier and editor for programming languages.

Supported Languages

  • Javascript
  • C++
  • Haskell
  • JSON (editor only)
  • CSS (editor only)
  • HTML (editor only)
  • Markdown (editor only)

System Requirements

  • Docker (version 20.10.5) (Any version ?)

  • docker-compose (version 1.28.0 or higher)


Using

Running

docker-compose up

Testing(End-2-End)

docker-compose --profile test up --abort-on-container-exit

About the implementation

  • React

    The front-end of the app is a simple react-bootstrap layout with a react-codeMirror editor.
    The app was created using create-react-app.

  • Express GO

    On the back-end, there is a single "view" express Go server that either executes the requested code (POST) or informs the current supported language modes for the editor/compiler (GET).

  • Docker

    The whole app is shipped with docker in two containers (client and api).
    The client container is based on a simple node image.
    The api container is based on a node image, but, additionally, installs the needed compilers and interpreters.
    Both containers are composed in docker-compose.yml, so that they run simultaneously and can communicate with each other.

  • Testing

    • Jest

      Since the front-end was created with cra. Jest was used for unit testing it.
      The unit test files are simple scripts that assert that the basic functionalities of each component work as expected.
      They are run via npm test.

    • Cypress

      As suggested in the cra documentation, Cypress was used for end-to-end testing.
      The Cypress tests serve to ensure that whole app works as expected, i.e, the api (so far untested) works fine and the client and server side are well connected.
      Since the tests require a full working app, they must be executed in a docker enviroment. For this, a test container was setup in docker-compose.yml.
      This container is based on a cypress image and has the 'test' profile so that it is only executed when requested. It is run via docker-compose --profile test up --abort-on-container-exit.

  • CI

    To continuosly integrate the app, three actions are executed on push and on pull-request to the main branch.
    The first runs the front-end unit tests on a node enviroment.
    The second runs the end-to-end tests on docker enviroment.
    The third runs the api unit tests on a go enviroment.

About

An online complier and editor for various programming languages.

Resources

Stars

Watchers

Forks

Packages

No packages published