• This repository has been archived on 12/Aug/2022
  • Stars
    star
    662
  • Rank 68,103 (Top 2 %)
  • Language
    JavaScript
  • License
    BSD 3-Clause "New...
  • Created almost 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

With ScratchJr, young children (ages 5-7) can program their own interactive stories and games.

Overview

This is the official git repository hosting the source code for the ScratchJr project.

ScratchJr can be built both for iOS and Android. A pure-web version is planned to follow at some point in the future.

Platform Status
iOS Released in App Store
Android Released in Google Play

Architecture Overview

The diagram below illustrates the architecture of ScratchJr and how the iOS (functional), Android (functional) and pure HTML5 (future) versions share a common client.

Scratch Jr. Architecture Diagram

Directory Structure and Projects

This repository has the following directory structure:

  • src/ - Shared JavaScript code for iOS and Android common client. This is where most changes should be made for features, bug fixes, UI, etc.
  • editions/ - Assembly directories for each "flavor" of ScratchJr. These symlink to src for common code, and could diverge in settings and assets.
    • free/ - Free edition JavaScript, including all shared code for all releases
  • android/ - Android port of Scratch Jr. (Java, Android Studio Projects)
    • ScratchJr/ - Android Studio Project for ScratchJr Android Application
  • bin/ - Build scripts and other executables
  • doc/ - Developer Documentation
  • ios/ - Xcode project for iOS build. (Make sure to open ScratchJr.xcworkspace not ScratchJr.xcodeproj)

Building ScratchJr

Initial setup

Regardless of whether you are doing iOS development or Android development, you should do these steps.

These instructions assume you are building both versions on Mac OSX, with Homebrew installed.

  1. Clone or update the code for this repo
  2. Ensure you have node and npm installed.
  3. Run sudo easy_install pysvg to install python svg libraries
  4. Run brew install librsvg to install commandline rsvg-convert
  5. Run brew install imagemagick to install commandline magick
  6. In the top level of the scratchjr repo directory, install npm dependencies for bundling the JavaScript: npm install

Analytics

ScratchJr uses the Firebase SDK to record analytics for the app. Scratch Team developers should look for the configuration files in the Scratch Devs Vault. If you're not on the Scratch Team, then you'll need to set up your own app analytics with Google Firebase. It's free. Firebase will generate the configuration files for you to download.

  1. Place the google-services.json file in editions/free/android-resources
  2. Place the GoogleService-Info.plist file in editions/free/ios-resources

iOS

  1. To build the iOS version, you need to have a Mac with Xcode
  2. Run brew install cocoapods to install CocoaPods
  3. Run pod install to install the Firebase Analytics dependencies
  4. Open Xcode
  5. In Xcode, open ios/ScratchJr.xcworkspace

Android

  1. Install or update Android Studio
  2. In Android Studio, open the project android/ScratchJr
  3. Choose the appropriate flavor/build variant in Android Studio

Note: you can still do Android development on Ubuntu. Instead of the install commands above, run:

  1. sudo easy_install pysvg to install python svg libraries
  2. sudo apt-get install librsvg2-bin to install rsvg-convert
  3. sudo apt-get install imagemagick to install ImageMagick

Where and how to make changes

All changes should be made in a fork. Before making a pull request, ensure all changes pass our linter:

  • npm run lint

For more information, see CONTRIBUTING.md.

Code credits

ScratchJr would not be possible without free and open source libraries, including:

Acknowledgments

ScratchJr is a collaborative effort between:

More Repositories

1

scratch-gui

Graphical User Interface for creating and running Scratch 3.0 projects.
JavaScript
4,239
star
2

scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.
JavaScript
2,594
star
3

scratch-www

Standalone web client for Scratch
JavaScript
1,507
star
4

scratch-flash

Open source version of the Scratch 2.0 project editor. This is the basis for the online and offline versions of Scratch found on the website.
ActionScript
1,326
star
5

scratch-vm

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0
JavaScript
1,199
star
6

scratch-html5

HTML 5 based Scratch project player
JavaScript
390
star
7

scratch-desktop

Scratch 3.0 as a self-contained desktop application
JavaScript
270
star
8

scratch-render

WebGL-based rendering engine for Scratch 3.0
JavaScript
260
star
9

scratchx

Scratch Extension Site
JavaScript
190
star
10

scratch-paint

Paint editor for Scratch 3.0
JavaScript
165
star
11

Scratch_1.4

Source Code repository for Scratch 1.4
C
107
star
12

scratch-link

Device interoperability layer for Windows and MacOS
C#
89
star
13

scratch-l10n

JavaScript
63
star
14

scratch-parser

Validation and parsing for Scratch projects
JavaScript
57
star
15

scratch-audio

Web Audio-based audio engine for Scratch 3.0
JavaScript
54
star
16

scratch-storage

Load and store project and asset files for Scratch 3.0
JavaScript
54
star
17

scratch-rest-api

Documentation for how to interact with the Scratch REST API
53
star
18

scratchjr-website

Code for the Scratch Jr Website
JavaScript
46
star
19

scratch-svg-renderer

Scratch SVG renderer
JavaScript
31
star
20

scratch-analysis

Analysis tool for summarizing the structure, composition, and complexity of Scratch programs.
JavaScript
24
star
21

scratch-extension-docs

[Deprecated] Sample code for Scratch 2.0 hardware and web extensions.
22
star
22

scratchr2_translations

Translations for the Scratch 2.0 website
16
star
23

scratch-resources

Source files and images for translators to translate Scratch materials
JavaScript
15
star
24

scratchwikiskin

Skin for the Scratch wiki
PHP
15
star
25

scratch-render-fonts

Fonts for Scratch SVG rendering
JavaScript
13
star
26

po2icu

An npm package for converting gettext to icu.
JavaScript
11
star
27

scratch-auth

Authentication utilities for Scratch
JavaScript
11
star
28

scratch-sb1-converter

Convert Scratch .sb files (for Scratch 1) to Scratch 2 (.sb2) in JS.
JavaScript
11
star
29

eslint-config-scratch

Shareable ESLint config for Scratch
JavaScript
8
star
30

scratch-docker

Scratch docker infrastructure npm module
Shell
7
star
31

scratch2-project-analyzer

Tools for analyzing Scratch 2.0 projects
Python
6
star
32

scratch-asset-types

Supported asset detection and types for Scratch backend
JavaScript
6
star
33

django-request-provider

Python
5
star
34

scratchx-example

Examples for working with Scratch and ScratchX extensions
JavaScript
5
star
35

swiki-navbar

A small extension for the Scratch Wiki that creates a limited navigation bar for users who are not logged in
PHP
4
star
36

scratchx-crossdomain

Standard crossdomain.xml file for use with ScratchX
4
star
37

.github

Scratch community health files
2
star
38

scratch-renovate-config

Scratch's shared configuration for Renovate
1
star