leopard-js / leopard

Library for making Scratch-like projects with JavaScript.
https://leopardjs.com
MIT License
139 stars 26 forks source link

Leopard community website & project sharing #116

Open PullJosh opened 2 years ago

PullJosh commented 2 years ago

This issue is for discussing whether building a community is a good idea, and how to go about it if so. This is NOT the time to bikeshed over minor technical details. We can do that later. 😉

In the mid- to long-term, it might be nice to have a community website where users can create, edit, and share their Leopard projects, as well as discuss and collaborate with each other.

This would replace the current system of sending people over to CodeSandbox.

Is building such a community a good idea?

Community and Moderation

The Scratch Team does an exceptionally good job of moderating and fostering a community environment. A few things they get right:

I imagine that for an older audience, slightly more relaxed rules could be appropriate. In particular:

Perhaps Snap! could be an inspiration in this area.

Technical Considerations

Users must be able to edit and view projects which are made up of multiple files.

We could run some kind of bundler (like Parcel) on the user's code, but then you have to install npm dependencies server-side so that they can be bundled, which is a pain. Perhaps better to have users import their dependencies from unpkg or skypack and just serve their code directly, since browsers can handle JavaScript modules with import natively.

Without the overhead of any bundling, the project editor essentially just becomes a static file host. You write HTML, CSS, and JavaScript, along with other assets like images and sounds, and we serve your files directly. No meddling necessary.

That's pretty easy!

As far as security goes, we can get 90% of the way there just by serving projects from a separate domain. If the community site lives at leopardjs.com, then each project could have its own subdomain like my-project.other-leopard-domain.com. If each project really is just a collection of static files, then other-leopard-domain.com could literally just forward requests on to an S3 bucket (or equivalent).

Funding

I am happy to pay some hosting costs out of my own pocket, within reason.

To keep costs down, we could limit the size of assets that users are allowed to upload (per asset, per project, and/or per user), and that would probably help a lot. But if the community grows a lot or people want to host large projects, there would need to be a reasonable source of income.

One option is simply to charge users money if they want to store large assets. This is honestly pretty reasonable if the issue is certain users making huge projects. But if the problem is a large number of users who each create small projects, you really want the website to be free for them to use, and then you need a source of funding.

I am not sure where that money would come from.

micahlt commented 2 years ago

Is building such a community a good idea?

Heck yeah 🎉

as well as discuss and collaborate with each other

This would make Leopard absolutely amazing. Comments on Scratch right now aren't realtime and there's not really any good way to collaborate (besides remixing, of course). Good collaboration and discussion tools could really set Leopard apart.

sharing a small amount of personal information is appropriate when collaborating with others or growing out of a community

Definitely agree on this one. As much as I learned from coding on Scratch, I learned more from being involved in the Advanced Topics and the other Scratch-centric communities offsite, and I wish that the Scratch Team would appreciate that more.

each project could have its own subdomain

Are you saying that the entire project page (e.g., comments, user reactions, etc) would be on these subdomains or that the project would be sandboxed on such a subdomain and then be iframed on the project page?

the problem is a large number of users who each create small projects

This is the main problem. I'm going to keep an eye out to see if Fosshost will reopen applications. They host lots of cool open-source projects like Turbowarp and they might be interested in getting involved in some capacity. If we can get an MVP up and running, we could accept donations from users and/or companies.


Aside from those thoughts, I have (of course) my two cents on the stack. React + Next (or Remix?) + serverless (Vercel/Netlify/Lambda) generally has proven to be a solid tech stack. I just think that serverless is just a ton more affordable, scalable, and makes a lot more sense than consistently running servers.

All in all, can't wait to see where this goes!

PullJosh commented 2 years ago

each project could have its own subdomain

Are you saying that the entire project page (e.g., comments, user reactions, etc) would be on these subdomains or that the project would be sandboxed on such a subdomain and then be iframed on the project page?

The second one. Projects would be sandboxed to a subdomain and then iframed into the project page on the social site. This gives security benefits and also makes it possible to effectively publish your project as its own website. (Just visit the project subdomain directly rather than loading it in an iframe.)

This is the main problem. I'm going to keep an eye out to see if Fosshost will reopen applications. They host lots of cool open-source projects like Turbowarp and they might be interested in getting involved in some capacity. If we can get an MVP up and running, we could accept donations from users and/or companies.

That's cool! I've never head of them.

micahlt commented 2 years ago

The second one. Projects would be sandboxed to a subdomain and then iframed into the project page on the social site. This gives security benefits and also makes it possible to effectively publish your project as its own website. (Just visit the project subdomain directly rather than loading it in an iframe.)

Cool! That's what I thought you meant.

That's cool! I've never head of them.

They support a lot of really neat projects, but their applications are rarely open. Like I said, I'll keep an eye out!

PullJosh commented 2 years ago

In the last 28 days, Leopard users have converted over 3,000 projects to JavaScript. And yet, very few people are discussing Leopard or sharing their projects (at least in the places I'm looking).

In the long term, I like the idea of a social project sharing website. But I am going back to school soon and will not be available for ongoing moderation. If I take this on, it should wait until next summer.

So what can we do in the short term to help Leopard users find each other more easily? I have an idea.

Every time someone converts a Scratch project to JavaScript, show a link to that project (plus its CodeSandbox equivalent) on the Leopard homepage. So that when you visit, you can see the projects recently converted all around the world. (For privacy, we could store only conversions of shared Scratch projects.) This would help Leopard users find each other.

All of the community discussion would still happen on Scratch, which takes the burden of moderation off our shoulders, but it would hopefully help the Leopard users feel more connected. (And help us see and appreciate the value of our own work!)

Is this a good idea?

micahlt commented 2 years ago

Every time someone converts a Scratch project to JavaScript, show a link to that project (plus its CodeSandbox equivalent) on the Leopard homepage.

This sounds like a great compromise while we continue planning for a more complex site! Where would you host the list of recently converted projects?

PullJosh commented 2 years ago

Where would you host the list of recently converted projects?

Not sure. Are there any places with free SQL database hosting? It could be slow and small; it just needs to work.

micahlt commented 2 years ago

I've used PlanetScale for some smaller-scale projects - they have a pretty generous free tier with 5GB of storage. Should be more than enough.

PullJosh commented 2 years ago

@micahlt How does this look to you?

screenshot
micahlt commented 2 years ago

I'd reduce the border radius a bit to match the rest of the UI, but other than that it looks good!

PullJosh commented 2 years ago

It's live! 🎉

I am really looking forward to checking on this list from time to time. We'll see how frequently people use the website.

micahlt commented 2 years ago

Looks absolutely amazing! Love the skeleton loading UI as well!

PullJosh commented 1 year ago

@towerofnix @adroitwhiz I am revisiting this now because it was mentioned in #172. We could definitely build a community website if we wanted to... Do y'all think people would use it enough to justify the effort?