Skip to content

dev-mansonthomas/RedQuest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

205 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RedQuest

Angular 10 front-end + Firebase (Firestore + Cloud Functions).

Prerequisites

Tooling

  • Node.js >= 22 (pinned in .nvmrc; with nvm: nvm use).
  • Angular CLI: npm install -g @angular/cli
  • Firebase CLI: not required globally — gcp-deploy.sh invokes npx firebase-tools@15. For ad-hoc firebase ... commands, use the same npx form.
  • Google Cloud SDK (gcloud): https://cloud.google.com/sdk/docs/install

Google Cloud / Firebase access

  • Your account must be granted access to the target project (IAM owner/editor).
  • Login to gcloud and firebase:
    • gcloud init
    • firebase login

Install

For local development:

npm install

For 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 ci

Never 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.

Environments

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

Start a server

Development server

  • Run ng build --configuration dev to prepare the server with dev environment settings.
  • Then run ng serve --configuration dev for a dev server.

Test server

  • Run ng build --configuration test to prepare the server with test environment settings.
  • Then run ng serve --configuration test for a test server.

Production server

- CAUTION: do not use this environment, unless someone asked you to use it !
  • Run ng build --configuration production to prepare the server with production environment settings.
  • Then run ng serve --configuration production for a production server.

Notes:

Once started you can navigate to http://localhost:4200/.

In all three cases above, after the ng serve call, the app will automatically reload if you change any of the source files.

Code scaffolding

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.

Build

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.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Deploy

One-command deploy

The repo ships a helper script:

./gcp-deploy.sh fr dev
./gcp-deploy.sh fr test
./gcp-deploy.sh fr prod

This 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.

Manual deploy

ng build --configuration dev   # or test/prod
npx firebase-tools@15 deploy

Troubleshooting

  • If you see ng: command not found, install: npm install -g @angular/cli.
  • gcp-deploy.sh requires Node >= 22 (see .nvmrc). If your shell uses an older Node, run nvm use first or install Node 22 (e.g. brew install node@22).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors