TheDocumentation 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.
infra/ directory contains the Infrastructure-as-Code (IaC) foundation for La Previa Restobar. It is designed as a preparatory layer — not all resources are created by default — and its purpose is to automate and document the cloud and local environment so that future deployments are repeatable and auditable. The infrastructure is intentionally decoupled from the Android app’s main development flow and can be adopted incrementally.
Directory Structure
Three Infrastructure Components
Terraform
Provisions Google Cloud Run, Artifact Registry, Firebase Realtime Database, IAM service accounts, and Secret Manager secrets. All resources are defined declaratively and managed through
terraform apply.Ansible
Runs environment verification tasks locally — checking for Node.js, Firebase CLI, and the Gradle Wrapper — and automates
firebase deploy --only hosting for the QR digital menu.Firebase CLI
Publishes Firebase Hosting and security rules independently of Terraform, using
firebase deploy. The public digital menu (public-menu/index.html) is deployed this way.Architecture
The following describes the end-to-end flow across all infrastructure components:- The Android app communicates with the Cloud Run backend over HTTPS for all restaurant management operations.
- The Cloud Run backend is an Express.js Node.js 18 service containerized via
backend/Dockerfileand stored in Artifact Registry. It connects to Firebase Realtime Database and reads its credentials from Secret Manager at startup. - Firebase Hosting serves the static QR digital menu independently from the backend. It is deployed via the Firebase CLI or the Ansible
deploy-menu.ymlplaybook.
Backend Docker Container
The backend image is built frombackend/Dockerfile using Node.js 18. The application entry point is server.js, exposing port 3000. Dependencies include express@^4.18.2 and firebase-admin@^12.0.0.
backend_service_account_json_secret_version variable is set, the container startup command writes the Firebase service account JSON from Secret Manager to serviceAccountKey.json before launching node server.js.
Ansible Playbooks
- playbook.yml — Environment Check
Verifies that the local deployment environment has all required tools installed. Run it before any deployment task.Checks performed:
node --version— Node.js is availablefirebase --version— Firebase CLI is availablegradlew.batexists at the project root
Foundational / Preparatory Nature
The Terraform configuration provisions real Google Cloud and Firebase resources. The
terraform apply command should only be run after reviewing terraform plan output and populating terraform.tfvars with your project’s values. Several optional resources (such as a staging Android app and the Firebase service account secret version) are gated behind boolean variables and are not created by default.Next Steps
Terraform Reference
Detailed variable reference, resource descriptions, outputs, and step-by-step deployment instructions for provisioning all Google Cloud and Firebase resources.
CI/CD Pipeline
GitHub Actions workflow that runs Detekt, Lint, unit tests, builds debug and release APKs, and distributes builds via Firebase App Distribution.