CodeBuddy is a learning management system that instructors can use to deliver computer-programming exercises. It was developed by the Piccolo Lab and has been used since 2019 in programming-oriented courses. It uses HTML/CSS/JavaScript on the client side and Python on the server side. It executes students' code securely within on the back end.
Here are some of CodeBuddy's features:
We have a live server running CodeBuddy here. If you would like to run your own instance, follow the instructions below.
If you are using MacOS or Linux, you should already have a terminal. Go to the Applications menu, and open it. Then make sure you have installed the git command-line tool.
If you are using a Windows operating system, install git for windows. Then open Git Bash and use that as your terminal.
CodeBuddy can be installed on any system that supports Docker and Python. Here are the steps to install it. You will need to have basic familiarity with executing commands through a terminal.
pip install -r front_end/requirements.txt
.front_end/secrets/front_end.yaml
that contains a password that you wish to use for encrypting cookies, as well as Google authentication tokens. (Google authentication is not supported currently, so you can just use the placeholder values shown below for now.)cookie: "abcdefg"
google_oauth_key: "123456789012-abc123a12aa12aaaa1aaaaa1aaaa1aa.apps.googleusercontent.com"
google_oauth_secret: "ABCDEFGHIJKLMNOP"
If you would like to contribute to developing CodeBuddy, complete these additional steps.
From a terminal window, use the cd
command to change your working directory to where you wish to store the CodeBuddy code.
git clone <cloneURL>
Replace <cloneURL>
with the GitHub clone address for this project (for example, https://github.com/srp33/CodeBuddy.git).
This will create a directory called CodeBuddy in your current working directory. Use the cd
command to navigate to that directory.
For most users, the preferred option is to run the front end within Docker. To do this, execute the run_front_end
script at the terminal. If you want to contribute to developing CodeBuddy, it might be helpful to run CodeBuddy outside of Docker so that you do not need to rebuild the Docker image each time you make a change. To do so, follow the steps described below.
cd
command to change your current working directory to front_end
.make html
static
directory. Execute the following command. When it is done, hit Ctrl-C to move on. make build-watch
make dev-server
When you modify files in the front_end/templates
directory, you will need to re-run make html
. When you change any of the Python code, you will need to hit Ctrl-C to stop the development server and then re-execute make dev-server
.
Use the cd
command to change your current working directory to middle_layer
. Then execute the run_middle_layer
script.