This repository houses the Firebase backend logic for the Commently Web App, usable at https://commently.net (work in progress).
Cloud Firestore, Cloud Functions, Realtime Database, GitHub Actions
- A cloud function that takes in a site URL and provides site metadata. Used by the React frontend application,
commently-web-app, to resolve site metadata on the comments page for a given site. Source code: - Cloud Firestore security rules
- Realtime Database security rules
The provided source code is for a Firebase Cloud Function that interacts with the Realtime Database to store and retrieve page information for a web application. The schema for the Realtime Database is outlined below:
- Root
- page
- [pageHash]
- canonicalUrl: The canonical URL of the page.
- commentPageId: A unique identifier pointing to a document in Cloud Firestore that holds all comments for the particular page.
- (other page information attributes)
- [pageHash]
- page
- The root node of the Realtime Database contains a single key-value pair: "page".
- Under the "page" node, each page has a unique hash-based key denoted as
[pageHash]. The[pageHash]is generated using thehashed()function, which is likely a hash of the page URL. - Each page identified by its
[pageHash]contains information about the page, including thecanonicalUrlandcommentPageId, along with other attributes that are extracted from the page scraping process.