Prerequisites
Before deploying, make sure you have the following:- Node.js 22 — required by the
enginesfield inpackage.json - Firebase CLI — install globally with
npm install -g firebase-tools - A Firebase project on the Blaze plan with Cloud Functions enabled
- A Cloud SQL PostgreSQL instance if you use any reporting or reconciliation functions
- Billing enabled on your Google Cloud project
The
package.json engines field pins the runtime to Node.js 22. Firebase will use this version when deploying your functions.Deployment workflow
Install dependencies
Install all Node.js packages from the Key dependencies installed include
functions/ directory.firebase-admin, firebase-functions, @google-cloud/cloud-sql-connector, pg, stripe, seatsio, and axios.Authenticate with Firebase
Log in to your Google account and select your Firebase project.Then link the project to this directory:When prompted, choose your project from the list. This writes a
.firebaserc file that the CLI uses for all subsequent commands.Set Firebase config secrets
The TMT Platform reads all sensitive credentials from Firebase Secrets at runtime. Set each secret with the CLI — you will be prompted to enter the value interactively.Seats.ioBanco MercantilBanco de Venezuela (BDV)NotificationsCloud SQL (PostgreSQL)
Deploying specific functions
To deploy a single function without redeploying everything, pass the function name to--only functions:
Local development with the Firebase Emulator
The Firebase Emulator Suite lets you run Cloud Functions locally without deploying to Firebase.Open the Emulator UI
Navigate to
http://localhost:4000 in your browser to access the Emulator UI. From here you can inspect function invocations, view logs, and browse emulated Firestore data.The local emulator cannot connect to Cloud SQL. Functions that call
sqltmt() will fail unless you point config/dbpostgres.js at a local PostgreSQL instance during development.Monitoring logs
View real-time logs from deployed functions using the Firebase CLI:Available npm scripts
Thepackage.json defines the following convenience scripts:
| Script | Command | Description |
|---|---|---|
npm run serve | firebase emulators:start --only functions | Start the local Functions emulator |
npm run shell | firebase functions:shell | Open an interactive Functions shell for testing |
npm start | npm run shell | Alias for shell |
npm run deploy | firebase deploy --only functions | Deploy all functions to Firebase |
npm run logs | firebase functions:log | Stream logs from deployed functions |