1
2
Fork 1
mirror of https://codeberg.org/heathercat123/apiclone.git synced 2026-04-29 19:39:34 -04:00
Mirror of a WIP clone of the Scratch API, ScratchR2, and others made in Django
  • HTML 85.3%
  • JavaScript 6.5%
  • Python 5.3%
  • CSS 2.9%
Find a file
2026-04-29 18:09:58 -04:00
_docs Stub? out WWW Explore 2026-04-27 17:30:20 -04:00
accounts README update 2026-04-22 18:10:14 -04:00
apiclone Begin? linting forums 2026-04-29 18:09:58 -04:00
base_comments Fix clicking comment form while signed out not opening modal 2026-03-09 08:09:05 -04:00
djangobb_forum Begin? linting forums 2026-04-29 18:09:58 -04:00
educators Fix What's Happening showing activity from followers 2026-04-18 10:25:08 -04:00
files Start implementing classrooms 2026-03-06 18:51:20 -05:00
galleries Implement Scratch Design Studio 2026-04-11 15:31:12 -04:00
homepage Fix error 500 on featured project API 2026-04-12 23:49:15 -04:00
hosts Stub? out WWW Explore 2026-04-27 17:30:20 -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 Start implementing classrooms 2026-03-06 18:51:20 -05:00
news Lint the whole thing 2026-01-30 17:14:04 -05:00
ngapi Deprecate lib.demo 2026-03-05 09:12:50 -05:00
notifications Fix What's Happening showing activity from followers 2026-04-18 10:25:08 -04:00
pagination Pagination: update "except" syntax 2026-02-20 07:54:40 -05:00
projects Fix XSS 2026-03-26 17:11:46 -04:00
scratch_admin Implement Homepage Curator 2026-04-11 15:54:18 -04:00
siteapi Begin? linting forums 2026-04-29 18:09:58 -04:00
static Fix What's Happening showing activity from followers 2026-04-18 10:25:08 -04:00
templates Move homepage view to new app 2026-03-26 08:03:52 -04:00
userprofiles Implement Homepage Curator 2026-04-11 15:54:18 -04:00
.gitignore HttpResponseForbiddened -> PermissionDenied and Teachers stuff 2026-02-26 17:32:04 -05: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 README update 2026-04-22 18:10:14 -04:00
requirements.txt Remove unused type vars from hosts.api.users.views 2026-04-22 18:22:13 -04:00

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

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. Optional: Collect static files: ```python manage.py collectstatic`` This will create the static_prod directory for production environments.

  6. Start APIClone: python manage.py runserver 8000

  7. Switch to another terminal window or tab.

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

    cd scratch-www
    npm install
    npm run translate
    
  9. 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.

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

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. Optional: Collect static files: ```python manage.py collectstatic`` This will create the static_prod directory for production environments.

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

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

At this point, you may desire to override a few 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 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.

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.