Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vue.js + TypeScript + Firebase
Search
nunulk
January 19, 2019
Technology
970
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vue.js + TypeScript + Firebase
nunulk
January 19, 2019
More Decks by nunulk
See All by nunulk
Laravelでテストしやすいコードを書く5 / 5 tips of building testable modules in Laravel
nunulk
0
350
Design It! in a nutshell
nunulk
1
300
PHP Getting Faster
nunulk
0
290
How does learning English broaden your world?
nunulk
0
420
Testing on Laravel
nunulk
1
1.6k
Nuxt.js in TypeScript
nunulk
1
460
A startup meets Laravel + Vue.js
nunulk
1
2.1k
Unit Testing Laravel
nunulk
0
510
A Third-rate Programmer Talked about a Survival Strategy for Software Engineers
nunulk
3
610
Other Decks in Technology
See All in Technology
論語・武士道・産業革命から見る かわるもの、かわらないもの
ichimichi
8
2.1k
AI時代の強いチームの作り方
yuukiyo
23
13k
AWS環境のセキュリティ不安を解消した企業事例 ~よくある課題と対策を一挙公開~
asanoharuki
1
270
エンタープライズデータへ安全につなぐ Production-ready なエージェント設計 ― AI × MCP リファレンスアーキテクチャ ― #AIDevDay
cdataj
1
450
BigQuery を検索ソースとした AI Agent の作り方って 〇〇 通りあんねん
satohjohn
0
150
A Bag-of-Documents Model for Query Specificity
dtunkelang
0
190
脱Jenkins、インターン生が挑んだCIツールGitHubActions移行
mixi_engineers
PRO
1
300
PLaMoを毎日の開発で使い育てていく
pfn
PRO
0
170
WEBフロントエンド研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
900
クラウドを使う側から、作る側へ / 大吉祥寺.pm 2026前夜祭
fujiwara3
8
2k
AIツールを導入しても生産性はあがらない? カオナビが直面した 3つの壁と乗り越え方。/ Overcoming 3 Barriers to AI-Driven Productivity at kaonavi
kaonavi
0
1.4k
新しい SLO が良い感じにハマっている話
z63d
4
1.9k
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
280
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
450
The World Runs on Bad Software
bkeepers
PRO
72
12k
Facilitating Awesome Meetings
lara
57
7k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
560
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
920
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
Between Models and Reality
mayunak
4
380
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Transcript
Vue.js + Firebase + TypeScript Ͱ ϦΞϧλΠϜνϟοτ nunulk #ReBuildCamp
Firebase • Google ͕ఏڙ͢Δ mBaaS • Cloud Firestore (Beta), Cloud
Storage, Cloud Functions, A/B Testing, Cloud Messaging
ٕͬͨज़ • Vue.js: 2.5.22 • TypeScript: 3.2.4 • Firebase: 0.3.7
• Element: 2.4.11
ೝূ͕ඞཁͳύεͷࢦఆ routes: [ { path: '/', name: 'home', component: Home,
meta: { requiresAuth: true } },
ϛυϧΣΞ router.beforeEach((to, from, next) => { const requiresAuth = to.matched.some(record
=> record.meta.requiresAuth) if (!requiresAuth) { next() } else { firebase.auth().onAuthStateChanged(function (user) { if (user) { next() } else { next({ path: '/signin', query: { redirect: to.fullPath } })
Component export default class ChatBoard extends Vue { user: User
= { id: null, email: '', avatar_image_url: '' } participants: User[] = [] messages: Message[] = [] message: Message = { room_id, sender_id: null, content: ‘', created_at: null, }
Component created(): void { const fireUser = firebase.auth().currentUser; if (!fireUser)
{ return; } this.user.id = fireUser.uid; this.user.email = fireUser.email; db.collection('users').doc(this.user.id).get() .then((doc) => {})
Component db.collection('messages') .onSnapshot((snapshot) => { const changes = snapshot.docChanges() if
(!changes) { return } changes.forEach((change) => { if (change.type === 'added') { const message = { room_id: change.doc.data().room_id, sender_id: change.doc.data().sender_id, content: change.doc.data().content, created_at: this.timestamp2String(change.doc.data().created_at) }; this.addMessageData(message); }
σϞ