https://github.com/arup-group/angular-gcp-template

A template project to start an Angular, serverless, and GCP stack

https://github.com/arup-group/angular-gcp-template

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

A template project to start an Angular, serverless, and GCP stack

Basic Info
  • Host: GitHub
  • Owner: arup-group
  • License: mit
  • Language: TypeScript
  • Default Branch: main
  • Size: 769 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 42
  • Releases: 0
Created almost 5 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

Angular GCP Template

This project is a template to stand up a development stack with an Angular frontend, NGRX, Firebase authentication, serverless Node.js and Python APIs, and Google Cloud Platform deployments. You can fork this project and edit for your own project work.

How this repo works

Throughout this repository, there are placeholder values for the PROJECT_NAME of your project. You must change these for this template to be useful. We suggest doing a global replace in your IDE of choice. This project name should match your project name on the Google Cloud Platform console.

You also need Docker set up on your machine in order to use all of the features of this template.

Google Cloud Platform

You must set up GCP credentials for your development environment following the process here. You can configure API keys for API Gateway and Firebase in the environments.ts files.

Frontend

This project was generated with Angular CLI version 11.0.2.

This project follows a container/component architecture using NGRX. Containers load data from the store or API and pass that data to components, which display the data and handle interactions.

Install

Install packages:

npm install or npm i

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. 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. There are currently no frontend tests implemented.

Authentication

Authentication is handled through Firebase. You can access this on the Firebase console. Users can create their own accounts from the frontend. This can be used or discarded at your discretion.

Theming

Themes are set up for the frontend in the styles.scss file. Edit this file with your color palette to configure a custom theme.

Websockets

This application has boilerplate to establish a websockets connection in NGRX to ws:// and wss:// endpoints for development and production. This can be used or discarded at your discretion.

CORS

In order to make requests from the frontend to a GCP storage bucket, you must configure CORS. We've provided CORS configuration for GCP in the cors-config.json file. Update this with your urls and follow these instructions to allow CORS requests on GCP storage buckets.

API

There is code for Python and NodeJS endpoints, though currently all are Python. You can test functions from the if __name__ == "__main__" block at the bottom of main.py.

Create a virtual environment for the Python API in the python-api directory and install dependencies:

pip install -r requirements.txt

If writing functions using NodeJS, install node modules in the node-api directory:

npm i or npm install

This application uses a serverless API on Google Cloud Platform. Endpoints are documented in api/openapi-functions.yaml. You can see the swagger documentation for the API by running from the project root:

npm run swagger

Requests to the API must have a key included, which is defined in src/environments/environment.ts. This key must also be included if testing using Postman.

Deployment

You can manually deploy to GCP from the project using the following npm commands:

npm run docker-build

npm run docker-push

npm run deploy

You can also use the provided app.yaml and cloudbuild.yaml to configure automated deployments in the GCP console.

API

The API is deployed using serverless. Edit the serverless.yml files to include your GCP account information and run serverless deploy to create Cloud Functions for Node or Python.

Commands to deploy a new API Gateway config are commented at the bottom of openapi-functions.yaml. This config links API endpoints to Cloud Functions.

Owner

  • Name: Arup
  • Login: arup-group
  • Kind: organization
  • Email: media@arup.com

We Shape a Better World

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 90
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 months
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.1
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 90
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (48)
Top Labels
Issue Labels
Pull Request Labels
dependencies (48) javascript (32) python (15)

Dependencies

api/node-api/package-lock.json npm
  • abort-controller 3.0.0 development
  • agent-base 6.0.2 development
  • ansi-styles 4.3.0 development
  • arrify 2.0.1 development
  • async 2.6.3 development
  • base64-js 1.5.1 development
  • bignumber.js 9.0.1 development
  • bluebird 3.7.2 development
  • buffer-equal-constant-time 1.0.1 development
  • chalk 3.0.0 development
  • color-convert 2.0.1 development
  • color-name 1.1.4 development
  • debug 4.3.1 development
  • ecdsa-sig-formatter 1.0.11 development
  • event-target-shim 5.0.1 development
  • extend 3.0.2 development
  • fast-text-encoding 1.0.3 development
  • fs-extra 8.1.0 development
  • gaxios 4.1.0 development
  • gcp-metadata 4.2.1 development
  • google-auth-library 6.1.5 development
  • google-p12-pem 3.0.3 development
  • googleapis 50.0.0 development
  • googleapis-common 4.4.3 development
  • graceful-fs 4.2.4 development
  • gtoken 5.2.0 development
  • has-flag 4.0.0 development
  • https-proxy-agent 5.0.0 development
  • is-stream 2.0.0 development
  • json-bigint 1.0.0 development
  • jsonfile 4.0.0 development
  • jwa 2.0.0 development
  • jws 4.0.0 development
  • lodash 4.17.21 development
  • lru-cache 6.0.0 development
  • mime 2.5.0 development
  • ms 2.1.2 development
  • node-fetch 2.6.1 development
  • node-forge 0.10.0 development
  • qs 6.9.6 development
  • safe-buffer 5.2.1 development
  • serverless-google-cloudfunctions 3.1.1 development
  • supports-color 7.2.0 development
  • universalify 0.1.2 development
  • url-template 2.0.8 development
  • uuid 8.3.2 development
  • yallist 4.0.0 development
