The public menu is a zero-dependency web page served directly from Firebase Hosting. Customers can open it on any device — phone, tablet, or desktop — by visiting the restaurant’s URL. The page connects to the same Firebase Realtime Database used by the Android app, so any product added or deactivated by an admin appears (or disappears) on the menu within seconds, without any redeployment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/luisumit/LaPreviaRestobar/llms.txt
Use this file to discover all available pages before exploring further.
What It Is
Thepublic-menu/ directory contains three files:
| File | Purpose |
|---|---|
index.html | Structural shell: header with restaurant name, category filter section, status banner, and the product grid |
styles.css | Visual styling: topbar, product cards, category filter buttons, price display |
app.js | All logic: Firebase initialization, real-time data listener, category filters, and card rendering |
https://www.gstatic.com/firebasejs/10.12.4/.
index.html Structure
#tableBadge element is updated by JavaScript to show which table is viewing the menu. The #categoryFilters, #status, and #menuGrid elements are all populated dynamically by app.js at runtime.
Firebase Initialization and Real-Time Product Loading
app.js initializes the Firebase compat SDK and opens a persistent listener on the products/ node. The listener fires immediately on load with all current data and again whenever any product changes.
Initialize Firebase
firebase.initializeApp(firebaseConfig) connects to the laprevia-restobar project using the compat SDK. No authentication is required because the products/ node uses public read rules.Attach real-time listener
db.ref("products").on("value", ...) subscribes to all changes under the products/ node. This is a persistent subscription — the callback fires every time any product is created, updated, or deleted.Filter active products
Only products where
isActive !== false are included. Products deactivated by the admin (e.g. out-of-season items) are excluded automatically without requiring a page reload.Sort alphabetically
Products are sorted by
name using localeCompare so the menu always appears in a consistent alphabetical order regardless of insertion order in the database.Table Badge
The page reads themesa query parameter from the URL to identify which table is viewing the menu:
mesa parameter is present (e.g. a link shared on social media), the badge shows Carta as a neutral fallback.
Dynamic Category Filters
Categories are derived from the live product data rather than hardcoded:Firebase Hosting Configuration
public field points to the public-menu/ directory, which is the root served by Firebase Hosting. The catch-all rewrite rule ("**" → "/index.html") ensures that direct URL navigation always loads the single-page shell, preventing 404 errors.
Deploying
public-menu/ to Firebase Hosting’s CDN. The live URL is:
Only the
public-menu/ directory is deployed with --only hosting. The Firebase Realtime Database rules are deployed separately with firebase deploy --only database.