1
2
Fork 1
mirror of https://codeberg.org/heathercat123/apiclone.git synced 2026-04-03 05:12:43 -04:00
Mirror of a WIP clone of the Scratch API, ScratchR2, and others made in Django
  • HTML 73.9%
  • JavaScript 11.6%
  • Python 9.3%
  • CSS 5.2%
Find a file
2026-03-26 17:11:46 -04:00
_docs
accounts
apiclone
base_comments
djangobb_forum
educators
files
galleries
help
homepage
hosts
internalapi
lib
news
ngapi
notifications
pagination
projects
scratch_admin
siteapi
static
templates
userprofiles
.gitignore
forumindex.py
jinxer.py
LICENSE
manage.py
README.md
requirements.sh
requirements.txt

APIClone

Work in progress recreation of the main Scratch API, projects API, assets API, uploads API and ScratchR2.

Requirements

APIClone requires the following to be installed:

  • Python. Only versions 3.12 and 3.13 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.

Usage with Scratch-WWW

  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. Create superuser (admin/ST account): python manage.py createsuperuser

  3. Optional: Collect static files: ```python manage.py collectstatic`` This will create the static_prod directory for production environments.

  4. Start APIClone: python manage.py runserver 8000

  5. Switch to another terminal window.

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

    cd scratch-www
    npm install
    npm run translate
    
  7. 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 modifiable by the user, such as the home page's "What's Happening" 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.

Standalone usage

  1. Clone APIClone:

    git clone https://codeberg.org/heathercat123/apiclone.git
    cd apiclone
    
  2. Create superuser (admin/ST account): python manage.py createsuperuser

  3. Optional: Collect static files: ```python manage.py collectstatic`` This will create the static_prod directory for production environments.

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

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

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 modifiable by the user. 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.