Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Firebase で作る Web アプリケーション
Search
mikakane
November 17, 2018
Programming
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firebase で作る Web アプリケーション
mikakane
November 17, 2018
More Decks by mikakane
See All by mikakane
NestJS で始める怖くないバックエンド開発
mikakane
1
1.4k
コーディングがわからない
mikakane
0
170
Web制作現場のディレクションを支えるGitHub
mikakane
0
640
nuxt.js で plugins を作る
mikakane
0
840
@ionic/vue で Web アプリを作ってみる
mikakane
0
3k
Laravel Package Development
mikakane
16
7.2k
Nuxt.js x Firebase で非同期に開発する
mikakane
0
2.3k
フロントエンドで作る理由
mikakane
1
1.3k
技術顧問の現場から - 制作と教育、学習と生産
mikakane
0
730
Other Decks in Programming
See All in Programming
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
190
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
360
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
contenteditable と日本語入力に向き合う
colorful12
0
210
Next.js: The final boss of Web Performance
guaca
0
320
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.7k
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
2.8k
AIに “答え“を書かせるのを やめてみた
___akari11
0
130
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
360
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
820
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
620
The agentic SEO stack - context over prompts
schlessera
0
970
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Test your architecture with Archunit
thirion
2
2.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.3k
The SEO identity crisis: Don't let AI make you average
varn
0
590
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
New Earth Scene 8
popppiees
4
2.7k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
790
Transcript
chatbox.inc 後藤 知宏 Firebase で作る Web アプリケーション
chatbox.inc 後 藤 知 宏 株式会社chatbox 代表取締役 関西フロントエンドUG代表 Twitter :
@_mikakane エンジニア / 技術顧問
chatbox.inc firebase google のアプリケーションプラットフォーム
chatbox.inc Firebase Authentication Realtime Database Storage Hosting Functions
chatbox.inc Firebase Authentication ユーザ認証の機能を提供するバックエンド コードを書かずに認証基盤を構築可能 Github や Google などの Oauth
認証アプリ開発も Redirect URL 向けの ngrok など構築不要 管理ユーザは Web GUI で一覧確認可能で、 各ユーザに割り振られる UID でユーザ管理可能
chatbox.inc 多様な認証フロー
chatbox.inc Setup Firebase firebase.initializeApp({ apiKey: process.env.FB_APIKEY, authDomain: process.env.FB_AUTHDOMAIN, databaseURL: process.env.FB_DATABASEURL,
projectId: process.env.FB_PROJECTID, storageBucket: process.env.FB_STORAGEBUCKET, messagingSenderId: process.env.FB_MESSAGINGSENDERID }) ▷ firebase.initializeApp で 作成したプロジェクトのヒモ付を行う。 ▷ ドメイン単位の認証制限が可能
chatbox.inc Login with Github const provider = new firebase.auth.GithubAuthProvider() provider.addScope("admin:org")
provider.addScope("repo") const result = await firebase.auth().signInWithPopup(provider) console.log(result.credential.accessToken) console.log(result.user) ▷ provider を作成して、signInWithPopup でポップアップの認証が可能 ▷ Promise ベースで認証結果が受け取れる ◦ ユーザ情報に加えてサービスの access token も
chatbox.inc Login Persistance firebase.auth().onAuthStateChanged(user => { if(user){ // ... }else{
// ... } }) ▷ ログインの永続化も可能 ▷ 一度ログインした状態であれば、再度認証を実行しなくても上記で true の if ブロックが走る
chatbox.inc Web上でのユーザ管理
chatbox.inc Firebase Realtime Database クラウド上に操作可能なデータストレージを展開 WebSockets を利用してリアルタイム性の高い同期が行える データベースはアプリケーション全体で共有 JSON 形式で階層化可能だが、深くするより横に広くするのが設
計上のベスト・プラクティス 認証ユーザとの連携も可能で、 uid ベースで 指定キーへの読み書き制限を行うことで ユーザ private なデータストアとしても利用可能
chatbox.inc vuexfire Vue.js / Nuxt.js で Firebase Realtime Database を利用する際のおすすめプラグイン
WS と JS フレームワークのストア連携は 自力で頑張るよりライブラリに頼ったほうが良さげ https://github.com/posva/vuexfire
chatbox.inc vuexfire import { firebaseMutations } from 'vuexfire' export const
store = () => { state: { ... }, mutations: { ...firebaseMutations }, actions: setTokenRef = firebaseAction(({bindFirebaseRef}) => { bindFirebaseRef(‘token’,firebase.database().ref(‘/token’)) }) } ▷ Vuex Store のルートの mutations に firebaseMutations をマッピング ▷ firebaseAction をコールして state と database のヒモ付を行う。 ▷ firebase.database().ref(‘/token’).set(token) のコールで、自動的に Vuex にも反映される形式
chatbox.inc 読み書きの管理と認証の連携
chatbox.inc 使ってみて Hosting / Functions あたりは Netlify を利用したほうが便利そう Authentication は想像以上に簡単で便利
あとから剥がす際のコストは気になる ( auth:export で csv 出力は可能なよう ) RealtimeDatabase は考え方に慣れが必要そう Rule の設定ミスでのお漏らしが怖い
chatbox.inc Thanks!