SlideShare a Scribd company logo
全端網頁開發起手式
洪堃能 Kun-Neng Hung
NCSIST Engineer / GDG Taoyuan Organizer
kunneng.hung
建構並佈署Angular網頁應用程式至GCP
2021/04/11
全端 = 前端 + 後端?
蛤?就這樣?
網頁架構設計、開發流程規劃、資
料庫維護、資訊安全...
Angular + GCP
典型的網站基本運作原理
Google Cloud Platform (GCP)
Google App Engine
Frontend 前端 Backend 後端
Webpage Web Service Database
Angular
或
Pub/Sub + Dataflow、
BigQuery、
Cloud Build、
…
request
response
data
事實上...
https://cloud.google.com/appengine
開始搭建舞台(GAE)吧!
https://cloud.google.com/appengine/docs/standard/nodejs/setting-up-environment
Step 1
https://cloud.google.com/sdk/docs/install
Step 2
https://cloud.google.com/appengine/docs/standard/nodejs/setting-up-environment
Step 3
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
初次使用Google Cloud SDK Shell
認證成功!
初次使用Google Cloud SDK Shell
gcloud CLI Commands
manage Google Cloud Platform resources and developer workflow
● gcloud config list
print the properties in the active configuration
● gcloud components list
list the status of all Cloud SDK components
● gcloud init [--console-only]
initialize or reinitialize gcloud
● gcloud projects describe PROJECT_ID_OR_NUMBER
show metadata for a project
https://cloud.google.com/sdk/gcloud/reference
gcloud app CLI Commands
deploy and manage your Google App Engine apps
● gcloud app regions list
list the availability of flex and standard environments for each region
● gcloud app create [--region=REGION]
create an App Engine app within the current Google Cloud Project
● gcloud app describe
display all data about an existing service
● gcloud app deploy
deploy the local code and/or configuration of your app to App Engine
https://cloud.google.com/sdk/gcloud/reference/app
gcloud app CLI Commands
deploy and manage your Google App Engine apps
● gcloud app regions list
● gcloud app create --region=asia-east2
● gcloud app describe
舞台限制特定動作
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
API 金鑰限制和最佳做法
https://developers.google.com/maps/api-key-best-practices
(1) 您可以將未受限制的 API 金鑰用於任何 Google 地圖平台 API 或 SDK,不過我們強烈建議您限制 API 金鑰,尤其是在下列
情況下:
○ 測試環境將設為或已設為開放給所有人檢視。
○ 採用 API 金鑰的應用程式可用於實際執行環境中。
(2) 考慮為行動應用程式採用原生的 Maps SDK for Android 和 Maps SDK for iOS。
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
舞者(Angular)熱身
初探 Angular
for creating efficient and sophisticated single-page apps
● App-Design framework 應用設計框架
● Development Platform 開發平臺
GDG Taoyuan #06 - 初探Angular 應用設計框架 (https://www.youtube.com/watch?v=xwYV3ZoavoI)
⇒ 提供比函式庫更完整功能與開發環境的「完整解決方案」
跨平臺
漸進式應用/原生/
桌面
速度與效能
程式碼產生/統一
平臺/程式碼拆分
生產力
範本/Angular
CLI/各種 IDE
完整開發故事
測試/動畫/可及性
程式碼整潔有規範
↓
程式碼格式一致性很高、不易出錯
↓
團隊合作順暢愉快
https://angular.tw/features
Angular 特色及優點
建立 Angular 專案
1. 安裝並確定 Node.js 與 npm 版本
2. 安裝 Angular CLI
3. 以 Angular CLI 建立新專案(工作空間)
4. 編譯並執行專案
ng new <name> [options]
ng n <name> [options]
ng serve <name> [options]
ng s <name> [options]
--host: Host to listen on.
--port: Port to listen on.
Default: 4200
node -v
npm -v
npm install -g @angular/cli
https://www.npmjs.com/package/@angular/cli
| Angular CLI | Angular | NodeJS | TypeScript |
|---------------|-----------------|--------------------------------|----------------|
|6.0.8 |6.0.x |8.9.x or later minor |2.7.x |
|6.1.5 |6.1.x |8.9.x or later minor |2.7.x |
|6.2.9 |6.1.x |8.9.x or later minor |2.9.x |
|7.0.7 |7.0.x |8.9.x/10.9.x or later minor |3.1.x |
|7.1.4 |7.1.x |8.9.x/10.9.x or later minor |3.1.x |
|7.2.4 |7.2.x |8.9.x/10.9.x or later minor |3.2.x |
|7.3.9 |7.2.x |8.9.x/10.9.x or later minor |3.2.x |
|8.0.6 |8.0.x |10.9.x or later minor |3.4.x |
|8.1.3 |8.1.x |10.9.x or later minor |3.4.x |
|8.2.2 |8.2.x |10.9.x or later minor |3.4.x |
|8.3.25 |8.2.x |10.9.x or later minor |3.5.x |
|9.0.7 |9.0.7 |10.13.x/12.11.x or later minor |3.6.x/3.7.x |
|9.x |9.x |10.13.x/12.11.x or later minor |3.6.x-3.8.x |
|10.x |10.x |10.13.x/12.11.x or later minor |3.9.x |
|10.1.x |10.1.x |10.13.x/12.11.x or later minor |3.9.x/4.0.x |
|10.2.x |10.2.x |10.13.x/12.11.x or later minor |3.9.x/4.0.x |
|11.0.7 |11.0.x |10.13.x/12.11.x or later minor |4.0.x |
|11.1.x |11.1.x |10.13.x/12.11.x or later minor |4.0.x/4.1.x |
|11.2.x |11.2.x |10.13.x/12.11.x or later minor |4.0.x/4.1.x |
|12.0.x |12.0.x |12.13.x/14.15.x or later minor |4.2.x |
https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
(localhost)彩排
加入 Angular Google Maps component
Component on Angular 9
1. 確認並更新 Angular 版本
2. 安裝 Google Maps 模組
3. 使用 Google Maps 模組
npm install @angular/google-maps
ng version
ng update @angular/core@^9 @angular/cli@^9
https://github.com/angular/components/blob/master/src/google-maps/
載入並使用 Google Maps
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
操作 Angular CLI
● 建立模組
● 建立元件
● 建立服務
https://www.npmjs.com/package/@angular/cli
ng generate component <name> [options]
ng g component <name> [options]
ng generate service <name> [options]
ng g service <name> [options]
ng generate module <name> [options]
ng g module <name> [options]
PS C:projectsgaehugoo-bus> ng g component bus-map
CREATE src/app/bus-map/bus-map.component.html (22 bytes)
CREATE src/app/bus-map/bus-map.component.spec.ts (627 bytes)
CREATE src/app/bus-map/bus-map.component.ts (278 bytes)
CREATE src/app/bus-map/bus-map.component.css (0 bytes)
UPDATE src/app/app.module.ts (477 bytes)
PS C:projectsgaehugoo-bus> ng g module bus-map
CREATE src/app/bus-map/bus-map.module.ts (192 bytes)
PS C:projectsgaehugoo-bus> ng g service services/google-maps
CREATE src/app/services/google-maps.service.spec.ts (378 bytes)
CREATE src/app/services/google-maps.service.ts (139 bytes)
PS C:projectsgaehugoo-bus> ng g service services/bus-data
CREATE src/app/services/bus-data.service.spec.ts (363 bytes)
CREATE src/app/services/bus-data.service.ts (136 bytes)
BusMapComponent
BusMapModule
GoogleMapsService BusDataService
GoogleMapsModule
HttpClientModule
HttpClientJsonpModule
AppModule
Lazy Loading the API Bus Data Provider
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
步上舞台
runtime: nodejs14
handlers:
- url: /
static_files: dist/hugoo-bus/index.html
upload: dist/hugoo-bus/index.html
- url: /
static_dir: dist/hugoo-bus
https://cloud.google.com/appengine/docs/standard/nodejs/configuration-files
<application root>/
source files app.yaml
佈署 Angular 專案
1. 打包專案
2. 佈署專案
ng build --prod
gcloud app deploy
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
舞動人生,未完待續
在 Google App Engine 還要做更多事
相關社群與學習資源
● Angular 線上讀書會
https://www.facebook.com/groups/angularstudygroup/
● Google Developers Experts
https://developers.google.com/community/experts/directory
wellwind.idv.tw/blog
blog.miniasp.com blog.kevinyang.net
感謝聆聽!
Q & A

