Scratch Web - CodeClubLuxembourg/plottybot-toolkit-web GitHub Wiki

Scratch Web

Introduction

The PlottyBot project includes a feature that allows users to deploy Scratch web files for enhanced drawing and programming capabilities. This integration enables more interactive and engaging coding projects using a web-based version of Scratch.

Deploy Scratch Web Static Files

Building the Scratch GUI

If you haven't already built the Scratch GUI, follow these steps:

  1. Navigate to the scratch-gui directory.
  2. Run the build command:
npm run build

Locating the Built Files

After building, the static files will typically be located in the build or dist directory. For scratch-gui, check:

  • scratch-gui/build/

This directory contains:

  • HTML: The main entry point (index.html).
  • JavaScript: Script files for functionality.
  • CSS: Stylesheets for layout and design.
  • Assets: Images, fonts, and media required for the application.
  • Map Files: Used for debugging, mapping minified code to the original source.

Transferring the Files

To transfer the built files to your Raspberry Pi:

  • Using SCP:
scp -r path/to/built/files [email protected]:/path/on/pi/
  • Using Rsync:
rsync -avz path/to/built/files [email protected]:/path/on/pi/
  • Using a USB Drive: Copy the files to a USB drive, plug it into the Raspberry Pi, and move them to the desired directory.

Serving the Files

Serve the transferred files using any HTTP server on the Raspberry Pi. These static assets do not require any special server-side processing.

Important Note

Check the contents of the build directory to ensure all necessary files have been transferred. Adjust any external asset references if needed to ensure they are accessible on the Raspberry Pi.

Navigation