Angular 10 front-end + Firebase (Firestore + Cloud Functions).
- Node.js >= 22 (pinned in
.nvmrc; withnvm:nvm use). - Angular CLI:
npm install -g @angular/cli - Firebase CLI: not required globally —
gcp-deploy.shinvokesnpx firebase-tools@15. For ad-hocfirebase ...commands, use the samenpxform. - Google Cloud SDK (gcloud): https://cloud.google.com/sdk/docs/install
- Your account must be granted access to the target project (IAM owner/editor).
- Login to gcloud and firebase:
gcloud initfirebase login
For local development:
npm installFor reproducible installs (CI, deploys, or after pulling on a clean
clone), always prefer npm ci. It honors package-lock.json strictly
and refuses to mutate it, which is what we want for supply-chain
hygiene:
npm ciNever run npm install <new-package> directly when preparing a build
or a deploy; use npm ci instead. New dependencies are added in their
own commit (with the lockfile diff) and reviewed in PR.
Environment files are not in git. Get them from Google Drive (ask a dev) and place them in src/environments/.
You should have:
$ ls src/environments/
environment.dev.ts
environment.prod.ts
environment.sample.ts
environment.test.ts
environment.ts- Run
ng build --configuration devto prepare the server with dev environment settings. - Then run
ng serve --configuration devfor a dev server.
- Run
ng build --configuration testto prepare the server with test environment settings. - Then run
ng serve --configuration testfor a test server.
- CAUTION: do not use this environment, unless someone asked you to use it !- Run
ng build --configuration productionto prepare the server with production environment settings. - Then run
ng serve --configuration productionfor a production server.
Notes:
Once started you can navigate to
http://localhost:4200/.In all three cases above, after the
ng servecall, the app will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
The repo ships a helper script:
./gcp-deploy.sh fr dev
./gcp-deploy.sh fr test
./gcp-deploy.sh fr prodThis script:
- Sets the target GCP project (
rq-fr-{env}) - Runs
firebase use --add - Builds Angular (
ng build) - Runs
firebase deploy
Requirements: gcloud, firebase and ng must be in your PATH.
ng build --configuration dev # or test/prod
npx firebase-tools@15 deploy- If you see
ng: command not found, install:npm install -g @angular/cli. gcp-deploy.shrequires Node >= 22 (see.nvmrc). If your shell uses an older Node, runnvm usefirst or install Node 22 (e.g.brew install node@22).