bartonhammond / snowflake

:snowflake: A React-Native Android iOS Starter App/ BoilerPlate / Example with Redux, RN Router, & Jest with the Snowflake Hapi Server running locally or on RedHat OpenShift for the backend, or a Parse Server running locally or remotely on Heroku
http://bartonhammond.github.io/snowflake/snowflake.js.html
MIT License
4.59k stars 613 forks source link

Retire Parse.com #51

Closed bartonhammond closed 8 years ago

bartonhammond commented 8 years ago

http://blog.parse.com/?mkt_tok=3RkMMJWWfF9wsRonv6rPZKXonjHpfsX64%2B8oUaK%2FlMI%2F0ER3fOvrPUfGjI4ARMNiI%2BSLDwEYGJlv6SgFTbHGMblmy7gNUxU%3D

mikedizon commented 8 years ago

I hear Amazon's service might have some legs.

bartonhammond commented 8 years ago

I'm having great success w/ OpenShift. Their free service handles a lot. I had bad experience w/ Amazon - my secret key thing got exposed when changing GitHub repo from private to public and within a day I had $7K+ charges. Fortunately Amazon worked w/ me but it was a severe pain to work through.

mikedizon commented 8 years ago

You committed your secret key thing to a repository, that was eventually made public, and that's Amazon's fault?

http://12factor.net/config

Sent from my iPhone

On Jan 28, 2016, at 19:25, Barton Hammond notifications@github.com wrote:

I'm having great success w/ OpenShift. Their free service handles a lot. I had bad experience w/ Amazon - my secret key thing got exposed when changing GitHub repo from private to public and within a day I had $7K+ charges. Fortunately Amazon worked w/ me but it was a severe pain to work through.

— Reply to this email directly or view it on GitHub.

joshkehn commented 8 years ago

Wait a minute. Your "bad experience" was that you made a mistake and they waived the billing? I'd consider that a good experience but maybe you were expecting something different?

bartonhammond commented 8 years ago

I didn't say that was Amazons fault. I said

I had a bad experience w/ Amazon

And I explained w/ the experience was. It was a bad experience when I saw $7K on my credit card. I didn't blame Amazon. I gave them credit for working w/ me. They were very cooperative.

bartonhammond commented 8 years ago

BTW, I realize now that my comment about Amazon inferred I wasn't interested in considering Amazon as a server. That wasn't my intended point - I was just sharing a personal experience that involved Amazon.

Believe me, the experince made me very aware of how important it is to protect keys! Lesson learned!

Amazon was very helpful - it took days to clear the credit w/ my credit card company, cancel all the Amazon services that were spun up w/ my credit card, etc. - it was pretty serious and time consuming. Without Amazons support and being attentive to the charges in the first place, I would have never known what was going on.

Again, Amazon was wonderful and very supportive. It was a bad experience in general. But the experience w/ Amazon in particular in response to the situation was awesome- they are a great company.

If there is interest in having a solution hosted on Amazon - I'm interested but I don't have any experience hosting a server on Amazon so all help would be appreciated.

fungilation commented 8 years ago

Please keep this thread open for Parse refugees like me. I'm just starting on my new app so in a way good that I'm not far along to switch.

More experience with cloud services, OpenShift vs. HAPI as backend options for a React Native app would be appreciated!

fungilation commented 8 years ago

I meant HAPI on OpenShift vs. Other options like on AWS. What about on Google Cloud?

mikedizon commented 8 years ago

Re: Google, there is a firebase fork of this project. It's not really Google, but it's owned by Alphabet.

I need to look into how authentication works with his project. Not sure if it was designed with the ability to swap in different authentication mechanisms. AWS's Cognito seems like the perfect fit, in my opinion at least.

https://aws.amazon.com/cognito/faqs/

On Friday, January 29, 2016, Gary F notifications@github.com wrote:

I meant HAPI on OpenShift vs. Other options like on AWS. What about on Google Cloud?

— Reply to this email directly or view it on GitHub https://github.com/bartonhammond/snowflake/issues/51#issuecomment-176815609 .

Sent from Gmail Mobile

fungilation commented 8 years ago