More Related Content

PDF
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
PDF
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
PDF
Creating BananaJS with Angular 2, Angular CLI, and Material Design
PDF
The Tale of 2 CLIs - Ember-cli and Angular-cli
PPTX
Jhipster
PDF
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
PDF
Get Hip with Java Hipster - JavaOne 2017
PDF
Webpack and angularjs
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
Creating BananaJS with Angular 2, Angular CLI, and Material Design
The Tale of 2 CLIs - Ember-cli and Angular-cli
Jhipster
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Get Hip with Java Hipster - JavaOne 2017
Webpack and angularjs

What's hot (19)

PDF
Getting started with Angular CLI
ODP
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
PDF
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering
PDF
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
PDF
Getting Started with the Angular 2 CLI
PDF
Buri2019
PDF
Creating Island Tracker - Xamarin, Azure Functions, Table Storage, & More
PDF
Angular Best Practices @ Firenze 19 feb 2018
PDF
Gretty: Managing Web Containers with Gradle
PDF
Angular 2.0
PPTX
Automazione serverless con Azure Functions e PowerShell - Marco Obinu - DevOp...
PDF
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
PDF
Automating Aegir Platform builds with Git; Fabric; and Drush
PPTX
Intro to Azure Webjobs
PPTX
JHipster presentation by Gaetan Bloch
PPTX
Lazy angular w/ webpack
PDF
Play Framework on Google App Engine
PDF
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
PDF
Wuff: Building Eclipse Applications and Plugins with Gradle
Getting started with Angular CLI
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
Getting Started with the Angular 2 CLI
Buri2019
Creating Island Tracker - Xamarin, Azure Functions, Table Storage, & More
Angular Best Practices @ Firenze 19 feb 2018
Gretty: Managing Web Containers with Gradle
Angular 2.0
Automazione serverless con Azure Functions e PowerShell - Marco Obinu - DevOp...
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
Automating Aegir Platform builds with Git; Fabric; and Drush
Intro to Azure Webjobs
JHipster presentation by Gaetan Bloch
Lazy angular w/ webpack
Play Framework on Google App Engine
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Wuff: Building Eclipse Applications and Plugins with Gradle
Ad

