gothinkster / realworld

"The mother of all demo apps" — Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more
https://realworld-docs.netlify.app/
MIT License
80.64k stars 7.34k forks source link

Glitch [Backend Environment] #47

Closed anishkny closed 3 years ago

anishkny commented 7 years ago

This is not a new stack per se, but more a super easy to use/remix hosting environment for NodeJS apps.

I ported the RealWorld NodeJS backend repo over to glitch here, with few tweaks:

https://glitch.com/edit/#!/realworld

(Instructions in the README)

To get it working, you would need a hosted MongoDB instance, which you can get from say mLab for free.

Glitch is an amazing platform that: "With working example apps to remix, a code editor to modify them, instant hosting and deployment - anybody can build a web app on Glitch, for free." More at glitch.com/about

In future, perhaps some of the amazing folks at Fog Creek could help get the RealWorld project tighter integration/higher visibility? 😉 wot say: @InPermutation @pketh @STRd6

EricSimons commented 7 years ago

This is 💯💯💯! We should totally have a link to this in the Node repo's readme. Would also def love to collab with Fog Creek in any way :)

Does Glitch support any databases out of the box? Or do you have to provide your own every time? i.e. if they support MySQL or something, maybe we could make a port of the Mongo version that could run natively on Glitch

InPermutation commented 7 years ago

Glitch doesn't provide a DBMS running for you, but you could use SQLite since the file system is persistent and writable. 🎏

anishkny commented 7 years ago

The RealWorld NodeJS app (repo) is fairly tightly coupled with MongoDB/mongoose. Hence MongoDB is pretty much a hard requirement. Fortunately, mLab quickly gives you a small hosted MongoDB with 0.5GB (See their Sandbox Plan).

Thus, Glitch+mLab is basically the lowest-friction in-browser way to start hacking away at an already working copy of the repo which is great for learning purposes!

If Glitch can consider offering something similar (lightweight MongoDB instance working out of the box with every new Glitch), I am sure other it would be useful to other users as well!

pketh commented 7 years ago

in that case, mlab is definetely my recommendation. I use glitch+mlab myself for some personal projects.

The reason glitch currently doesn't have a real db is basically because doing it right is a lot of work. (there's a reason mlab is a whole company). More details: https://support.glitch.com/t/deprecating-dynamodb-and-datastore-js-support/611

The downside of this approach of course is that the minimum first step new users will have to do is sign up for an mlab account and plug in their api/connection keys into .env though :(

We have a new feature where remix links can pre-populate the env field for a project using a scheme like https://glitch.com/edit/#!/remix/<project-name>?<var1>=<value1>&<var2=value2>.... A possible route we can go longer term is to partner with mlab to dynamically generate these values and create a new account for a new user, but we're still not set on that yet. In the meantime, you could use this link format to set up a dummy mlab account connection shared with all remixes, that way a new user could instantly see the app working and Then go sign up for mlab once they've been convinced of the value.

EricSimons commented 7 years ago

^ that's an awesome feature — lets totally get something like that set up for our node codebase(s)! We're also working on a way to live demo the frontend codebases as well, but that's due out in ~3-4 weeks :)

PS - @pketh I'm sure ya'll have thought of this already, but having integration partners (similar to how Heroku does it) would be a killer feature for glitch 💪

pketh commented 7 years ago

yup heroku-style partnerships is definitely something we'd be interested in doing more of, the pre-populated env field is a first step in that direction.

anishkny commented 7 years ago

I suppose to close this thread, perhaps this Glitch link can be added somewhere in the README as one way to quick start hacking on the NodeJS backend:

https://glitch.com/edit/#!/realworld

EricSimons commented 7 years ago

Also, we could create a sequelize version of the Node codebase so that it's literally one click to get up and running w/ the SQLite version on Glitch. A few folks have asked for Postgres support too, so this would be a nice 2-for-1 deal.