Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

jerinjohnk/rnmultibrand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-tenancy in React Native apps

On a path to building multi-branding apps in React Native.

GitHub contributors GitHub license GitHub issues

Intro

This repo is a practical implementation of ideas, discussed in the Medium article, about creating a multi-branding app from a single source code file using gulp


Getting Started

1. Clone and Install

# Clone the repo
git clone https://github.com/jerinjohnk/rnmultibrand.git

# Install dependencies
1) rnproject open a terminal
yarn

2) rnmultibrand(root) open a terminal
npm install gulp

2.1 Run APP1

These steps are used to run the first flavor app1.

# Open Gulpfile.js change app flavor value
var appFlavor = "app1";

# Root folder terminal run
gulp start

# Run the app
react-native run-ios
or
react-native run-android

Gulp start

First creates an src folder -> copies main folder content -> overrides with selected app flavor -> starts a watcher that watches selected app folder for any changes. If a file changes, it starts the overwrite task.

2.2. Run APP2

# Open Gulpfile.js change appflavor value
var appFlavor = "app2";

# Close watcher if it's running
# Root folder terminal run
gulp start 

3. Change App specific file

Try out changing any style, value etc present in the app folder for which watcher is running u will find the app updates during hot reload or on reload.

Further Help?

This repo is a step towards creating multi-branding app in React Native. Right now have used gulp to automate this process. Would improve the scripts and build process further once I have successfully implemented them. Any suggestions for the same would be greatly appreciated.


If there are any other ideas presented in this repo, that you think worth mentioning - feel free open a pull request :)

About

Multi-tenancy in React Native apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published