Skip to content

Commit 98409bd

Browse files
authored
Add docs for running local web against dev (#2563)
1 parent 4aea145 commit 98409bd

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,42 @@ nx start
6262

6363
The local emulator is preloaded with a demo survey. Run `nx export` to save the updated demo data to the local filesystem for use on the next run.
6464

65-
## Run against live staging environment
65+
## Running the web app locally using dev Firebase
6666

67-
Members of the core maintainers team can run the app against the live staging environment with:
67+
By default `nx start` runs the web app against a local Firebase emulator (see
68+
[Build and run locally](#build-and-run-locally)). Sometimes it's useful to run
69+
the web app locally against the **live dev backend** instead — for example to
70+
reproduce an issue with real data, or to test against Cloud Functions and
71+
Firestore rules as actually deployed. The dev backend is the
72+
[`ground-dev-sig`](https://console.firebase.google.com/project/ground-dev-sig)
73+
Firebase project.
74+
75+
To serve the local web app against dev:
6876

6977
```bash
7078
nx run web:serve:staging
7179
```
7280

81+
Once started, the app is available at http://localhost:4200 and connects to the
82+
live `ground-dev-sig` Firestore, Authentication, and Cloud Functions instead of
83+
the local emulator. Changes to the web app in `web/` are still rebuilt and
84+
reloaded on save, but the backend is remote — the Firebase Emulator Suite UI at
85+
http://localhost:4000 is not used in this mode.
86+
87+
**Prerequisites:**
88+
89+
- Install dependencies first with `pnpm install` (see
90+
[One time setup](#one-time-setup)).
91+
- Unlike the local emulator, this mode has real authentication enabled. To sign
92+
in and access surveys you need a Google account that has been added to the
93+
`ground-dev-sig` passlist. Ask a member of the core maintainers team to grant
94+
access if needed.
95+
96+
> **Note on naming:** the Angular build configuration is named `staging`, but it
97+
> points at the dev project `ground-dev-sig`
98+
> ([`environment.staging.ts`](web/src/environments/environment.staging.ts)), so
99+
> `nx run web:serve:staging` serves against dev.
100+
73101
## Deploy
74102

75103
To build and deploy to staging, first sign into Firebase with:
@@ -105,7 +133,7 @@ All commands use [Nx](https://nx.dev) and [pnpm](https://pnpm.io). Run them from
105133
| `nx run root:test` | Run all tests |
106134
| `nx run root:lint` | Lint all packages |
107135
| `nx run web:serve` | Serve the web app only (no emulator) |
108-
| `nx run web:serve:staging` | Serve the web app against the live staging environment |
136+
| `nx run web:serve:staging` | Serve the local web app against the live dev backend (`ground-dev-sig`) |
109137
| `nx run web:test` | Run web tests |
110138
| `nx run web:extract-i18n` | Extract i18n messages from the web app |
111139
| `nx run functions:test` | Run Cloud Functions tests |

0 commit comments

Comments
 (0)