This is not an officially supported Google product.
This repository is based on a template that can be used to seed a repository for a new Google open source project. See https://opensource.google/docs/releasing/
This template uses the Apache license, as is Google's default. See the documentation for instructions on using alternate license.
Every file containing source code must include copyright and license information. This includes any JS/CSS files that you might be serving out to browsers. (This is to help well-intentioned people avoid accidental copying that doesn't comply with the license.)
Apache header:
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
git init
git remote add origin [email protected]:googleinterns/power-data-graphing-intern-2020.git
git checkout main
git pull
...
make local changes
...
git add your_file_name
git commit -m "Changes description"
git push -u origin main
If you encountered "Permission denied (publickey), please set up SSH key following the instruction at: https://help.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account
-
Install Angular denpendencies
Note: If you met compatbility issue, please consider install Node to v18.12.0 and Angular Cli to 14.2.13
-
Install Angular-cli by running
npm install -g @angular/cli
-
Check version by running
ng version
-
-
go to fronend folder, and run following commands to build the frontend
npm install
ng serve
Make sure you have python3.7+, pip3, python3-venv installed on your machine
-
To check pip3 version, run
pip3 -V
, or runsudo apt-get install python3-pip
to install it on your machine -
Run
sudo apt-get install python3-venv
to install python3-venv.
- Make sure you have a python virtual environment on your local machine and install all dependencies in the virtual environment.
- Create a virtual environment by running
python3 -m venv venv
orvirtualenv venv
. (Recommend to put the environment folder at project's root folder) - Activate the environment by running
source venv/bin/activate
pip3 install wheel
- install packages in the environment by running
pip3 install 'package-name'
- Create a virtual environment by running
- go to the backend folder, run the following commands to build the backend server Make sure that you are in a virtual environment before you run this command
pip3 install -r requirements.txt
(Only need to run this command at the first time)./build.sh
- Leave the virtual environment
deactivate
After finishing set up the frontend and backend, open the browser(recommend chrome) and visit "http://localhost:4200/", you should be able to see the website connected with the backend.
- Fork the repo
- Done in github ui.
- For example, my fork repo is https://github.com/yaomeng-google/power-data-graphing-intern-2020
- Clone the forked repo locally
- git clone [email protected]:<YOUR_USERNAME>/power-data-graphing-intern-2020.git
- Add upstream remote
- git remote add upstream [email protected]:googleinterns/power-data-graphing-intern-2020.git
- Run “git remote -v”, the origin is the fork repo, upstream is the actual repo.
- origin [email protected]:yaomeng-google/power-data-graphing-intern-2020.git (fetch)
- origin [email protected]:yaomeng-google/power-data-graphing-intern-2020.git (push)
- upstream [email protected]:googleinterns/power-data-graphing-intern-2020.git (fetch)
- upstream [email protected]:googleinterns/power-data-graphing-intern-2020.git (push)
- sync my fork's main branch to upstream's main branch
- git checkout main; git fetch upstream; git rebase upstream/main
- create a new branch from main
- git checkout -b cool_feature
- do my coding
- add and commit my changes
- git add *; git commit -m "New feature"
- push my branch to my fork
- git push origin cool_feature
- pull-request my branch from my fork to the upstream repo
- done in the git hub UI
- deal with any code review code changes by making commits and updating the branch in my fork (this updates the open pull-request)
- git add *; git commit -m "Fixes form review"; git push origin cool_feature
- merge the branch into the upstream repo's main branch
- done in github ui
- delete my development branch
- normally done in github ui
- Download gcloud SDK by following this link
- Initialze gcloud project by running
gcloud init
, auenticate with your google acount, and select the option of setting up a new project by entering a new project id, for tank-big-data-plotting, the project id is: google.com:tank-big-data-plotting-285623 - Go to the /frontend folder, build the prod version of the frontend by entering
ng build --prod
. Then go to the generated /dist folder, rungcloud app deploy
. Make sure if your gcloud project setup is correctly, and the target service is set as default - Go to the /backend folder, run
gcloud app deploy
, and make sure the target service is set as api. - Go to the gcp console and make sure the latest frontend and backend have been uploaded.
Note: If you meet into permission issue, please send requests to [email protected] to ask for GCP project permission.
If you need to debug the project, please go to the following links to check for debugging info