api/node-api/package.json npm
  • serverless-google-cloudfunctions * development
api/python-api/package-lock.json npm
  • abort-controller 3.0.0 development
  • agent-base 6.0.2 development
  • ansi-styles 4.3.0 development
  • arrify 2.0.1 development
  • async 2.6.3 development
  • base64-js 1.5.1 development
  • bignumber.js 9.0.1 development
  • bluebird 3.7.2 development
  • buffer-equal-constant-time 1.0.1 development
  • chalk 3.0.0 development
  • color-convert 2.0.1 development
  • color-name 1.1.4 development
  • debug 4.3.1 development
  • ecdsa-sig-formatter 1.0.11 development
  • event-target-shim 5.0.1 development
  • extend 3.0.2 development
  • fast-text-encoding 1.0.3 development
  • fs-extra 8.1.0 development
  • gaxios 4.2.0 development
  • gcp-metadata 4.2.1 development
  • google-auth-library 6.1.6 development
  • google-p12-pem 3.0.3 development
  • googleapis 50.0.0 development
  • googleapis-common 4.4.3 development
  • graceful-fs 4.2.6 development
  • gtoken 5.2.1 development
  • has-flag 4.0.0 development
  • https-proxy-agent 5.0.0 development
  • is-stream 2.0.0 development
  • json-bigint 1.0.0 development
  • jsonfile 4.0.0 development
  • jwa 2.0.0 development
  • jws 4.0.0 development
  • lodash 4.17.21 development
  • lru-cache 6.0.0 development
  • ms 2.1.2 development
  • node-fetch 2.6.1 development
  • node-forge 0.10.0 development
  • qs 6.9.6 development
  • safe-buffer 5.2.1 development
  • serverless-google-cloudfunctions 3.1.1 development
  • supports-color 7.2.0 development
  • universalify 0.1.2 development
  • url-template 2.0.8 development
  • uuid 8.3.2 development
  • yallist 4.0.0 development
api/python-api/package.json npm
  • serverless-google-cloudfunctions ^3.1.1 development
package-lock.json npm
  • 1355 dependencies
package.json npm
  • @angular-devkit/build-angular ~12.2.0 development
  • @angular/cli ~12.2.0 development
  • @angular/compiler-cli ~12.2.0 development
  • @types/jasmine ~3.8.0 development
  • @types/node ^12.11.1 development
  • clean-webpack-plugin ^4.0.0-alpha.0 development
  • codelyzer ^6.0.2 development
  • copy-webpack-plugin ^9.0.1 development
  • css-loader ^6.2.0 development
  • html-webpack-plugin ^5.3.2 development
  • jasmine-core ~3.8.0 development
  • json-loader ^0.5.7 development
  • karma ~6.3.0 development
  • karma-chrome-launcher ~3.1.0 development
  • karma-coverage ~2.0.3 development
  • karma-jasmine ~4.0.0 development
  • karma-jasmine-html-reporter ~1.7.0 development
  • protractor ^7.0.0 development
  • style-loader ^3.2.1 development
  • swagger-ui ^3.52.0 development
  • ts-node ^10.2.0 development
  • tslint ^6.1.3 development
  • typescript ~4.3.5 development
  • webpack ^5.47.1 development
  • webpack-cli ^4.7.2 development
  • webpack-dev-server ^3.11.2 development
  • yaml-loader ^0.6.0 development
  • @angular/animations ~12.2.0
  • @angular/common ~12.2.0
  • @angular/compiler ~12.2.0
  • @angular/core ~12.2.0
  • @angular/fire ^6.1.5
  • @angular/flex-layout ^12.0.0-beta.34
  • @angular/forms ~12.2.0
  • @angular/material ^12.2.0
  • @angular/platform-browser ~12.2.0
  • @angular/platform-browser-dynamic ~12.2.0
  • @angular/router ~12.2.0
  • @ngrx/effects ^12.3.0
  • @ngrx/router-store ^12.3.0
  • @ngrx/schematics ^12.3.0
  • @ngrx/store ^12.3.0
  • @ngrx/store-devtools ^12.3.0
  • express ^4.17.1
  • firebase ^8.9.0
  • rxjs ~6.6.0
  • tslib ^2.3.0
  • zone.js ~0.11.4
