is there a way i can run the scratch website and project editor and all of that from the…
- User
is there a way i can run the scratch website and project editor and all of that from the source code in a development enviroment
- Assistant
is there a way i can run the scratch website and project editor and all of that from the source code in a development enviroment
Yes, you can run the Scratch website and project editor from the source code in a development environment. Here's a step-by-step guide to set it up:
Scratch is composed of several repositories. The main ones you'll need are:
scratch-gui: The user interface for the Scratch editor.
scratch-vm: The virtual machine that runs Scratch projects.
scratch-blocks: The graphical programming blocks.
scratch-www: The website itself.
scratch-gui: The user interface for the Scratch editor.
scratch-vm: The virtual machine that runs Scratch projects.
scratch-blocks: The graphical programming blocks.
scratch-www: The website itself.
You can clone these repositories using . Open your terminal and run the following commands:
────────────────────────────────────────────────────────────────────
shCopy codegit clone git clone git clone git clone
Each of these repositories has its own dependencies that need to be installed. Navigate into each directory and run the installation commands.
Forscratch-gui,scratch-vm, andscratch-blocks:
────────────────────────────────────────────────────────────────────
shCopy codecd scratch-gui npm install cd ../scratch-vm npm install cd ../scratch-blocks npm install
Forscratch-www:
────────────────────────────────────────────────────────────────────
shCopy codecd scratch-www npm install
You need to link the local copies ofscratch-vmandscratch-blockstoscratch-gui. This ensures that changes inscratch-vmandscratch-blocksare reflected inscratch-gui.
Inscratch-vmandscratch-blocksdirectories:
────────────────────────────────────────────────────────────────────
shCopy codenpm link
In thescratch-guidirectory:
────────────────────────────────────────────────────────────────────
shCopy codenpm link scratch-vm npm link scratch-blocks
Now, you can run the development servers for each of the repositories.
Forscratch-gui:
────────────────────────────────────────────────────────────────────
shCopy codecd scratch-gui npm start
Forscratch-www:
────────────────────────────────────────────────────────────────────
shCopy codecd scratch-www npm start
Once the development servers are running, you can access the Scratch editor and website in your browser.
The Scratch editor will typically be available athttp://localhost:8601.
The Scratch website will be available athttp://localhost:8333.
The Scratch editor will typically be available athttp://localhost:8601.
The Scratch website will be available athttp://localhost:8333.
Notes:
Make sure you have Node.js and npm installed on your system.
Running multiple repositories together might require adjusting some configuration files or scripts. Refer to the official documentation of each repository for specific instructions and troubleshooting.
Make sure you have Node.js and npm installed on your system.
Running multiple repositories together might require adjusting some configuration files or scripts. Refer to the official documentation of each repository for specific instructions and troubleshooting.
By following these steps, you should be able to set up a local development environment for Scratch and make changes to the source code as needed.
Not yet included in a published release.