Fireship · @fireship
Firebase in 100 Seconds
Uploaded February 17, 2022 · Length 2:35
Summary
firebase suite of tools for building apps and managing infrastructure on google cloud platform
- firebase
- google cloud
- backend as a service
- serverless computing
- cloud functions
- firebase sdk
- firestore
- firebase security rules
- firebase cloud functions
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
firebase a suite of tools for building
- 0:02
apps and managing infrastructure on top
- 0:04
of google cloud platform it was founded
- 0:06
by james tamplin and andrew lee in 2011
- 0:09
after they discovered that developers
- 0:10
were using their chat software to manage
- 0:12
non-chat application data this inspired
- 0:15
them to create a real-time database a
- 0:17
json database that automatically stays
- 0:19
in sync with your front-end application
- 0:21
it was later expanded to support user
- 0:23
authentication and website hosting to
- 0:25
act as a complete backend as a service
- 0:27
in 2014 it was acquired by google where
- 0:29
it was further expanded with serverless
- 0:31
computing via cloud functions push
- 0:32
notifications via cloud messaging and
- 0:34
other google services like analytics and
- 0:37
admob in 2017 google acquired fabric
- 0:39
from twitter and also launched a new
- 0:41
document database called firestore to
- 0:43
support a wider range of applications
- 0:45
most importantly though firebase
- 0:46
provides software development kits for
- 0:48
virtually every platform to manage and
- 0:50
scale this infrastructure with little to
- 0:52
no back-end code to build a full stack
- 0:54
application right now create a free
- 0:55
firebase project then open up some code
- 0:57
for your favorite front-end platform
- 0:59
install the firebase sdk then connect it
- 1:01
to the cloud with your project
- 1:02
credentials once initialized you can
- 1:04
start interacting with your backend
- 1:06
resources first we might want to know if
- 1:07
the user is logged in or not we can
- 1:09
listen to the current user with the on
- 1:11
off state changed function the user will
- 1:13
be null at first but we can log them in
- 1:14
with their google account using the sign
- 1:16
in with pop-up function now that we have
- 1:18
a user logged in we might want to store
- 1:20
something in a database we can make a
- 1:22
reference to a document in firestore
- 1:23
then write json data to it while making
- 1:25
a reference to the current user's user
- 1:27
id but the amazing thing is that we can
- 1:29
listen to updates to that data in real
- 1:31
time by simply referencing the document
- 1:33
using the onsnapshot function anytime
- 1:35
the data changes on the server it'll be
- 1:37
reflected in the ui with zero latency
- 1:39
thanks to optimistic updates out of the
- 1:41
box but that doesn't seem very secure
- 1:43
how do we control who has access to the
- 1:44
database firestore security rules allow
- 1:46
you to define access control logic in a
- 1:49
simple readable format with common
- 1:50
expression language you can do almost
- 1:52
everything from the front end but when
- 1:53
you do need to run server-side code
- 1:55
firebase cloud functions provides a
- 1:56
tightly integrated serverless backend
- 1:59
not only does it allow you to create