Similar to 20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP (20)

PDF
Angular JS 2_0 BCS CTO_in_Res V3
PDF
Myths of Angular 2: What Angular Really Is
PDF
Where and Why Use Angular for Web Development?
PDF
Predictable Web Apps with Angular and Redux
PPTX
Mean stack Magics
PDF
Getting Started with Android Development
PDF
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
PDF
Web Applications with AngularJS
PDF
Angular 12 brought several new features to the table
PDF
Vuejs for Angular developers
ODP
Angular 6 - The Complete Guide
PDF
Mobile development in 2020
PDF
What’s new in angular 13 and why should you use it for web app development pr...
PDF
Cross Platform Mobile Apps with the Ionic Framework
PDF
What's new in Gradle 4.0
PDF
Mobile Development with PhoneGap
PDF
Flutter vs Java Graphical User Interface Frameworks - text
PDF
Angular.js vs. vue.js – which one is the better choice in 2022
PDF
How native script angular helps to build truly native mobile applications
PDF
Cross Platform Mobile App Development
Angular JS 2_0 BCS CTO_in_Res V3
Myths of Angular 2: What Angular Really Is
Where and Why Use Angular for Web Development?
Predictable Web Apps with Angular and Redux
Mean stack Magics
Getting Started with Android Development
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
Web Applications with AngularJS
Angular 12 brought several new features to the table
Vuejs for Angular developers
Angular 6 - The Complete Guide
Mobile development in 2020
What’s new in angular 13 and why should you use it for web app development pr...
Cross Platform Mobile Apps with the Ionic Framework
What's new in Gradle 4.0
Mobile Development with PhoneGap
Flutter vs Java Graphical User Interface Frameworks - text
Angular.js vs. vue.js – which one is the better choice in 2022
How native script angular helps to build truly native mobile applications
Cross Platform Mobile App Development
Ad

More from Kun-Neng Hung (6)

PDF
20250422 從零開始的 Angular 網頁應用程式 Part II: Service & Routing & Form
PDF
20250322 Build with AI - 以 MediaPipe 建構裝置端 LLM
PDF
20250322 Build with AI - 使用 Vertex AI 建構 LLM 應用
PDF
20241117 自製網頁遊戲之輔助 AI 應用實例:使用 Google Gemini AI 提升玩家決策
PPTX
20240518 將 Google Gemini 整合至 Angular 成為互動式 AI 應用程式
PDF
20221119 DevFest 2022 - 初探 Angular 響應式表單
20250422 從零開始的 Angular 網頁應用程式 Part II: Service & Routing & Form
20250322 Build with AI - 以 MediaPipe 建構裝置端 LLM
20250322 Build with AI - 使用 Vertex AI 建構 LLM 應用
20241117 自製網頁遊戲之輔助 AI 應用實例:使用 Google Gemini AI 提升玩家決策
20240518 將 Google Gemini 整合至 Angular 成為互動式 AI 應用程式
20221119 DevFest 2022 - 初探 Angular 響應式表單

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
A Presentation on Artificial Intelligence
PDF
Review of recent advances in non-invasive hemoglobin estimation
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Network Security Unit 5.pdf for BCA BBA.
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Monthly Chronicles - July 2025
A Presentation on Artificial Intelligence
Review of recent advances in non-invasive hemoglobin estimation

20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP