Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

User Presence System in Realtime - Online, Offline, Away

28.5K views
•
August 18, 2017
by
Fireship
YouTube video player
User Presence System in Realtime - Online, Offline, Away

TL;DR

Learn how to create a real-time user status system in Angular using Firebase, which detects if users are online, offline, or away.

Transcript

a real-time present system allows users to know whether or not their fellow users are online offline or away in some other idle status in this episode we're going to use slack as our inspiration to build a system that will show the status of users throughout the app we're building a fully fledged system that will be able to detect whether or not a ... Read More

Key Insights

  • 👤 The Firebase real-time database provides a mechanism for tracking user connections and determining their online/offline status.
  • 👻 The onDisconnect callback in Firebase allows for updating user statuses when they disconnect from the database.
  • 💨 Mouse events can be utilized to detect user engagement and manage away statuses.
  • 👤 The ngSwitch directive in Angular simplifies displaying different templates based on user statuses in the user interface.
  • 👤 The system can be easily extended to handle additional user statuses or event tracking.
  • 💳 Proper subscription management is important for efficient resource usage and avoiding memory leaks.
  • 👤 Integration with Firebase authentication is assumed to have been implemented prior to building the user status system.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: How does the system determine if a user is online or offline?

The system subscribes to the "info/connected" data in the Firebase real-time database, which indicates the user's connection status. If the user is connected, their status is set to online; otherwise, it is set to offline.

Q: What happens if a user closes the app or disconnects from the database?

By utilizing the Firebase onDisconnect callback, the system updates the user's status to offline when they disconnect from the database, even if they close the app or browser window.

Q: How does the system handle user inactivity?

The system tracks mouse events in the browser to determine user engagement. It resets a timer each time a new mouse event occurs. If the timer expires without any new mouse events, the system sets the user's status to away.

Q: Can the user interface be customized based on the user's status?

Yes, the user interface can be customized using the ngSwitch directive in Angular. Different templates can be displayed based on the user's status, allowing for custom icons or presentation styles.

Summary & Key Takeaways

  • This content demonstrates how to build a system that tracks the status of users in an Angular app, based on their engagement and connection to the Firebase real-time database.

  • The system differentiates between online, offline, and away statuses, updating the status in real-time.

  • The content covers subscribing to the Firebase database, determining the current user status, detecting disconnections, managing inactive states, and building the user interface to display user statuses.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from Fireship 📚

Build a Chatbot from Scratch - Dialogflow on Node.js thumbnail
Build a Chatbot from Scratch - Dialogflow on Node.js
Fireship
How to Build a Video Editing Tool with React and WebAssembly thumbnail
How to Build a Video Editing Tool with React and WebAssembly
Fireship
How to Build a RESTful API with Node.js Express thumbnail
How to Build a RESTful API with Node.js Express
Fireship
When being over-employed goes wrong... thumbnail
When being over-employed goes wrong...
Fireship
100+ Computer Science Concepts Explained thumbnail
100+ Computer Science Concepts Explained
Fireship
Vim in 100 Seconds thumbnail
Vim in 100 Seconds
Fireship

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.