I don't like Firebase on cost, it's very expensive compared to Parse when I compared the two. So for comparison of more "DIY" solutions now that Parse is orphaned:

bartonhammond commented 8 years ago

@fungilation This will remain open - I hit the wrong button last night, I was very tired.

how authentication works with his project.

@mikedizon If you meant 'this' project, you can look at lib/Backend.js and lib/BackendFactory.js. This project allows for swapping the backend via the lib/config.js file.
Here's the important snippet from that file.

  backend: {
    parse: true,
    hapiRemote: false,
    hapiLocal: false
  }

Also, where is the fork for Firebase?

Also, in another project I'm looking into oAuth w/ Hapi - currently I have GitHub but it's definately a WIP: https://github.com/bartonhammond/reactnative-oauth-hapi.

Once I have GitHub oAuth stablized, I'll had a few other providers.

I don't have experience https://aws.amazon.com/cognito/faqs/ - it does look interesting.

mikedizon commented 8 years ago

So is it safe to say you're leaning more towards a DIY/Roll Your Own solution, over serverless? Seems that the cost of running and maintaining a server would be much higher than Firebase.

On Fri, Jan 29, 2016 at 12:03 PM, Gary F notifications@github.com wrote:

I don't like Firebase on cost, it's very expensive compared to Parse when I compared the two. So for comparison of more "DIY" solutions now that Parse is orphaned:

— Reply to this email directly or view it on GitHub https://github.com/bartonhammond/snowflake/issues/51#issuecomment-176862728 .

mikedizon commented 8 years ago

@bartonhammond I was pretty sure @Froelund was working on something

https://github.com/bartonhammond/snowflake/issues/30 https://github.com/Froelund/snowflake

On Fri, Jan 29, 2016 at 12:06 PM, Barton Hammond notifications@github.com wrote:

@fungilation https://github.com/fungilation This will remain open - I hit the wrong button last night, I was very tired.

how authentication works with his project.

@mikedizon https://github.com/mikedizon If you meant 'this' project, you can look at lib/Backend.js and lib/BackendFactory.js. This project allows for swapping the backend via the lib/config.js file.

Here's the important snippet from that file.

backend: { parse: true, hapiRemote: false, hapiLocal: false }

Also, where is the fork for Firebase?

Also, in another project I'm looking into oAuth w/ Hapi - currently I have GitHub but it's definately a WIP: https://github.com/bartonhammond/reactnative-oauth-hapi.

Once I have GitHub oAuth stablized, I'll had a few other providers.

I don't have experience https://aws.amazon.com/cognito/faqs/ - it does look interesting.

— Reply to this email directly or view it on GitHub https://github.com/bartonhammond/snowflake/issues/51#issuecomment-176865028 .

fungilation commented 8 years ago

@mikedizon, My assessment is that Parse's pricing is cheap enough that it's not worth it to roll my own, at least not for starter. Firebase however exceed that threshold.

bartonhammond commented 8 years ago

@mikedizon Thanks for the fork link - I see @Froeland has a lib/Firebase.js which has some implementation - no idea how far along @Froeland is.

I need a server implementation 'cause I do some heavy server side logic that pulls a lot of data and massages it down so the mobile can have decent performance. There are a number of APIs that the mobile w/ perform but for some data, the processing requirements exceed the ability of a mobile especially over a slow connection.

If one has no need for server side processing, I think server less is a great option.

mikedizon commented 8 years ago

@bartonhammond what kind of data, and how is it being massaged? it sounds like something that can easily be handled by a combination of Redshift, and/or AWS Data Pipeline, and accessed via AWS Lambda and AWS API Gateway. All of which requires no servers.

https://github.com/serverless/serverless

Is an interesting project, and it's still very early, but I like where it's going.

bartonhammond commented 8 years ago

https://github.com/serverless/serverless

Is an interesting project, it's still very early, but I like where it's going. Yeah - very interesting.

On Fri, Jan 29, 2016 at 11:48 AM, Michael Dizon notifications@github.com wrote:

@bartonhammond https://github.com/bartonhammond what kind of data, and how is it being massaged? it sounds like something that can easily be handled by a combination of Redshift, and/or AWS Data Pipeline, and accessed via AWS Lambda and AWS API Gateway. All of which requires no servers.

