This repo is the codebase for the code sandbox service used in LernRobotics.
See lernrobotics for the main LernRobotics repo. See lernrobotics-game-server for the python robot API.
Node.js:
https://nodejs.org/en/download/\
Docker:
https://www.docker.com/get-started
Update node_modules with
Start nodejs server using
docker run -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock aegisinitiative/robobot-back-end:latest
The robobot-code-sandbox sandboxes code by executing it inside a docker container. The node.js server manages each docker container lifecycle for each client.
Please read this section before making any changes!
Push the new branch to github and set it as the upstream branch using the -u
option
Make frequent commits (On your branch)
Each commit should be described easily in 1 line. Commits that require multiple lines should be split into smaller commits.
Push commits to your upstream branch using
Once your changes are complete and fully functional, create a merge request on github and ask someone to confirm it.
When your branch is no longer needed, you should delete it
Delete the upstream branch (Do not delete branches that are not yours!)
Use --save when installing npm modules to ensure dependencies are installed locally.
Entry point for browsers. Sets up http server to listens on specified port.
Contains all routes available on server. Each route serves as an API entry point.
See MVC architecture. Contains database files.
View templates in Jade. See MVC architecture.
Require and Use middlewares and Routes. Catch and handle errors.
Assets available publicly. Includes Index.html which is served to the browser on load.
Config file for app-wide settings
Contains all dependencies information
Includes installed dependencies. Use npm ci to install correct dependency versions according to package-lock.json.