Skip to content

Commit 68f3b95

Browse files
committed
Merge branch 'mobile/docs' of github.com:Couchers-org/couchers into mobile/docs
2 parents f2cd390 + 4d31dc8 commit 68f3b95

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

app/mobile/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ npm run start:devtool
5151

5252
You should now see the mobile app on your phone.
5353

54-
This setup will point at your local version of the React Native app, but it will point at the staging web app and backend. You probably want to follow the instructions on local dev below to run the full stack locally.
54+
This setup will point at your local version of the React Native app with the staging web app and backend. If you change any code within the web or backend folders, you will need to run the full stack locally to see your changes. Follow the instructions on local dev below.
5555

5656
## 2. Full local development setup
5757

58-
To actually do full local development, you will want to run the entire stack on your dev machine, and point the dev tool at that instead of the staging environment.
58+
To run the mobile, frontend and backend environments fully locally, you need to run the entire stack on your dev machine, and point the dev tool at that instead of the staging environment.
5959

6060
First, run the following script which patches environment variables to point the app at your local running versions of the frontend and backend. It auto-detects your IP and updates all config files at once:
6161

@@ -69,12 +69,13 @@ Now run everything from the repo root, each in a separate terminal:
6969

7070
```bash
7171
# Terminal 1: backend (requires Docker)
72+
7273
docker compose up --build
7374

7475
# Terminal 2: web frontend
7576
cd app/web && yarn install && yarn start
7677

77-
# Terminal 3: Expo
78+
# Terminal 3: Expo (Mobile)
7879
cd app/mobile && npm run start:devtool
7980
```
8081

@@ -180,7 +181,9 @@ All release builds (Dev Tool, Stage, Prod) are done in CI ([`app/.gitlab-ci.yml`
180181

181182
Releasing to users is then a manual process:
182183

183-
**Staging** builds are for internal testing and are available as soon as CI submits them (TestFlight after Apple's automated processing; Play internal testing immediately). Optionally add release notes in [App Store Connect](https://appstoreconnect.apple.com) (Couchers (Staging) → TestFlight → build → "What to Test") or the [Google Play Console](https://play.google.com/console) (Couchers (Staging) → Testing → Internal testing → release notes).
184+
**Staging** builds are for internal testing and are available as soon as CI submits them (TestFlight after Apple's automated processing; Play internal testing immediately). Ideally add release notes in [App Store Connect](https://appstoreconnect.apple.com) (Couchers (Staging) → TestFlight → build → "What to Test") or the [Google Play Console](https://play.google.com/console) (Couchers (Staging) → Testing → Internal testing → release notes) so testers know what to look for.
185+
186+
Update `RELEASE_NOTES.md` as you code to keep track of changes then copy/paste this after building.
184187

185188
**Production** releases should be coordinated with the team, after the changes have been tested in staging:
186189

docs/native-dev-tool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Couchers Dev Tool
22

3-
The Couchers Dev Tool is a simple app that uses the Expo development client, along with OTA updates, to allow devs and non-devs to easily develop and QA the native app.
3+
The Couchers Dev Tool is a simple app that uses the Expo development client, along with OTA (over-the-air) updates, to allow devs and non-devs to easily develop and QA the native app.
44

55
It supports:
66

@@ -14,7 +14,7 @@ The point is that you only need to do full builds if you're changing native modu
1414
* **iOS**: via TestFlight, ask a native dev lead to be added.
1515
* **Android**: download the APK from [the dev tool builds page](https://develop--devtool-builds.preview.couchershq.org/).
1616

17-
It's a dev build, so we can't distribute it through the app stores proper. The Dev Tool coexists with the staging and production apps on the same device (it has its own bundle ID), and points at the staging backend by default.
17+
It's a dev build, so we can't distribute it through the app stores proper. The Dev Tool coexists with the staging and production apps on the same device (it has its own bundle ID), and points at the staging frontend (web) and backend by default.
1818

1919
## Workflow 1: local development
2020

docs/native-ota-updates.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ When fingerprints change, we must publish a new version via app stores, and user
4242

4343
### On the client
4444

45-
I keep saying OTA updates give us "flexibility", but not full control.
45+
OTA updates give us "flexibility", but not full control.
4646

4747
In order to update the app, the app needs to download a signed bundle of Hermes compiled JavaScript code. It then needs to **restart the app** in order to apply that code update. In practice you want to always apply a new code bundle at startup, not interrupt a session. You could feasibly download the bundle on app load, then apply it immediately. The Expo default will try to download bundles in the background, then apply them the next moment the user puts the app away and/or restarts it in the foreground.
4848

@@ -54,11 +54,11 @@ In order to find out about a new update, Expo uses the "Expo Updates Protocol v1
5454

5555
Our backend serves the update protocol in `Bugs.GetNativeUpdateManifest`, which the client loads from `https://api.couchers.org/native/ota/manifest`. This endpoint decides which update to serve, depending on various logic.
5656

57-
The backend generally picks the newest non-banned OTA update for the combination of platform and fingerprint available from teh database, then serves pre-signed manifest bytes that are fetched from the CDN. (Banning is a mechanism to quickly stop us from distributing botched updates.)
57+
The backend generally picks the newest non-banned OTA update for the combination of platform and fingerprint available from the database, then serves pre-signed manifest bytes that are fetched from the CDN. (Banning is a mechanism to quickly stop us from distributing botched updates.)
5858

5959
### Publishing new updates
6060

61-
The publishing flow involes basically taking a full Expo bundle (generated via `ota-bundle.mjs`), stamping it with a new publish timestamp, signing it, producing a manifest file, and telling the backend about it.
61+
The publishing flow involves taking a full Expo bundle (generated via `ota-bundle.mjs`), stamping it with a new publish timestamp, signing it, producing a manifest file, and telling the backend about it.
6262

6363
You can see how this works by tracing the staging OTA update flow (from `.gitlab-ci.yml`), where we build a new update on every push to `develop`. For prod the flow is the same, but we have a magic button in a magic place to trigger it.
6464

0 commit comments

Comments
 (0)