https://github.com/serverless/serverless

Is an interesting project, it's still very early, but I like where it's going.

— Reply to this email directly or view it on GitHub https://github.com/bartonhammond/snowflake/issues/51#issuecomment-176884396 .

fungilation commented 8 years ago

@mikedizon I take back my comment about Firebase being too expensive. It's actually about the same cost for anything beyond the free tier (Parse just have a bigger free tier), so I am looking at using it.

bartonhammond commented 8 years ago

sounds like something that can easily be handled by a combination of Redshift, and/or AWS Data Pipeline, and accessed via AWS Lambda and AWS API Gateway.

@mikedizon I looked at this a "tiny" bit and I have some questions.

The table below has some questions that I've answered wrt a NodeJS solution such as my Snowflake Hapi Openshift that reflect the things I like about it. But I don't know the answers to the AWS solution you mentioned.

@mikedizon Do you know the answers to the following? No biggie if you don't.

NodeJS AWS Question
[x] [ ] Can you run the solution locally?
[x] [ ] Can you interactively debug the solution?
[x] [ ] Is the solution portable, ie can I take the solution to a different vendor?
[x] [ ] Is there a free tier?
[x] [ ] Can I run a small app for free forever?
[x] [ ] Have you used this solution for any projects?
[x] [ ] Is there a public repo?
[x] [ ] Can Redis be installed?
[x] [ ] Can MongoDb be installed?
ghost commented 8 years ago

There's a solid place to start. It's called the beginning. I'm here for you guys:

https://github.com/jhabdas/react-native-webpack-starter-kit/

bartonhammond commented 8 years ago

@jhabdas I see absolutely no reason for a React Native app to use that setup - React Native already is using Babel and it doesn't require any additional setup. And I don't see what it has to do w/ retiring Parse.com. I appreciate your wanting to help but I don't get it. What am I missing?

mikedizon commented 8 years ago

He's trolling.

I'll answer your question after my coffee.

Sent from my iPhone

On Jan 30, 2016, at 09:37, Barton Hammond notifications@github.com wrote:

@jhabdas I see absolutely no reason for a React Native app to use that setup - React Native already is using Babel and it doesn't require any additional setup. And I don't see what it has to do w/ retiring Parse.com. I appreciate your wanting to help but I don't get it. What am I missing?

— Reply to this email directly or view it on GitHub.

ghost commented 8 years ago

@bartonhammond I did my best to explain on Disqus after featuring Snowflake following your comment on my blog. Sorry if my message seemed :trollface: but there's something to be said for extensibility and the ability to pivot on in a project which some starter kits seem to overlook. Rather than hashing it out here, if you're still curious, let's take the discussion to Disqus and I'll do my best to shed some light. Best of luck with the migration.

ghost commented 8 years ago

I noticed there was some conversation regarding use of keys, and I quite enjoyed the link @mikedizon provided. Here's a look at envelope encryption if you're not familiar. My team uses it with AWS, and the post linked helped inspire an issue against serverless.

mikedizon commented 8 years ago

@bartonhammond

NodeJS AWS Question [x] [x] Can you run the solution locally? [x] [x] Can you interactively debug the solution? (Yes, depending on what service you plan on utilizing, RedShift, ) [x] [x] Is the solution portable, ie can I take the solution to a different vendor? (NodeJs, so presumably, yes) [x] [x] Is there a free tier? (sort of, last I checked, API Gateway cost $3.50 per 1 million requests) [x] [x] Can I run a small app for free forever? (Well, you pay for what you use, so, see above) [x] [ ] Have you used this solution for any projects? I am using it now, yes. [x] [ ] Is there a public repo? github.com/serverless/serverless [x] [ ] Can Redis be installed? Yes [x] [ ] Can MongoDb be installed? Uses DynamoDB, which is comparable, but there are differences. Dynamo is easier to maintain, but Mongo has things like the ability to index within a structure.

bartonhammond commented 8 years ago

Summary in table format:

