La Previa Restobar relies on Firebase for its real-time backend — orders, tables, and product data are all synchronized through Firebase Realtime Database, while Firebase Authentication controls who can read and write that data. Follow the steps below to provision a Firebase project and wire it up to the Android app.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.
Create a Firebase project
Go to console.firebase.google.com and click Add project.If you are working with your own Firebase project, update this alias by running
- Give the project a name (the existing project alias in this repository is
laprevia-restobar). - Optionally enable Google Analytics when prompted.
- Once the project is created, click Add app, choose the Android platform, and register the package name
com.laprevia.restobar.
.firebaserc at the repository root pins the default project alias:.firebaserc
firebase use --add from the repository root after installing the Firebase CLI.Enable Firebase Realtime Database
In the Firebase console, navigate to Build → Realtime Database and click Create database. Choose a region and start in locked mode — you will deploy the correct rules in the next step.The database security rules are stored in The file The rules themselves enforce the following access model:Firebase persistence is also enabled inside
database.rules.json at the repository root. Deploy them with the Firebase CLI:firebase.json tells the CLI where to find the rules:firebase.json
database.rules.json
The
products node is publicly readable so that the digital menu (hosted via Firebase Hosting) can display items without requiring a login. Every other node — tables, orders, and all paths not explicitly listed — requires an authenticated user.FirebaseModule.kt so the app can operate offline:app/src/main/java/com/laprevia/restobar/di/FirebaseModule.kt
Enable Firebase Authentication
In the Firebase console, go to Build → Authentication and click Get started. On the Sign-in method tab, enable the Email/Password provider.The app obtains a Database rules depend on
FirebaseAuth singleton through Hilt:app/src/main/java/com/laprevia/restobar/di/FirebaseModule.kt
auth != null, so Authentication must be active before any staff member can sign in and interact with orders or tables.Enable Firebase App Check with Play Integrity
In the Firebase console, go to Build → App Check. Select your Android app and choose Play Integrity as the provider. Click Save.App Check prevents unauthorized clients from accessing your Firebase backend. During development, register a debug token so local and CI builds can still call Firebase:
- In the Firebase console, open App Check → Apps, click the overflow menu on your Android app, and select Manage debug tokens.
- Click Add debug token, copy the generated token.
- On the device or emulator, the
firebase-appcheck-debuglibrary (already included as a dependency) prints a local debug token to Logcat on first launch. Register that token in the console as well.
app/build.gradle.kts:Debug App Check tokens are only valid for development. Release builds use Play Integrity automatically — no additional configuration is required in the app code.
Download google-services.json and place it in app/
In the Firebase console, open Project settings (the gear icon) and scroll to Your apps. Click google-services.json to download the configuration file.Move the downloaded file into the The
app/ directory:com.google.gms.google-services Gradle plugin (already applied in app/build.gradle.kts) reads this file at build time and generates the Firebase initialization resources automatically.google-services.json is listed in .gitignore and must never be committed to version control. It contains your Firebase project’s API keys and configuration. For CI/CD, store the full file content as the GitHub Secret GOOGLE_SERVICES_JSON — see the Local Properties page for details.Enable Firebase Crashlytics and Performance Monitoring
Both services are already wired into the build — no extra console setup is required beyond enabling them for your project.In the Firebase console:And the runtime dependencies are pulled in via the Firebase BOM:Crashlytics NDK support is included to capture native crash reports. Performance Monitoring instruments network requests and app start time automatically.
- Crashlytics: Go to Release & Monitor → Crashlytics and click Enable Crashlytics.
- Performance Monitoring: Go to Release & Monitor → Performance and click Get started.
app/build.gradle.kts:app/build.gradle.kts