SlideShare a Scribd company logo
Hacking real-time
messaging with
@_arturdas
Artur Daschevici
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
As a developer I like writing code
As a developer I like working with
shiny technologies
I want to scale to one users
I want to control everything
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
‣ Redis Server - free and open source

‣ PUB/SUB channels

‣ redis-cli - allows for interactive testing
•App Server

•Front end application

•Load Balancer (We need to
scale..)
•Centralized logging (We need to
solve bugs quickly)

•Need stats because there is a
lot of log data
And pretty soon…
Hacking Real time Messaging with Firebase
…and of course
or maybe
Hacking Real time Messaging with Firebase
Enter Firebase
Hacking Real time Messaging with Firebase
•Free CDN and SSL

•Easy auth

•Free Tier

•File Storage

•Auto Magical Scaling
Etc…
Getting Started
Grab your config
Maybe set up some auth
And we have a real time 

messaging queue
Hacking Real time Messaging with Firebase
+
‣reactfire

‣react-redux-firebase

‣firebase
In our project we’re going to use
This is what the demo, will be, hopefully…
Code
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
Return that id as part of a JSON response
Every user that joins 

gets a unique id
Real time magic
Increment the number of user claps
Grab the user from the post data
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
We initialize the firebase connection
Create an auth object
And use it to sign in generating a token
Get a reference to the db
Give it some
data
Insert it into the firebase store
Hacking Real time Messaging with Firebase
Hacking Real time Messaging with Firebase
Actions for triggering store changes
Static assets like images
Components for rendering the UI
Main entry point of the front end
Folder for the reducers
Routes folder for better modularization
Saga folder containing sagas for side effects
Folder where you have your store config
Large JavaScript apps are fun
Always pass in

the store
You can factor

out the routes
And you can export them as lists which is pretty cool
When the component

mounts we want to

start listening to

firebase
Very plain

component Some prop validation because

we should
connect() the component
Bind actions to component 

props
Actions, really basic not much going on here
Reducers, still does not seem like there is any real time magic
Hacking Real time Messaging with Firebase
redux-saga
redux-saga is a redux middleware for handling 

side-effects
redux-saga is implemented using generator funcs.

generator functions can be paused and resumed.
And now for the
We’re talking about Sagas
This is where
all the magic happens
UI
API
Hacking Real time Messaging with Firebase
It’s…Complicated
Import firebase 

because we want it
Saga goodies for performing 

our actions
This is the

firebase library

in action
Turn it off once

you’re done
Hacking Real time Messaging with Firebase
Create a channel
Then dispatch changes…infinitely??
And then you wrap everything nicely 

in a root saga
Hacking Real time Messaging with Firebase
DEMO
https://github.com/
adaschevici/firebase-
demo
References
@_arturdas
Artur Daschevici
Stay classy DevDay

More Related Content

PPTX
Developing serverless applications with .NET on AWS
PDF
Communication tool & Environment for Remote Worker
PDF
Technology | Serverless
PPTX
AWS API Gateway
PDF
Front End Orlando - AWS Lambda
PDF
Ruby Conference Belarus 2019 Apr Jets Ruby Serverless Framework
PDF
Ben Kehoe - Serverless Architecture for the Internet of Things
PPTX
Serverless Architecture
Developing serverless applications with .NET on AWS
Communication tool & Environment for Remote Worker
Technology | Serverless
AWS API Gateway
Front End Orlando - AWS Lambda
Ruby Conference Belarus 2019 Apr Jets Ruby Serverless Framework
Ben Kehoe - Serverless Architecture for the Internet of Things
Serverless Architecture

What's hot (20)

PDF
Serverless Architecture Patterns - Manoj Ganapathi
PPTX
Serverless by examples and case studies
KEY
Keeping Rails on the Tracks
PDF
From monolithic to serverless with Amazon Step Functions
PDF
[DevDay 2017] Serverless Architecture - Speaker: Trung Huynh - Software Engin...
PDF
Is Serverless The New Swiss Cheese?
PPTX
Pratical eff-scalaitaly-2017
PDF
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
PDF
Capistrano @antistatque - deploy to the moon
PDF
Pratical eff monad at Scaladays Chicago
PDF
Pratical eff
PDF
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
PPT
The basic process of Ruby on Rails
PPTX
Amazingly Simple Serverless Go
PPTX
Practical Cloud
PDF
AWS Community Day Bangkok 2019 - Hello ClaudiaJS
PDF
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
PDF
Building Composable Serverless Apps with IOpipe
PDF
AWS Community Day Bangkok 2019 - Dev Ops Philosophy Increase Productivity
PDF
Introduction to AWS Lambda with Python
Serverless Architecture Patterns - Manoj Ganapathi
Serverless by examples and case studies
Keeping Rails on the Tracks
From monolithic to serverless with Amazon Step Functions
[DevDay 2017] Serverless Architecture - Speaker: Trung Huynh - Software Engin...
Is Serverless The New Swiss Cheese?
Pratical eff-scalaitaly-2017
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
Capistrano @antistatque - deploy to the moon
Pratical eff monad at Scaladays Chicago
Pratical eff
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
The basic process of Ruby on Rails
Amazingly Simple Serverless Go
Practical Cloud
AWS Community Day Bangkok 2019 - Hello ClaudiaJS
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
Building Composable Serverless Apps with IOpipe
AWS Community Day Bangkok 2019 - Dev Ops Philosophy Increase Productivity
Introduction to AWS Lambda with Python

Similar to Hacking Real time Messaging with Firebase (20)

PDF
Firebase in action 2021
PDF
Firebase Tech Talk By Atlogys
PDF
Aura LA GDG - July 17-2017
PPTX
Firebasics
PDF
Build a chatroom!
PDF
DevOps Workshop Part 1
PPTX
Firebase 101 - Firebase Guide Zero to Hero
PDF
Firebase Adventures - Going above and beyond in Realtime
PPTX
Firebase Cloud Functions
PDF
Firebase Adventures - Real time platform for your apps
PDF
IDEALIZE 2023 - NodeJS & Firebase Session
PPTX
Firebase - cloud based real time database
PDF
Firebase in a Nutshell
PPTX
Tk2323 lecture 8 firebase
PDF
Add a backend and deploy!
PDF
Firebase_not_really_yohoho
PPTX
Intoduction of FIrebase Realtime Database
PPTX
Firebase - A real-time server
PPTX
Google Firebase
PDF
Redundant devops
Firebase in action 2021
Firebase Tech Talk By Atlogys
Aura LA GDG - July 17-2017
Firebasics
Build a chatroom!
DevOps Workshop Part 1
Firebase 101 - Firebase Guide Zero to Hero
Firebase Adventures - Going above and beyond in Realtime
Firebase Cloud Functions
Firebase Adventures - Real time platform for your apps
IDEALIZE 2023 - NodeJS & Firebase Session
Firebase - cloud based real time database
Firebase in a Nutshell
Tk2323 lecture 8 firebase
Add a backend and deploy!
Firebase_not_really_yohoho
Intoduction of FIrebase Realtime Database
Firebase - A real-time server
Google Firebase
Redundant devops

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
Teaching material agriculture food technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Teaching material agriculture food technology
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
Advanced methodologies resolving dimensionality complications for autism neur...
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
sap open course for s4hana steps from ECC to s4
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine learning based COVID-19 study performance prediction

Hacking Real time Messaging with Firebase