NodeJS AWS Question
[x] [x] Can you run the solution locally?
[x] [x] Can you interactively debug the solution?
[x] [x] Is the solution portable, ie can I take the solution to a different vendor?
[x] [x] Is there a free tier?
[x] [x] Can I run a small app for free forever?
[x] [ ] Have you used this solution for any projects?
[x] [ ] Is there a public repo?
[x] [ ] Can Redis be installed?
[x] [ ] Can MongoDb be installed?

Thanks for providing those answers @mikedizon

One thing that puzzles me is the answer to portability - from my reading of the docs one has to write code that utilizes all these various services and they appear to me to be Amazon specific - the database is Amazon specific, the events that you subscribe to, etc are Amazon specific - everything I read about seemed to be Amazon specific and thus not portable. Did I miss something?

mikedizon commented 8 years ago

Ah, right. Well that's where some of the limitations are. However, I'd say that all you have all the tools you need to migrate over to another platform if you choose to do so. I'd argue that if data warehousing, and analysis plays a significant role in your project, AWS is a worthwhile choice. Google's BigQuery is nice too, depending on what your needs are, but that's also a proprietary platform.

Theoretically, the functional logic of your code should be the same regardless of what database you're on, and what triggers it, right?

Sent from my iPhone

On Jan 30, 2016, at 12:01, Barton Hammond notifications@github.com wrote:

Summary in table format:

NodeJS AWS Question [x] [x] Can you run the solution locally? [x] [x] Can you interactively debug the solution? [x] [x] Is the solution portable, ie can I take the solution to a different vendor? [x] [x] Is there a free tier? [x] [x] Can I run a small app for free forever? [x] [ ] Have you used this solution for any projects? [x] [ ] Is there a public repo? [x] [ ] Can Redis be installed? [x] [ ] Can MongoDb be installed? Thanks for providing those answers @mikedizon

One thing that puzzles me is the answer to portability - from my reading of the docs one has to write code that utilizes all these various services and they appear to me to be Amazon specific - the database is Amazon specific, the events that you subscribe to, etc are Amazon specific - everything I read about seemed to be Amazon specific and thus not portable. Did I miss something?

— Reply to this email directly or view it on GitHub.

bartonhammond commented 8 years ago

Theoretically, the functional logic of your code should be the same regardless of what database you're on, and what triggers it, right?

Yeah - but that's the problem, it's a theory....

mikedizon commented 8 years ago

The outcome of which is determined by the decisions of the coder.

Sounds like pebcak.

Sent from my iPhone

On Jan 30, 2016, at 12:57, Barton Hammond notifications@github.com wrote:

< Theoretically, the functional logic of your code should be the same regardless of what database you're on, and what triggers it, right?

Yeah - but that's the problem, it's a theory....

— Reply to this email directly or view it on GitHub.

fungilation commented 8 years ago

@jhabdas was being rude, but webpack with greenkeeper for keeping all dependencies up to date does sound good. I have no opinion on webpack or otherwise for managing dependencies as long as app building is easy. So may I ask as a neutral onlooking newbie to both webpack and RN, what is your recommendation on where to start and why if I need the following?

ghost commented 8 years ago

@fungilation An light-weight development entry point for RN with Redux may be soundredux-native. I haven't surveyed the landscape recently, but I took a peek at the project and it looks like a solid starting point.

IIRC Firebase has some limitations WRT remote push notifications Parse did not. However, there are alternative services popping up to handle RN apps, notifications and app deployments in innovative and simplistic ways - they're just harder to find due to limited community exposure.

As for hot loading, I didn't personally find much use for it while developing my iOS app, and I have not had a lot of luck with it in combination with source maps in vanilla React development workflows.

If you're looking for a simple workflow the react-starter-kit got a lot right with their webpack and BrowserSync integration, and I'd like to eventually port over some of their concepts into my kit. And if Redux is here to stay (I hope it is) I'll probably be bringing that over as well.

Auth should be left up to the implementation IMHO.

fungilation commented 8 years ago

Agreed that auth is more "userland" and you can just drop in whatever library you want.

Redux is the (clear) way to go for me, it's functional with bonus of undo/redo and is the fastest adopted implementation of any for flux. I'm betting my app's future on it being here to stay.

react-starter-kit looks popular, though I'm looking for RN not react proper, and redux over flux. Firebase can just be a mixin include, though having something like webpack packaging everything up and updated (by greenkeeper) is appealing. FYI, I'm a Meteor refugee and having all the dependencies managed and updated is so nice.

