Mirror of a WIP clone of the Scratch API and others made in Django
  • HTML 84.7%
  • JavaScript 6.5%
  • Python 5.6%
  • CSS 3.2%
Find a file
2026-07-21 06:25:12 -04:00
_docs Misc accuracy fixes 2026-05-09 09:11:56 -04:00
accounts loosen checks 2026-07-21 06:25:12 -04:00
apiclone loosen checks 2026-07-21 06:25:12 -04:00
base_comments Fix new comments' date 2026-07-20 17:20:06 -04:00
djangobb_forum Merge branch 'main' of https://codeberg.org/Heathercat123/apiclone 2026-07-21 00:12:12 -04:00
educators Implement Educator classes list view 2026-07-02 13:22:43 -04:00
explore Misc accuracy fixes 2026-05-09 09:11:56 -04:00
files Get rid of ugly hack in password validator 2026-07-19 11:45:04 -04:00
galleries Implement gallery open_to_all 2026-07-19 13:14:32 -04:00
homepage Implement deleting galleries 2026-07-19 12:35:35 -04:00
hosts Implement gallery open_to_all 2026-07-19 13:14:32 -04:00
info Begin? linting forums 2026-04-29 18:09:58 -04:00
internalapi Try to get Scratch 2 to like cloud vars 2026-03-11 15:21:58 -04:00
lib Things for ScratchR 2026-07-09 18:13:54 -03:00
news Make Scratch News images local 2026-07-13 18:52:42 -03:00
ngapi Deprecate lib.demo 2026-03-05 09:12:50 -05:00
notifications Make Scratch News images local 2026-07-13 18:52:42 -03:00
pagination Pagination: update "except" syntax 2026-02-20 07:54:40 -05:00
projects Implement deleting galleries 2026-07-19 12:35:35 -04:00
scratch_admin Implement setting user permissions from profile 2026-07-19 15:57:03 -04:00
siteapi Fix re-following users quickly sending notifications 2026-07-19 14:37:37 -04:00
static Merge branch 'main' of https://codeberg.org/Heathercat123/apiclone 2026-07-21 00:12:12 -04:00
templates Merge branch 'main' of https://codeberg.org/Heathercat123/apiclone 2026-07-21 00:12:12 -04:00
userprofiles loosen checks 2026-07-21 06:25:12 -04:00
.gitignore Merge branch 'main' of https://codeberg.org/Heathercat123/apiclone 2026-07-21 00:12:12 -04:00
forumindex.py Port forumindex.py from s2forumsdev tree 2026-02-19 17:45:00 -05:00
jinxer.py Add standalone-registration for < 2019 WWW 2026-03-05 08:08:49 -05:00
LICENSE Add LICENSE 2026-01-02 18:36:38 -05:00
manage.py Lint the whole thing 2025-08-09 18:44:00 -04:00
README.md Get rid of ugly hack in password validator 2026-07-19 11:45:04 -04:00
requirements-dev.txt Get rid of ugly hack in password validator 2026-07-19 11:45:04 -04:00
requirements.txt Remove unused type vars from hosts.api.users.views 2026-04-22 18:22:13 -04:00
todo.txt merge latest apiclone 2026-02-24 20:26:56 -05:00
upgrade.sh do static stuff properly 2026-01-26 22:36:05 -05:00

APIClone

Work in progress recreation of Scratch's current (as of mid 2026) backend systems, including the main API, projects API, assets API, uploads API and ScratchR2.

Requirements

APIClone requires the following to be installed:

  • Python. Only versions 3.12-3.14 were tested, but any version from 3.8 to the latest should work in theory. The rest can be installed using pip install -r requirements.txt. If you wish to contribute to APIClone, you may also want to install the dependencies in requitements-dev.txt.

Usage with Scratch-WWW for Development

This will give you the modern Scratch 3.0 look and editor.

  1. Clone APIClone and Scratch-WWW:

    git clone https://codeberg.org/heathercat123/apiclone.git
    git clone --depth=1 --single-branch --branch develop https://github.com/scratchfoundation/scratch-www.git
    cd apiclone
    
  2. Install dependencies: pip install -r requirements.txt Sorry for using so many external packages.

  3. Set up the database: python manage.py migrate

  4. Create superuser (admin/ST account): python manage.py createsuperuser

  5. Start APIClone: python manage.py runserver 8000

  6. Switch to another terminal window or tab.

  7. Install Scratch-WWW's dependencies and translations:

    cd scratch-www
    npm install
    npm run translate
    
  8. Start Scratch-WWW:

    API_HOST=http://localhost:8000/hosts/api \
    ASSET_HOST=http://localhost:8000/hosts/assets \
    BACKPACK_HOST=http://localhost:8000/hosts/backpack \
    CLOUDDATA_HOST=http:/localhost:8000/hosts/clouddata \
    PROJECT_HOST=http://localhost:8000/hosts/projects \
    STATIC_HOST=http://localhost:8000/hosts/uploads \
    FALLBACK=http://localhost:8000 \
    npm start
    

You can now open http://localhost:8333 in a web browser and enjoy Scratch-WWW with APIClone. Note that many elements of the website are hard-coded whereas they should be editable, such as the home page's "Scratch News" box. Quite a few pages and API endpoints are also missing. Both of these are either currently being worked on or this project may randomly have gotten abandoned. I love life.

Do note that this setup is not suited for a production environment! I haven't written a guide on that yet, so just read the Django docs and figure out how to build Scratch-WWW by yourself.

Standalone Usage for Development

This will give you the Scratch 2.0 look and editor.

  1. Clone APIClone:

    git clone https://codeberg.org/heathercat123/apiclone.git
    cd apiclone
    
  2. Install dependencies: pip install -r requirements.txt Sorry for using so many external packages.

  3. Set up the database: python manage.py migrate

  4. Create superuser (admin/ST account): python manage.py createsuperuser

  5. Create a file in the apiclone subdirectory called local_settings.py:

    from .settings import *
    SCRATCHR2_ONLY = True
    
  6. Start APIClone: python manage.py runserver 8000

At this point, you may desire to override a few more settings using local_settings.py:

# To revert to the blue accent color
SCRATCHR2_COLOR = 'Blue'

# To apply the 2013-like theme
SCRATCHR2_FOOTER = 2013
SCRATCHR2_NAVBAR = 2013
SCRATCHR2_PAGES = 2013

Reasonably detailed documentation can be found in settings.py. Please take a look at it, especially if you wish to deploy the website (the default settings are meant for a simple development environment).

You can now open http://localhost:8333 in a web browser and enjoy the good old Scratch 2.0 website. Note that many elements of the website are hard-coded whereas they should be editable, such as the home page's "Scratch News" box.. Quite a few pages and functionality are also missing. Both of these are either currently being worked on or this project may randomly have gotten abandoned. I love life.

Do note that this setup is not suited for a production environment! I haven't written a guide on that yet, so just read the Django docs.

Fun? fact

APIClone was originally on August 3rd, 2025, created to test out Scratch's "Set Thumbnail" implemented on July 15th. It took about 3 hours to make the first version, whose code can be seen here. A video of it being used, taken around half an hour before the code was published, can be seen here.