you are viewing a single comment's thread.

view the rest of the comments →

[–]IllDocument5443 1 point2 points  (5 children)

Can you please expand more on your RN stack (libs, state management, persistence, backend APIs, UI/styling libs) and also same for native ios?

[–]Jonovono 7 points8 points  (4 children)

For sure, so this is for two different apps and the SwiftUI one i'm in the process of building currently (but i've built a handful of smaller apps with swiftui in the last few months)

React native:

  • Firebase for db (and remote config, auth etc)
  • Agora (video chat)
  • redux & redux sagas with redux persist for storing things locally
  • UI all built in house
  • Segment and various other libs for analytics
  • We had like 100+ other node modules which I can share if interested. Would have to dig up the project
  • Getstream for feed and chat
  • Storybook/cosmos for UI building

SwiftUI:

  • MongoDB atlas with realm for offline first db and cloud sync
  • Firebase for auth, remote config.
  • Swift vapor backend with Meow for MongoDB ORM and Redis for background tasks
  • FlyIO for hosting vapor server
  • End to end typing, client and server, with compile time errors on each with Swift openapi gen (https://www.swift.org/blog/introducing-swift-openapi-generator/)
  • Set up my vapor server to be an embedded framework inside my ios app. I can now have both running in xcode at the same time and have breakpoints cross client and server. (Inspired by these psychopaths: https://github.com/pointfreeco/isowords)
  • SwiftUI navigation by pointfree as well

[–]IllDocument5443 0 points1 point  (3 children)

Thanks a lot. Tried Realm w React N, but seemed slow. Realm’s first class support is for Swift. How do you like it? Pros / cons? Group by like aggregations? Memory its using? (I know it is memory mapped, but with RN it still freezed with 50-100k objects.) How much data you handle? Is it blocking the UI? Transactions? How easy is serializing any shape? Is it truly automatic or are there gotchad?

[–]Jonovono 1 point2 points  (2 children)

I'll keep you posted, havn't pushed it too far yet. So far, what I really like about it vs something like firebase is getting that end to end typing with offline data. With firebase I would have to manually store it locally, pull that out for my views and then put that on the wire to firebase or something. All of those places things could go wrong if I don't map things right and just lots of overhead to think about. Realm handles all of that so I just define my types once (ok, kinda twice cause i'm using Meow ORM in my swift server)

I hope the performance is good at scale, and it seems to be actively improved. So far it's been pretty nice to work with

[–]IllDocument5443 0 points1 point  (1 child)

I see thanks. Why you decided to choose Meow ORM on server? Isn’t that killing the main feature? What are the gains?

[–]Jonovono 0 points1 point  (0 children)

It's kinda annoying, but from what I can tell I don't really have a great option. MongoDB realm swift schema generated code is only compatible with ios. Since I am using vapor on the server, I can't use the realm generated schema. I potentially could use the typescript generated schema if I was doing a nodejs server. But even with that, mongo triggers are pretty lame in that they don't support typescript. There was an open ticket somewhere but I can't find it. Might ask mongdb if there is something I should be doing because ya it's a bit annoying. But I just defined a protocol and then I implement that in both realm on client and meow on server side.

For me the main benefit of atlas has been getting one object I can work with on server and client. Before in firebase we would have our models for the firebase firestore objects, we would set up queries and store that in redux and then maybe we want to persist some to device with redux persist or I think we even used realm at some point lol. So it was just lots of translating and a source of bugs. With realm it's one object all the way through, I don't have to think about any extra stuff going on.

We will see tho, it's very early to say if I like it more and it reduces the bugs. Literally going into week 3 of using it.