Welcome to this repository which contains the code of the web clients and the native iOS and Android apps of the Trillion Tree Campaign at https://www.trilliontreecampaign.org/ written with React-Native. For contributions please read our contribution guide as well as our code of conduct and the following information:
ios
houses the iOS project files, web
houses the web configuration, assets and index.html, and android
contains Android project files.The app
contains the react code base for all platform i.e components, reducers, containers etc.
index.web.js
is the entry point of web platform build, index.js
is the entry point of both iOS and android platform build process.
Copy .env.develop.sample
to .env.develop
and add the necessary API keys for your development environment.
Install nvm following instructions from https://github.com/nvm-sh/nvm#install--update-script
Run nvm install && nvm use
to install and use required version of node.
!!! Web setup is deprecated. Please visit https://github.com/plant-for-the-Planet-org/planet-webapp
Run following commands
bash
npm install
npm start
To run the app as prod, useful for testing features like (hashed js/css):
npm run start-prod-server
bash
brew install node
brew install watchman
npm install -g react-native-cli
npm install
cd ios && pod install
Build and run the app in development mode deployed from Metro Bundler in an iOS simulator (starts Metro Bundler automatically if not already running, also starts iOS simulator):
bash
npm run ios
If you have problems with a cached version of the bundle, you can stop the Metro Bundler and manually start it with the reset cache option:
react-native start --reset-cache
Steps for setting up Dev Env for android on MAC is as follows:
bash
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
bash
brew install node
brew install watchman
npm install -g react-native-cli
npm install
Build and run the app in development mode deployed from Metro Bundler (starts Metro Bundler automatically if not already running) on an emulator or device. You need to start an Android emulator or attach a device manually before:
bash
npm run android
If you have problems with a cached version of the bundle, you can stop the Metro Bundler and manually start it with the reset cache option:
react-native start --reset-cache
This project uses GitFlow (https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) with Master-Branch master
and Development-Branch develop
. The Master-Branch will be automatically released by CircleCI to the production system. There are currently some more protected branches also build by CircleCI automatically and mapped to test backends using the branch name as subdomain.
App Versioning Guide
eg: Version M.F.B V 1.1.10
M = Major Changes F = Feature Addition B = Critical Bug Fixes and Additions
Release candidate can have the target version number
V 1.1.11
RC 1
Beta and Alpha builds can also have target version number
V 1.1.11
B 12
V 1.1.11
A 12
[increment per release]
The deployment and production of this app is also possible due to support from open-source software contributors.
Fixer.io
Plant-for-the-Planet App is free software, and is released under the terms of the GPL version 3 or (at your option) any later version. See license.txt.