api/python-api/requirements.txt pypi
  • Flask ==1.1.2
  • Jinja2 ==2.11.3
  • MarkupSafe ==1.1.1
  • PyUtilib ==6.0.0
  • PyYAML ==5.4.1
  • Pygments ==2.8.1
  • Pyomo ==5.7.3
  • SQLAlchemy ==1.4.8
  • Werkzeug ==1.0.1
  • aiohttp ==3.7.4
  • appnope ==0.1.2
  • async-timeout ==3.0.1
  • attrs ==20.3.0
  • backcall ==0.2.0
  • cachetools ==4.2.1
  • certifi ==2020.12.5
  • cffi ==1.14.5
  • cftime ==1.4.1
  • chardet ==3.0.4
  • click ==7.1.2
  • decorator ==4.4.2
  • et-xmlfile ==1.0.1
  • fsspec ==0.8.7
  • gcsfs ==0.7.2
  • google-api-core ==1.25.1
  • google-auth ==1.25.0
  • google-auth-oauthlib ==0.4.3
  • google-cloud-core ==1.6.0
  • google-cloud-pubsub ==2.2.0
  • google-cloud-secret-manager ==2.2.0
  • google-cloud-storage ==1.36.1
  • google-cloud-tasks ==2.2.0
  • google-crc32c ==1.1.2
  • google-resumable-media ==1.2.0
  • googleapis-common-protos ==1.52.0
  • greenlet ==1.0.0
  • grpc-google-iam-v1 ==0.12.3
  • grpcio ==1.35.0
  • idna ==2.10
  • importlib-metadata ==3.7.0
  • ipdb ==0.13.7
  • ipython ==7.22.0
  • ipython-genutils ==0.2.0
  • itsdangerous ==1.1.0
  • jedi ==0.18.0
  • joblib ==1.0.1
  • jsonschema ==3.2.0
  • jupyter-core ==4.7.1
  • libcst ==0.3.16
  • multidict ==5.1.0
  • mypy-extensions ==0.4.3
  • natsort ==7.1.1
  • nbformat ==5.1.3
  • netCDF4 ==1.5.6
  • nose ==1.3.7
  • numpy ==1.19.5
  • oauthlib ==3.1.0
  • openpyxl ==3.0.7
  • pandas ==1.1.5
  • parso ==0.8.2
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • plotly ==3.10.0
  • ply ==3.11
  • prompt-toolkit ==3.0.18
  • proto-plus ==1.13.0
  • protobuf ==3.14.0
  • psycopg2-binary ==2.8.6
  • ptyprocess ==0.7.0
  • pyasn1 ==0.4.8
  • pyasn1-modules ==0.2.8
  • pycparser ==2.20
  • pyrsistent ==0.17.3
  • python-dateutil ==2.8.1
  • pytz ==2020.5
  • requests ==2.25.1
  • requests-oauthlib ==1.3.0
  • retrying ==1.3.3
  • rsa ==4.7
  • ruamel.yaml ==0.17.2
  • ruamel.yaml.clib ==0.2.2
  • scikit-learn ==0.24.1
  • scipy ==1.6.2
  • six ==1.15.0
  • threadpoolctl ==2.1.0
  • toml ==0.10.2
  • traitlets ==5.0.5
  • typing-extensions ==3.7.4.3
  • typing-inspect ==0.6.0
  • urllib3 ==1.26.3
  • wcwidth ==0.2.5
  • xarray ==0.16.2
  • yarl ==1.6.3
  • zipp ==3.4.1
Dockerfile docker
  • node 14.15.0 build