Search code examples
react-nativereact-reduxarchitecturemobx-reactsocial-media-like

React native Social Media App Architecture


I am creating a social media application in react native. This application will be based on offline-first app architecture. As i am new to react native, I have come across multiple things like state management, etc.

Few things are still unclear to me

  1. If I am creating an offline-first app. Do I need redux in that case too?
  2. For a social media kind of application is redux or Mobx is required?
  3. How to manage offline-first application in react native (just need a general idea)?
  4. I am planning to use the watermelon database any suggestions on this?

Thanks in advance


Solution

  • -Redux or Mobx are state management, they are handle states. Example imagine you have a data that is be shown multi screens , when you just update local storage , states in the another screens will not update (unless you have a mechanism that every time write data in local storage getting data after that , I think it's not be good idea) , so you need update states faster to better way.

    -For example when you want develop an app like social media in offline mode at the first you must keep user token that generated from server In the local storage (Async storage good choice for this case) , if user has token in the device navigate he/she to destination screen and be shown to him/her the stored data,server validate user token with every request.

    -In my opinion , between react native local storages , Realm is easy to use , fast and have useful documents to use that.