Share code between two similar React Native apps

Viewed 279

I need an advice about the architecture and code organize of my app. I developed React Native application. Our business requires two apps instead one. The current app - for the current target audience. The second app should be for other target audience. Each app should have web-version. Part of the code in the application will be the same (business logic, features, common screens). The other part will be different. The app will have the different design theme, texts, icons, auth methods, payment methods and some more features.

I see it so:

├── mobile
│   ├── app1
│   │   ├── .env
│   │   ├── index.android.js (symlink to ../../lib/mobile/app/index.android.js)
│   │   ├── index.ios.js (symlink to ../../lib/mobile/app/index.ios.js)
│   │   ├── ios (symlink to ../../lib/mobile/app/ios)
│   │   ├── android  (symlink to ../../lib/mobile/app/android)
│   │   ├── src
│   │   ├── node_modules
│   │   └── package.json
│   └── app2
│       ├── .env
│       ├── index.android.js (symlink to ../../lib/mobile/app/index.android.js)
│       ├── index.ios.js (symlink to ../../lib/mobile/app/index.ios.js)
│       ├── ios (symlink to ../../lib/mobile/app/ios)
│       ├── android  (symlink to ../../lib/mobile/app/android)
│       ├── src
│       ├── node_modules
│       └── package.json
├── web
│   ├── app1
│   │   ├── src
│   │   ├── .env
│   │   ├── app.js
│   │   └── package.json
│   └── app2
│       ├── src
│       ├── .env
│       ├── app.js
│       └── package.json
└── lib
    ├── mobile
    │   ├── app
    │   │   ├── index.android.js
    │   │   ├── index.ios.js
    │   │   ├── ios
    │   │   ├── android
    │   │   ├── src (shared js-code for all mobile apps)
    │   │   └── package.json
    ├── web
    │   └── app
    │       └── src (shared js-code for all mobile apps)
    └── src (shared and business-logic js-modules for all apps)

Who had a similar experience? I will be glad to hear any ideas or advice from you.

0 Answers
Related