Discuss Scratch

kmitov
New Scratcher
18 posts

Building a backend for scratch-www

I am exploring scratch-www and trying to build my own backend

I have changed the webpack config and the project and assets host. But I can not understand the flow of the components

1. Is scratch-www really supposed to work by just changing the project and asset host and responding the requests from the server or there are more things that should be done?
2. Looking at the ProjectView

render () {
debugger;

// Only show GUI if the project has no id, is a loaded local project, or has the project token loaded
const showGUI = (!this.state.projectId || this.state.projectId === ‘0’ || this.state.isProjectLoaded ||
(this.props.projectInfo && this.props.projectInfo.project_token));

I can see how we need a projectId or projectInfo

But I can't find where is this projectInfo loaded. There are no calls to the projectHost when visiting
/projects/1123/editor

This number 1123 is not used for getting the project and I can't figure out why is there no request to the server

In general I am trying to understand the steps for building my own backend.
CST1229
Scratcher
1000+ posts

Building a backend for scratch-www

kmitov wrote:

But I can't find where is this projectInfo loaded
I think it's loaded from api.scratch.mit.edu, whose URL might be hardcoded (and would be in www).
kmitov
New Scratcher
18 posts

Building a backend for scratch-www

I got the using Save now.

The Save now moves through the project state and it reacher


case START_MANUAL_UPDATING:
debugger;
if (state.loadingState === LoadingState.SHOWING_WITH_ID) {
return Object.assign({}, state, {
loadingState: LoadingState.MANUAL_UPDATING
});
}
return state;

But here as we are not showing a project with id we can not save it. The state stays the same. So it really is like scratch-gui by default is not using the project host to try to save projects on it.
kmitov
New Scratcher
18 posts

Building a backend for scratch-www

Hey guys,
I've managed to build a complete backend of scrath-gui. I is working pretty well. I also managed to extend scratch with a few tabs additional to the code and costumes tab and plug in the whole lifecycle. Now I am at the process of building an extension that could store additional information.

Powered by DjangoBB