ckak912 / CodeBuddy_LLM

CodeBuddy: A learning management system for programmers with integrated LLM support
https://codebuddy.byu.edu
MIT License
1 stars 1 forks source link

CodeBuddy

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:

How to run a CodeBuddy instance

We have a live server running CodeBuddy here. If you would like to run your own instance, follow the instructions below.

Open a terminal

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.

Install dependencies

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.

  1. Install Docker Desktop. Make sure it is up and running.
  2. Install Python (version 3.9+) and the pip package manager.
  3. In the terminal, execute the following command to install the Python packages: pip install -r front_end/requirements.txt.
  4. Modify Settings.yaml according to your preferences. The default settings should work in most cases.
  5. Create a text file in 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.

  1. Install npm.
  2. Install Make. (Try these instructions for Windows.)
Clone the repository

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.

Running the front end

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.

  1. Use the cd command to change your current working directory to front_end.
  2. Build the HTML files. Execute the following command. make html
  3. Build the static directory. Execute the following command. When it is done, hit Ctrl-C to move on. make build-watch
  4. Start the development server. Execute the following command. 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.

Running the middle layer

Use the cd command to change your current working directory to middle_layer. Then execute the run_middle_layer script.