and-murray / wharf-spaces

MIT License
1 stars 0 forks source link

Murray Clubhouse Desk Booking App

[TOC]

Useful links

Project setup

Cloning the project

Setting Up Env Files

Getting the app running

iOS Profiles

We use match to manage certificates & profiles for running on devices.

Deploying to firebase distribution

Firebase

Build variant/Configurations/Schemes/Flavours

iOS

On iOS we have one Scheme but multiple build configurations:

These are a combination of the build settings (Debug & Release) and the backend environment that they hit. The GoogleService-Info-Dev.plist & GoogleService-Info-Prod.plist are stored in ios/Firebase. A build phase script pulls out the correct one based on the configuration and renames it correctly.

Android

On Android there are the following build variants:

These are combination of the productFlavours: (These are for separate Firebase instances, keeping data separate for each backend.)

These are combination of the buildTypes: (These are for different types of builds, the release type is optimised and doesn't have any debugging or developer features.)

This is all configured from android/app/build.gradle.

Setting up Firebase emulators

See the Firebase docs for the most up to date instructions.

Running the Firebase Emulator for Firebase Functions

Firebase Admin SDK

There is also an adminsdk json file that contains the secrets that allow admin access for the sdk to do this. This file is generated from the project settings within firebase and should not be shared publicly. Ideally this file would be stored on gitlab CI and not in version control but it is not currently possible to do that and should be done as soon as it is possible.

Set up Firebase Functions locally

Running the Firebase function unit tests

Running the unit tests

git-crypt CI - change/regenerate key

If the git-crypt key has been regenerated/changed, the CI will need to be updated to include this new key. We need to upload the key as a base64 encoded string because secure files don't work correctly GitLab CI, to do so:

Deploying the app to App Store and Play store

We use fastlane lanes for this - Read the guide here

Troubleshooting

I have an M1/M2 macbook (rather than intel) and it's not working

I'm seeing error message Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds OR error Failed to install the app. Make sure you have the Android...

If you're a fish shell user

Unknown ruby interpreter version (do not know how to handle): >=XXXX

"Help! I've tried nothing and I'm all out of ideas."

Watchman crawl failed

Seems like Watchman wants to be uninstalled and reinstalled, try the following:

brew uninstall watchman
brew install watchman
watchman shutdown-server  # (just in case it's running)
watchman watch-del-all
yarn start --reset-cache