8000 GitHub - DHTMLX/firebase-scheduler-demo: Real-time event scheduling with DHTMLX Scheduler and Firebase Firestore, featuring multi-user sync and live updates in browser
[go: up one dir, main page]

Skip to content

Real-time event scheduling with DHTMLX Scheduler and Firebase Firestore, featuring multi-user sync and live updates in browser

Notifications You must be signed in to change notification settings

DHTMLX/firebase-scheduler-demo

Repository files navigation

DHTMLX Scheduler ⇄ Firebase Realtime Demo

This demo shows how to connect DHTMLX Scheduler with Firebase Cloud Firestore to enable real-time updates and multi-user synchronization. When one user creates, edits, or deletes an event, the change is instantly reflected in other open browser tabs - no page reloads needed.

The setup makes it easy to build collaborative scheduling tools where multiple users can interact with the same calendar at the same time. Everything runs on the client side using Vanilla JS and Vite, with Firebase handling data storage and live updates.

Features

  • Realtime two-way sync - every Scheduler change is written to Firestore, every Firestore change is streamed back and patched into Scheduler.
  • Zero-backend setup - pure frontend, Firebase hosts the database, websockets and auth tokens for you.
  • Bulk first load, delta afterwards - fast initial scheduler.parse(), then per-document updates via scheduler.ext.liveUpdates.

Quick start

git clone https://github.com/DHTMLX/%REPO%.git
cd scheduler-firebase-realtime
npm i
cp .env.example .env             # paste your Firebase keys
npm run dev

Open http://localhost:5173 in two browser tabs and watch events propagate in real time.

Setting-up Firebase

  1. Create a project in Firebase Console.

  2. Create Firestore Database

  3. Register the app

  4. Paste Firebase configuration JSON into your .env file (see next section).

.env format

VITE_FIREBASE_CONFIGURATION={"apiKey":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","authDomain":"scheduler-firebase-demo-f9d89.firebaseapp.com","databaseURL":"https://scheduler-firebase-demo-f9d89.firebaseio.com","projectId":"scheduler-firebase-demo-f9d89","storageBucket":"scheduler-firebase-demo-f9d89.firebasestorage.app","messagingSenderId":"56800422361","appId":"1:56800422361:web:b773751740cd0dd948d1c8","measurementId":"G-T91CRYLQLR"}

Repo structure (relevant bits)

index.html
src/
  ├─ firebase.js
  └─ main.js
.env.example
package.json
vite.config.js

Scripts

npm run dev - Vite dev-server (localhost:5173)
npm run build - Production build to /dist
npm run preview - Serve the built /dist locally

Deploy the finished bundle to Firebase Hosting:

npm i -g firebase-tools      # once
firebase login
firebase init hosting        # pick 'dist' as public folder
npm run build && firebase deploy

License

Source code in this repo is released under the MIT License.
DHTMLX Scheduler is a commercial library - use under a valid DHTMLX license or evaluation agreement.

Using Firebase Firestore / Hosting is subject to Google's terms of service and billing. Stay within the free tier or set quotas.

Useful links

About

Real-time event scheduling with DHTMLX Scheduler and Firebase Firestore, featuring multi-user sync and live updates in browser

Topics

Resources

Stars

Watchers

Forks

0