React-native + web monorepo with graph ql api for chatting apps, utilized monorepo so that we could share the same context, logic, & primitive UI component between those 2 platforms, then finally we could write different screen layout between different platform but still able to maintain the same functionality.
Mobile + Web
Chat
Unsent Chat
user can tap on the unsent chat & it will try to sent the chat again
Infinite Scroll
user can scroll to the top to fetch the earlier chat data
Saved text editor
the text editor state would be saved after the user reopen the app
Switch user
Switching between users
Switch channel
Switching between channel
Message exchange between mobile & web
after you clone the repo you may need to set up it using yarn berry
version
- Run
yarn set version berry
at the root of project. It will create a.yarnrc.yml
file. - Add the following lines to
.yarnrc.yml
to ensurenode_modules
directories are all created in each workspace:
nodeLinker: node-modules
nmHoistingLimits: workspaces
nmHositingLimits
tells how to hoist dependencies for each workspace. By setting it toworkspaces
all dependencies will be installed in each workspace'snode_modules
rather than being hoisted to the root folder. This means you can now you can safely thenoHoist
section in the root'spackage.json
.
Check out Yarn 2+'s "getting started" guide for more info.
then you can build the react native app normally inside this path
/packages/mobile
you can go to /packages/mobile/ios
folder to do the pod install
after that you can start yarn ios:metro
to run the metro bundler
If you're going to run the web version you can just run:
yarn web:start
Development and build commands:
yarn android:metro
: Start the metro server for Android/iOSyarn android:start
: Start developing the Android appyarn android:studio
: Open the android app on Android Studioyarn ios:metro
: Start the metro server for Android/iOSyarn ios:start
: Start developing the iOS appyarn ios:pods
: Install iOS cocoapods dependenciesyarn ios:xcode
: Open the iOS app on XCodeyarn web:start
: Start developing the web appyarn web:build
: Create a production build of the web app