An online complier and editor for programming languages.
- Javascript
- C++
- Haskell
- JSON (editor only)
- CSS (editor only)
- HTML (editor only)
- Markdown (editor only)
docker-compose up
docker-compose --profile test up --abort-on-container-exit
-
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. -
On the back-end, there is a single "view"
expressGo server that either executes the requested code (POST) or informs the current supported language modes for the editor/compiler (GET). -
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. -
-
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 vianpm test
. -
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 viadocker-compose --profile test up --abort-on-container-exit
.
-
-
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.