Can I host an online makecode on my own website?

We are thinking to tailor it toward a special community event, and would like to host our own makecode online editor instead of redirect our users to to Is it possible?

Thanks

1 Like

There are a few ways to handle something like this – we do support creating targets / websites with https://makecode.com/target-creation . A fun example of that I like to use is https://makecode.buildbee.com/, which uses makecode to create 3d printer stl. The simplest form would typically be to use https://makecode.com/cli/staticpkg to wrap up a site that you can put up.

If you’re just intending to use it for an event and want to use an existing target like micro:bit but on your own event’s site, however, it would typically be easier to just embed us in the site – as an example, our skillmap implementation basically does just that: https://arcade.makecode.com/--skillmap w/ source here: https://github.com/microsoft/pxt/tree/master/skillmap – the specific place we’re handling some the embedding & optional message passing is here: https://github.com/microsoft/pxt/blob/master/skillmap/src/components/makecodeFrame.tsx#L132

1 Like

Hi @jwunderl , thanks for the detailed answer.

The simplest form would typically be to use https://makecode.com/cli/staticpkg to wrap up a site that you can put up.

If we go down this path, am I building runtime boxes of the whole “MakeCode Web App” and “Cloud compilation” components or am I only building the runtime boxes of the whole “MakeCode Web App”?

Morever, when I build and host the above static package, when users build a “user binary” (a kid coded a micro:bit app from the online editor and compiled the HEX file), which directory is that binary stored? How can make sure the disk of my hosting machine won’t be filled up over time?

however, it would typically be easier to just embed us in the site – as an example, our skillmap implementation basically does just that: https://arcade.makecode.com/--skillmap

This sounds like we will need to contribute to the source code, and wait for the next MakeCode production release?

Staticpkg builds a static set of files, so no cloud compilation included - for the simple pairs of bundled packages (e.g. the default project + the built in packages that have c++ builds) they should have the c++ built during staticpkg and included in the package, but it doesn’t include the cloud compilation bundle beyond that at all. (I don’t recall immediately, but it’s possible that it could fall back to our backends cloud compiler when they’re missing? I’m guessing no though). Extensions will also have limited support beyond the ones that get packaged in.

Embedding us in your site would not require any contributions; e.g. https://replit.com/@jwunderl/InfatuatedTastyInitialization#index.html . This will at least get you the editor to start, and you can see the messages in the file I linked that show how it persists the projects / etc.

Embedding the makecode there is a way to edit the blocks in the embed iframe?