# Humand Mobile App - React Native [![Build Status](https://app.bitrise.io/app/b87181de71171a33/status.svg?token=eIl3uReMeJ0DrcwxGBU7tg&branch=master)](https://app.bitrise.io/app/b87181de71171a33) ## Prerequisites Follow the [official guide](https://reactnative.dev/docs/environment-setup) to properly setup your RN environment. --- ## Project Setup The following files are needed to run and deploy the project. If you modify any of them, remember to update the Bitrise configuration, the Drive file/s and let your teammates know about the change. ### ENVs - `keys.dev.json` - `keys.stg.json` - `keys.prod.json` You can download them from [Drive](https://drive.google.com/drive/folders/1u9O9kKMJCYXRxgXm-GFEFj17W7QxaHrI) and place them in the root folder. ### Dependencies/NPM Add into `.zshrc`: - `export NPM_TOKEN_GOOGLE_SIGN_IN=**********************` You can find `NPM_TOKEN_GOOGLE_SIGN_IN` into [Drive](https://docs.google.com/document/d/18E1wSR6i2LNyVm-rw1iyd7ywVj65kC1RmhvYs7E5fGI) ### Android - `/android/app/humand.keystore.properties` - `/android/app/HumandKeystore.jks` You can download them from [Drive](https://drive.google.com/drive/folders/1tfU1W2DJE8BoOIYSVEZk-GYpkH45pT6W) and place them in the [Android](/android/app/) project folder. ### iOS Install pods with: `npx pod-install` or `cd ios/ && pod install`. Add the corresponding Apple certificates (Development & Distribution) in your Mac's Keychain Access app. Add the corresponding Provisioning Profile files in your Xcode app (Signing & Capabilities section). --- ## Run App The following environments are supported: - `Dev` - `Stg` - `Prod` You can check these scripts in the [package.json](/package.json) file to run an Android/iOS simulator for each environment: - `android:prod` - `android:stg` - `android:dev` - `ios:prod` - `ios:stg` - `ios:dev` For example: `yarn android:dev` or `yarn ios:dev` --- ## Build App ### Android You can check these scripts in the [package.json](/package.json) file to generate the corresponding APK for each environment: - `build:android.prod` - `build:android.stg` - `build:android.dev` For example: `yarn build:android.stg` ### iOS For iOS you need to configure the Apple Certificates and the Provisioning Profiles. Then, use the Xcode's Archive (`Product --> Archive`) command to generate the corresponding IPA for each environment. --- ## Deploy App (Expo Updates and Stores) In order to deploy **Humand**, you must create (`git tag`) and push (`git push`) the specific tag/s from the branch that you want to deploy. The tags **must** have the following format: `v[version]-[env]-[eu]-[XX]`. The `version` in the tag should be the target version of the release. The `env` in the tag can be `prod`, `stg` or `dev`. The `eu` in the tag should be used when releasing via `expo-updates`. The `XX` in the tag can be any number but incrementally. For example: ``` git tag vX.X.X-stg-2 git push vX.X.X-stg-2 ``` or ``` git tag vX.X.X-prod-eu-1 git push vX.X.X-prod-eu-1 ``` ### Automatic Release Menu You can use the automatic release menu to deploy `Humand` to the Stores and Expo Updates. You can run the release menu from the terminal with the command `yarn release-menu` or `python3 scripts/release_menu.py`. See the menu and select the correct option based on the release type. The options validate the chosen branch and make a `git pull` to update it. --- ## Branching & Release Model You can find information about the current model in the [Notion](https://www.notion.so/humand-co/Branching-Release-Model-Mobile-Apps-21b6757f31308092b009ed268b99faef) documentation. --- ## E2E Tests ### Installing maestro - https://maestro.mobile.dev/getting-started/installing-maestro - You can use [maestro studio](https://docs.maestro.dev/getting-started/maestro-studio-desktop) to create tests. ### Running e2e tests ### Android `yarn e2e:android:dev e2e/flows/chats/create-group-and-conversation.yml` runs: `maestro test -e APP_ID=com.humand.demo.dev e2e/flows/chats/create-group-and-conversation.yml` ### iOS `yarn e2e:ios:dev e2e/flows/chats/create-group-and-conversation.yml` runs `maestro test -e APP_ID=com.Humand.Demo.dev e2e/flows/chats/create-group-and-conversation.yml` --- ## Clean Scripts When experiencing build issues, you can use these scripts to clean build artifacts: ### Available Clean Scripts - `yarn ios:clean` - Cleans iOS build artifacts, Pods, and DerivedData - `yarn android:clean` - Cleans Android build artifacts and Gradle cache - `yarn full-clean`- Reinstalls packages and pods, and also runs `android:clean` and `ios:clean`. ---