r/reactnative • • Jan 03 '20

An app I built using react native

207 Upvotes

64 comments sorted by

View all comments

16

u/_rustafarian Jan 03 '20

Hi there. I just wanted to showcase an app I was working on recently. It uses Typescript and Apollo Client on the front-end and GraphQL (Hasura) and firebase on the back-end. Please feel free to ask any questions.

3

u/MikeyN0 Jan 03 '20

What's the interaction between GraphQL and Firebase?

8

u/_rustafarian Jan 03 '20

I use firebase for authencation, so whenever a new user is created, a cloud function is triggered to store that user in my GraphQL backend. I also use cloud functions for sending SMS messages and making payments.

2

u/[deleted] Jan 03 '20

Is nodejs with mongoDB as viable as firebase? Do I have to pay to use firebase?

1

u/_rustafarian Jan 03 '20

I like firebase better because I don't have to setup my own backend, maintain it or scale it. Firebase just handles all of that for me and it's very easy to get started with. As for pricing, It has a generous free plan and also there's a pay on the go plan, so you'd only pay for the resources you're using.

1

u/Jeffylew77 Jan 03 '20

u/_rustafarian What are the benefits to using Apollo Client?

1

u/_rustafarian Jan 03 '20

If you have a graphical backend, you have to use a GraphQL client on the front end and Apollo Client is most popular one. I like it because it is featreful and works really with the react. Here is somethings I like about it:

  • supports react hooks

  • provides the different UI states when fetching data (loading, error, data)

  • caches things internally

1

u/Jeffylew77 Jan 07 '20

u/_rustafarian did you use Firebase cloud firestore as your database? That’s what I’m using and I’m looking to utilize in memory cache. I’m also redux, react redux, redux saga, and redux saga Firebase for global state/async calls if that changes anything.

2

u/_rustafarian Jan 07 '20

No I'm not using firestore. The parts of firebase I'm using are hosting, cloud functions, authentication, analytics and crashlytics. I'm using Postgres for my database in combination with Hasura. https://github.com/hasura/graphql-engine.

1

u/Jeffylew77 Jan 07 '20

Any reason you chose Postgres + hasura instead of cloud firestore? The app I’m building will eventually be used at scale, so I still trying to figure out the best path to go. Eventually I want to move over to AWS, but Firebase is easier to setup

1

u/_rustafarian Jan 08 '20

Well I wanted a GraphQL backend and Hasura is just a joy to work with and it's very performent as well. It can handle hunderds of requests per second on a relatively cheap machine. I still use cloud functions but for other things like sending sms messages and making payments.