/CodeCraft

Codecraft is a graphical programming software which is based on Scratch 3.0

Primary LanguageCApache License 2.0Apache-2.0

Codecraft

Feature Requests

Codecraft is a graphical programming software which is based on Scratch 3.0. It targets teenagers of age 7-16, compatible with WIN/MAC.
By using a drag-and-drop interface, Codecraft has been helping users program without the need to write code in traditional text-based programming languages. Since its’ launch in 2018, it’s designed to make it easier for beginners, especially STEAM classrooms, to embrace coding to create projects and prototypes. With a focus on programming microcontrollers and IoT devices, Codecraft has been adapted and trusted by thousands of users all around the world. In 2022, Codecraft was recognized as Bett Awards Finalist and The Edtech Awards Cool Tool Finalist, two important and in prestigious awards the education technology industry.

Codecraft help online

Support Devices

Download

You can download the latest version from the download page from our website or Github Release

Prerequisites

This project requires:

Auto Install

Linux/Mac:

bash run-mac.sh

Windows:

bash run-win64.sh

Manual Installation

cd ./blocks
npm install && npm run build

cd ./l10n
npm install && npm run build

cd ./vm
npm install && npm run build

cd ./gui
npm install
  • For mac or linux like
npm run build-mac
  • For win
npm run build-win

Build main app

rm -r ../main/app/gui && cp -r ./build ../main/app/gui
cd ./main/app
npm install
./node_modules/.bin/electron-rebuild serialport

# If the error message “script is prohibited on this system” appears on the Windows   
# system, you need to open powershell as an administrator, and then execute 
# Set-ExecutionPolicy RemoteSigned

cd ./main
npm install
rm -r build 
  • For Mac
npm run publish-mac
  • For Linux like
npm run publish-linux
  • For Windows
npm run publish-win64

Once you finish building, you can find the installer under main/build/

Debug Mode

If you want to enter debug mode and debug the gui, you need to run the gui locally first. The gui depends on block, l10n, and vm, so you need to compile these three projects first.

cd ./blocks
npm install && npm run build

cd ./l10n
npm install && npm run build

cd ./vm
npm install && npm run build

cd ./gui
npm run start

At this time, a web service is running in the current terminal. localhost:8601

Then modify window load URL.

Line 213 in /main/src/application.js

Comment out the line.
window.loadURL(loadURL);

Open the line.
window.loadURL('http://localhost:8601');

If you need the console, open the line.
window.webContents.openDevTools();

Open a new terminal

cd ./main
npm run start

Add block and library

block shape and type definition

block directory: blocks/blocks_vertical

block l10n directory: blocks/msg/scratch_msgs.js

The block type value must start with 'argument', 'colour', 'control', 'data', 'event', 'looks', 'math', 'motion', 'operator', 'procedures', 'sensing', 'sound', 'system', 'display', 'azure', 'json', 'mqtt'. these values ​​are defined in CORE_EXTENSIONS of vm/src/serialization/sb2.js and sb3.js files

block code definition

code directory: gui/src/lib/generators/${device}/

block ui render

ui xml directory: gui/lib/toolboxs/toolbox-${deviceId}-xml.js

1001: grove zero
1002: arduino
1004: micro:bit
1005: mark
1006: grove joint
1007: mPython
1008: glint
1009: bittle
1010: wio terminal

arduino library

library directory: main/compilers/arduino-libraries/

You can put your arduino library in this directory

Contribute

PR welcome

Here, we’d also love to announce an open call for contributions to Codecraft open source project on GitHub. Whether you're a seasoned programmer or just starting out, we welcome contributions of all levels. From fixing bugs, to implementing new features & new blocks of functions, to make it compatible with more hardware platforms, to improving the overall codebase, there are many ways in which you can contribute to the project. Thanks in advance for your interest in contributing to this project!

License

The code contained in this repository and the executable distributions are licensed under the terms of the Apache License 2.0. The executable distributions contain third-party code licensed under other compatible licenses such as BSD-3.