ghost commented 8 years ago

@fungilation My favorite part of the RN v0.18.0 release is that it now uses React from NPM. As a result, I think much of the scaffolding currently used to make RN play nice with existing Webpack tooling should start to vanish. Also, Greenkeeper has been a savior while I've been focused on other projects. I was unaware the Meteorites out there enjoyed such a delightful workflow automation.

fungilation commented 8 years ago

Ya just read that. The less dependency outside of NPM the better. Does it mean react-starter-kit should be a easy swap for React to RN? Same with flux to redux?

This looks promising for fitting my bill: https://github.com/LeoLeBras/react-native-redux-starter-kit

ghost commented 8 years ago

@fungilation Perhaps, but not for Flux to Redux (though I'm sure they're porting or will port soon if you're comfortable waiting). If you're looking for the biggest bang for your buck, and you're capable of pivoting quickly when changes arise, check out Este - a Universal starter kit on my list of Awesome React Boilerplates. Be forewarned, however, some of their maintainers are not as affable as @bartonhammond.

If you can't find something that suits your needs I'd recommend starting as small as possible and piecing together the best of each app or kit.

fungilation commented 8 years ago

Haha ya I was just reading Este already. They seem popular with good docs in wiki. A fatter stack than I need right now and opinionated. You maintain your own stack so I assume you want to keep your own starter, being a lot more minimalistic?

ghost commented 8 years ago

@fungilation yes - hit me up on my blog or drop into my kit's chatroom for additional discussion

ghost commented 8 years ago

https://medium.com/p/600839abebdf

bartonhammond commented 8 years ago

Wow! @jhabdas Will check out later when I come up for air!

ghost commented 8 years ago

@bartonhammond someone posted it in the Reindex Slack channel and I felt it was relevant. Hope the info helps relieve some of the pressure on this ticket.

fungilation commented 8 years ago

Doesn't add too much to this discussion though. I did note Parse Server is a migration target and with a fair bit of interest, I'm sure it'll be well maintained and supported by the community.

Call me lazy, but for small shops, the appeal of Parse and Firebase is that we need no devops, the backend server just works. Self-hosting is an option just as it's always been the only option, just a step backward from managed cloud services in terms of time and convenience.

Anyways I digress. A Parse Server wrapper would certainly be an alternative to hosting your own Hapi server?

bartonhammond commented 8 years ago

@fungilation Oh my, I totally missed your note abut Parse Server!

Anyways I digress. A Parse Server wrapper would certainly be an alternative to hosting your own Hapi server?

I don't have time right now to look into Parse Server. Looks like you can run locally so that's a plus.

Are you interested in doing a PR w/ Parse Server?

Whether Parse Server becomes a viable alternative will depend on how it's received, embraced, and enhanced over time.

I've been using Hapi on OpenShift for a couple of months now and I've great support/performance/stability. Their free tier has quite a lot to offer an indie like me. Hapi is battle tested w/ WalMart so it's proven itself and OpenShift is very stable. It's a great cloud server solution, imo.

bartonhammond commented 8 years ago

Need to consider https://syncano.io/

mikedizon commented 8 years ago

Now open to the public http://aws.amazon.com/mobile/sdk/

klatchbaldar commented 8 years ago

I would consider an option for Auth0 integration. They have good native integrations for iOS/Android and a significant free tier.

bartonhammond commented 8 years ago

Once v1.2.0 is final, I will be adding a http://serverless.com/ solution. Stay tuned!

ghost commented 8 years ago

@bartonhammond I wrote a quick crash course on using Serverless if it helps the cause.

bartonhammond commented 8 years ago

Thanks for sharing that!

mikedizon commented 8 years ago

Have to look at how well the JavaScript aws-sdk plays with react native.

Sent from my iPhone

On Aug 27, 2016, at 17:31, Barton Hammond notifications@github.com wrote:

Thanks for sharing that!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

wookiem commented 8 years ago

I've been using parse-server for a few weeks with pretty good results. The changes to Snowflake to add support are quite minor. I'll be issuing a PR shortly...