Submit Search
GDG DevFest Kobe Firebaseハンズオン勉強会
1 like
1,332 views
Yosuke Onoue
Polymer & Firebaseハンズオンの資料です
Technology
Read more
1 of 48
Download now
Download to read offline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
More Related Content
PDF
Wordpress案件にgkeを採用してみた(短縮版)
Yu Amano
PDF
appengine ja night #25 Google App Engine for PHP
Ryo Yamasaki
PPTX
Myfirst buildpack session_mgmt_20161201
Tomohiro Ichimura
PDF
Cloud Foundryで学ぶ、PaaSのしくみ講座
Kazuto Kusama
KEY
1Day works shop
Kazuya Hiruma
PDF
DDDとクリーンアーキテクチャでサーバーアプリケーションを作っている話
JustSystems Corporation
PDF
パフォーマンス計測Ciサービスを作って得た知見を共有したい
zaru sakuraba
PDF
Yahoo! JAPANのコンテンツプラットフォームを支えるSpring Cloud Streamによるマイクロサービスアーキテクチャ #jsug #sf_52
Yahoo!デベロッパーネットワーク
Wordpress案件にgkeを採用してみた(短縮版)
Yu Amano
appengine ja night #25 Google App Engine for PHP
Ryo Yamasaki
Myfirst buildpack session_mgmt_20161201
Tomohiro Ichimura
Cloud Foundryで学ぶ、PaaSのしくみ講座
Kazuto Kusama
1Day works shop
Kazuya Hiruma
DDDとクリーンアーキテクチャでサーバーアプリケーションを作っている話
JustSystems Corporation
パフォーマンス計測Ciサービスを作って得た知見を共有したい
zaru sakuraba
Yahoo! JAPANのコンテンツプラットフォームを支えるSpring Cloud Streamによるマイクロサービスアーキテクチャ #jsug #sf_52
Yahoo!デベロッパーネットワーク
What's hot
(12)
PDF
PaaS / Cloud Foundry makes you happy
Katsunori Kawaguchi
PDF
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Shotaro Suzuki
PDF
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Kazuto Kusama
PDF
Google Container Engine (GKE) & Kubernetes のアーキテクチャ解説
Samir Hammoudi
PDF
KubernetesでPHPを動かした話
gree_tech
PPTX
はじめての Cloud Foundry: .NET アプリケーションのはじめ方
Akihiro Kitada
PDF
Docker PaaSとしての OpenShift, Deis, Flynn比較
Kazuto Kusama
PDF
『コンテナ疲れ』と戦う、k8s・PaaS・Serverlessの活用法
Kazuto Kusama
PDF
はじめてのCF buildpack
Kazuto Kusama
PDF
VSCodeで始めるAzure Static Web Apps開発
Yuta Matsumura
PDF
Cloud functions for Firebase
SENSY Inc
PDF
フィードフォースと AWS と私
a know
PaaS / Cloud Foundry makes you happy
Katsunori Kawaguchi
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Shotaro Suzuki
Cloud FoundryでDockerも.NETも。新しいDiegoの仕組み入門
Kazuto Kusama
Google Container Engine (GKE) & Kubernetes のアーキテクチャ解説
Samir Hammoudi
KubernetesでPHPを動かした話
gree_tech
はじめての Cloud Foundry: .NET アプリケーションのはじめ方
Akihiro Kitada
Docker PaaSとしての OpenShift, Deis, Flynn比較
Kazuto Kusama
『コンテナ疲れ』と戦う、k8s・PaaS・Serverlessの活用法
Kazuto Kusama
はじめてのCF buildpack
Kazuto Kusama
VSCodeで始めるAzure Static Web Apps開発
Yuta Matsumura
Cloud functions for Firebase
SENSY Inc
フィードフォースと AWS と私
a know
Ad
Viewers also liked
(20)
PDF
Polymerやってみた
Yosuke Onoue
PDF
AngularJSでデータビジュアライゼーションがしたい
Yosuke Onoue
PDF
Angular 2のRenderer
Yosuke Onoue
PDF
アニメーション(のためのパフォーマンス)の基礎知識
Yosuke Onoue
PDF
GPGPU Seminar (PyCUDA)
智啓 出川
PPTX
PyCUDAの紹介
Yosuke Onoue
PDF
Introduce build in shrinker
Daisuke Fuji
KEY
GPGPU deいろんな問題解いてみた
Ryo Sakamoto
PPTX
x86x64 SSE4.2 POPCNT
takesako
PDF
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
Ryoma Sin'ya
PDF
Gradle PluginとCIと俺
Shinobu Okano
PDF
Popcntによるハミング距離計算
Norishige Fukushima
PDF
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
Ryo Sakamoto
PPTX
Jetson TK1でSemi-Global Matching
Ryo Sakamoto
PPT
Rsa暗号で彼女が出来るらしい
Yosuke Onoue
PDF
CUDA 6の話@関西GPGPU勉強会#5
Yosuke Onoue
PPTX
教育機関でのJetsonの活用の可能性
智啓 出川
KEY
PyOpenCLによるGPGPU入門 Tokyo.SciPy#4 編
Yosuke Onoue
PDF
GPGPU Education at Nagaoka University of Technology: A Trial Run
智啓 出川
PDF
Cuda fortranの利便性を高めるfortran言語の機能
智啓 出川
Polymerやってみた
Yosuke Onoue
AngularJSでデータビジュアライゼーションがしたい
Yosuke Onoue
Angular 2のRenderer
Yosuke Onoue
アニメーション(のためのパフォーマンス)の基礎知識
Yosuke Onoue
GPGPU Seminar (PyCUDA)
智啓 出川
PyCUDAの紹介
Yosuke Onoue
Introduce build in shrinker
Daisuke Fuji
GPGPU deいろんな問題解いてみた
Ryo Sakamoto
x86x64 SSE4.2 POPCNT
takesako
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
Ryoma Sin'ya
Gradle PluginとCIと俺
Shinobu Okano
Popcntによるハミング距離計算
Norishige Fukushima
GPUが100倍速いという神話をぶち殺せたらいいな ver.2013
Ryo Sakamoto
Jetson TK1でSemi-Global Matching
Ryo Sakamoto
Rsa暗号で彼女が出来るらしい
Yosuke Onoue
CUDA 6の話@関西GPGPU勉強会#5
Yosuke Onoue
教育機関でのJetsonの活用の可能性
智啓 出川
PyOpenCLによるGPGPU入門 Tokyo.SciPy#4 編
Yosuke Onoue
GPGPU Education at Nagaoka University of Technology: A Trial Run
智啓 出川
Cuda fortranの利便性を高めるfortran言語の機能
智啓 出川
Ad
Similar to GDG DevFest Kobe Firebaseハンズオン勉強会
(17)
PPTX
JavaScriptから利用するFirebase
Takuji Shimokawa
PPTX
Firebase hands on in Matsuyama
Kenichi Tatsuhama
PDF
AngularFireで楽々バックエンド
Yosuke Onoue
PDF
Vue.js + firebase 実案件で使ってみた
亜也加 北洞
PPTX
FirebaseではじめるサーバレスSPA開発
GIG inc.
PDF
Firebase hands on_#1
Yuichi Morioka
PDF
Firebase Extensions はじめの一歩
Kenichi Tatsuhama
PDF
Firebase初心者がwebチャットアプリを作ってみた
SHOYAYAMAMOTO
PDF
Firebaseを使ってアプリを作ってみた
Gunma University
PDF
Firebase によるリアルタイム モバイル開発 @gcpug 福岡
Google Cloud Platform - Japan
PDF
Firestoreを勉強してみた
ishikawa akira
PDF
ruby、sinatraで作るfacebookアプリ
Toshiya Kurishima
PPT
Inside mobage platform
Toru Yamaguchi
PPTX
Android 開発を加速するオープンソースライブラリ
Kenichi Tatsuhama
PPTX
2C向けグローバルプロダクトでのFirebaseの使い方_Glasp_05/21/2024
Kei Watanabe
PPTX
ログインの全て
DaikiSato10
PDF
Firebase Realtime Database を C# から利用する
Yusuke Kojima
JavaScriptから利用するFirebase
Takuji Shimokawa
Firebase hands on in Matsuyama
Kenichi Tatsuhama
AngularFireで楽々バックエンド
Yosuke Onoue
Vue.js + firebase 実案件で使ってみた
亜也加 北洞
FirebaseではじめるサーバレスSPA開発
GIG inc.
Firebase hands on_#1
Yuichi Morioka
Firebase Extensions はじめの一歩
Kenichi Tatsuhama
Firebase初心者がwebチャットアプリを作ってみた
SHOYAYAMAMOTO
Firebaseを使ってアプリを作ってみた
Gunma University
Firebase によるリアルタイム モバイル開発 @gcpug 福岡
Google Cloud Platform - Japan
Firestoreを勉強してみた
ishikawa akira
ruby、sinatraで作るfacebookアプリ
Toshiya Kurishima
Inside mobage platform
Toru Yamaguchi
Android 開発を加速するオープンソースライブラリ
Kenichi Tatsuhama
2C向けグローバルプロダクトでのFirebaseの使い方_Glasp_05/21/2024
Kei Watanabe
ログインの全て
DaikiSato10
Firebase Realtime Database を C# から利用する
Yusuke Kojima
More from Yosuke Onoue
(10)
PDF
asm.jsとWebAssemblyって実際なんなの?
Yosuke Onoue
PDF
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
Yosuke Onoue
PDF
AngularJSでの非同期処理の話
Yosuke Onoue
PDF
社会的決定とAHP
Yosuke Onoue
PDF
Anaconda & NumbaPro 使ってみた
Yosuke Onoue
PDF
PythonistaがOCamlを実用する方法
Yosuke Onoue
KEY
What's New In Python 3.3をざっと眺める
Yosuke Onoue
KEY
PyOpenCLによるGPGPU入門
Yosuke Onoue
PPTX
数理最適化とPython
Yosuke Onoue
PPTX
201010ksmap
Yosuke Onoue
asm.jsとWebAssemblyって実際なんなの?
Yosuke Onoue
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
Yosuke Onoue
AngularJSでの非同期処理の話
Yosuke Onoue
社会的決定とAHP
Yosuke Onoue
Anaconda & NumbaPro 使ってみた
Yosuke Onoue
PythonistaがOCamlを実用する方法
Yosuke Onoue
What's New In Python 3.3をざっと眺める
Yosuke Onoue
PyOpenCLによるGPGPU入門
Yosuke Onoue
数理最適化とPython
Yosuke Onoue
201010ksmap
Yosuke Onoue
GDG DevFest Kobe Firebaseハンズオン勉強会
1.
Polymer & Firebase ハンズオン おのうえ(@_likr) 2015/10/11
GDG DevFest Kobe Firebaseハンズオン勉強会
2.
自己紹介 • おのうえ(@_likr) • ng-kyoto、GDG
Kobeスタッフ • 大学院でWebベース可視化システムの研究・開発
3.
今日の目的 • Firebase +
Polymerでお手軽 Webアプリ開発を体験してみる
4.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
5.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
6.
Firebase • BaaS (Backend
as a Service) • サーバー機能(Web + App + DB)を提供 • サーバー側プログラミング不要 • クライアントはWeb、iOS、Android、RESTが対応 • Google Cloud Platformの一部
7.
Firebaseの特徴 • Realtime Database •
透過的な保存と更新 • User Authentication • 様々なProviderによるログイン、ログアウト • Static Hosting • HTTP HeaderやRedirectの設定
8.
ライブラリ • AngularFire (AngularJS) •
EmberFire (Ember) • ReactFire (ReactJS) • PolymerElement (Polymer) • Ionic
9.
Polymer • Google主導のオープンソースフレームワーク https://www.polymer-project.org/ • WebComponents
+ α • Webアプリ内の再利用性の高い機能を コンポーネント化し利用しやすくする仕組み
10.
PolymerElementを使う $ bower install
hoge-element <!DOCTYPE html> <html> <head> <script src=“bower_components/webcomponentsjs/webcomponents-lite.js”> </script> <link rel=“import” href=“bower_components/hoge-element/hoge-element.html”> </head> <body> <hoge-element></hoge-element> </body> </html> 使用するElementをbowerでインストール タグとして使用 Custom Elements, HTML ImportsのPolyfillをロード Elementをインポート
11.
Element Catalog • 公式が配布するPolymerElement集 •
https://elements.polymer-project.org/ • マテリアルデザイン、Google API、アニメーショ ン、EC用フォーム、オフライン…
12.
サンプル <!DOCTYPE html> <html> <head> <script src="bower_components/webcomponentsjs/webcomponents-lite.js"> </script> <link
rel="import" href="bower_components/google-map/google-map.html"> <style> google-map { height: 600px; } </style> </head> <body> <google-map latitude="34.682933" longitude="135.506919" fit-to-markers> <google-map-marker latitude="34.682933" longitude="135.506919"> </google-map-marker> </google-map> </body> </html> index.html google-mapをインポート Google Mapを表示 マーカーを作成
14.
PolymerElementを作る <link rel="import" href="bower_components/polymer/polymer.html"> <dom-module
id="my-chart"> <link rel="stylesheet" href="bower_components/nvd3/build/nv.d3.css"> <style> .view { width: 600px; height: 600px; } </style> <template> <div class="view"><svg id="svg"></svg></div> </template> <script src="bower_components/d3/d3.js"></script> <script src="bower_components/nvd3/build/nv.d3.js"></script> <script src="my-chart.js"></script> </dom-module> my-chart.html polymerをインポート 利用側に挿入されるHTML要素を定義 my-chart要素を定義
15.
Polymer({ is: 'my-chart', ready: function
() { nv.addGraph(() => { const chart = nv.models.discreteBarChart() .x((d) => d.label) .y((d) => d.value) .staggerLabels(true) .tooltips(false) .showValues(true); d3.select(this.$.svg) .datum(exampleData()) .call(chart); nv.utils.windowResize(chart.update); return chart; }); } }); my-chart.js my-chartの振る舞いを定義 ライフサイクルメソッド
16.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <script src=“bower_components/webcomponentsjs/webcomponents-lite.js"> </script> <link
rel="import" href="my-chart.html"> </head> <body> <my-chart></my-chart> </body> </html> index.html
18.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
19.
準備 • Googleアカウントをつくる https://accounts.google.com/signup • Firebaseアカウントをつくる https://www.firebase.com/ •
Node.jsをインストールする https://nodejs.org/ • Chrome Dev Editorをインストールする https://chrome.google.com/webstore/category/apps
20.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
21.
Firebase • リアルタイムデータベースを触ってみる • デプロイしてみる
22.
プロジェクト作成 Chrome Dev EditorでBlank
projectを作成
23.
bower.json { "name": "FirebaseHandson01", "description": "", "homepage":
"", "keywords": [], "author": "", "private": true, "dependencies": { "firebase": "~2.3.1" } } 作成後、プロジェクトを右クリックして「bower install」 フロントエンドのパッケージ管理ツールbowerを使う (Chrome Dev Editorに標準搭載)
24.
<!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <div> <form
id="message-form"> <input id="message-input" type="text"> <button type="submit">Update</button> </form> </div> <div> <p id="date"></p> <p id="message"></p> </div> <script src="bower_components/firebase/firebase.js"></script> <script src="main.js"></script> </body> </html> main.js
25.
var firebaseURL =
'https://<your-app-id>.firebaseio.com'; var ref = new Firebase(firebaseURL + '/message'); ref.on('value', function (snapshot) { var message = snapshot.val(); if (message) { document.getElementById('date').innerHTML = new Date(message.date); document.getElementById('message').innerHTML = message.message; } }); document.getElementById('message-form') .addEventListener('submit', function (event) { event.preventDefault(); ref.set({ message: document.getElementById('message-input').value, date: Firebase.ServerValue.TIMESTAMP }); }); main.js 各自のアプリケーションIDに書き換える
28.
デプロイ • コマンドラインツールのインストール $ npm
install -g firebase-tools • 設定ファイルの初期化 $ firebase init • デプロイ $ firebase deploy • ブラウザで開く $ firebase open
29.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
30.
Polymer • コードラボやります • Build
Google Maps Using Web Components & No Code! http://www.code-labs.io/codelabs/polymer-maps/ index.html
31.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
32.
firebase-element • コードラボやります • Interacting
with data using the <firebase-element> http://www.code-labs.io/codelabs/polymer-firebase/ index.html
33.
訂正 app.onFirebaseLogin = function(event)
{ this.ref = new Firebase(this.firebaseURL + '/user/' + event.detail.user.uid); this.ref.on('value', function(snapshot) { this.updateItems(snapshot); }); }; app.onFirebaseLogin = function(event) { this.ref = new Firebase(this.firebaseURL + '/user/' + event.detail.user.uid); this.ref.on('value', function(snapshot) { app.updateItems(snapshot); }); }; https://github.com/googlecodelabs/polymer-firebase/issues/1 http://www.code-labs.io/codelabs/polymer-firebase/index.html#4
34.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
35.
firebase-element + Google
API • PolymerFirebaseCodelabの続きから • FirebaseのOAuthで取得したaccessTokenで Google APIにアクセスしてみる • Google Driveに保存する機能を追加する
36.
ログアウトボタン <firebase-auth id="auth" auto-login redirect location="[[firebaseURL]]" provider="[[firebaseProvider]]" on-error="onFirebaseError" on-login="onFirebaseLogin" on-logout="onFirebaseLogout"> index.html
37.
app.onFirebaseLogout = function
(event) { }; app.login = function (event) { this.$.auth.login(); }; app.logout = function (event) { this.$.auth.logout(); }; main.js
38.
<link rel="import" href="bower_components/paper-button/paper-button.html"> paper-buttonのimportを追加 <paper-button
on-click="login">Login</paper-button> <paper-button on-click="logout">Logout</paper-button> paper-buttonを追加 <paper-input value="{{newItemValue}}" placeholder="Enter you item here…" disabled="[[!loggedIn]]"> </paper-input> loginしていないと入力できないようにする
39.
app.loggedIn = false; app.onFirebaseLogin
= function (event) { this.loggedIn = true; this.ref = new Firebase(this.firebaseURL + '/user/' + event.detail.user.uid); this.ref.on('value', function (snapshot) { this.updateItems(snapshot); }.bind(this)); }; app.onFirebaseLogout = function (event) { this.loggedIn = false; this.items = []; };
40.
Drive APIの有効化 Google Developers
ConsoleからDrive APIを有効化する
41.
scopeを追加 app.firebaseParams = { scope:
"https://www.googleapis.com/auth/drive" }; <firebase-auth id="auth" redirect location="[[firebaseURL]]" provider="[[firebaseProvider]]" params="[[firebaseParams]]" on-error="onFirebaseError" on-login="onFirebaseLogin" on-logout="onFirebaseLogout"> </firebase-auth>
42.
iron-ajax <link rel="import" href="bower_components/iron-ajax/iron-ajax.html"> <iron-ajax id="uploadFile" method="POST" params="[[requestParams]]" body="[[requestBody]]" url="https://www.googleapis.com/upload/drive/v2/files"> iron-ajaxを使ってAPIにリクエストを行う
43.
accessTokenの取得 app.onFirebaseLogin = function
(event) { this.accessToken = event.detail.user.google.accessToken; this.loggedIn = true; this.ref = new Firebase(this.firebaseURL + '/user/' + event.detail.user.uid); this.ref.on('value', function (snapshot) { this.updateItems(snapshot); }.bind(this)); };
44.
アップロードボタン <paper-button on-click="uploadFile">Upload</paper-icon-button> app.uploadFile =
function (event) { this.requestParams = { access_token: this.accessToken, uploadType: 'media' }; this.requestBody = this.items.map(function (item) { return item.text; }).join('nn'); this.$.uploadFile.generateRequest(); };
46.
ポイント • FirebaseのOAuth時にscopeを指定する • Firebaseの認証情報からaccessTokenを取得する •
REST APIにアクセスする
47.
1. 概要 2. 準備 3.
Firebase 4. Polymer 5. firebase-element 6. firebase-element + Google API 7. もくもく会
48.
参考情報 • Polymer Codelabs
(Polymer Summit2015) http://www.code-labs.io/polymer-summit • Developer Docs - Firebase https://www.firebase.com/docs/
Download