Prerequisites
Before you begin, make sure you have the following installed and configured:- Node.js 22 — required by the
enginesfield inpackage.json - Firebase CLI — install with
npm install -g firebase-tools - Google Cloud project with Firebase enabled and billing active (required for Cloud Functions)
- A PostgreSQL instance on Cloud SQL (required for financial reconciliation and reporting functions)
Clone the repository and install dependencies
Clone the TMT Platform source and install all Node.js dependencies.This installs all required packages, including
firebase-admin, firebase-functions, pg, stripe, seatsio, axios, and the @google-cloud/cloud-sql-connector.Authenticate with Firebase
Log in to your Firebase account and link the project.When prompted, select your Google Cloud project from the list. This sets the active Firebase project for all CLI commands.
Configure environment secrets
The platform reads sensitive credentials at runtime through Firebase configuration or environment variables. Set the required values before deploying.
The
config/config.js file initializes firebase-admin and exposes the Firestore db, auth, storage, and messaging instances used throughout the platform. Third-party credentials are referenced from this file and should be injected via Firebase Secrets — not hardcoded.Configure the Cloud SQL connection
The
config/dbpostgres.js helper connects to PostgreSQL using the @google-cloud/cloud-sql-connector. Update the connection details to match your Cloud SQL instance.config/dbpostgres.js
Deploy the functions
Deploy all Cloud Functions to your Firebase project.After deployment completes, the CLI prints the HTTPS endpoint URL for each function. It follows this pattern:
Make your first API call
The The function scrapes the BCV website, parses the USD and EUR rates, and writes two records to Firestore:
exchange_rates function fetches the current USD and EUR exchange rates from the BCV (Banco Central de Venezuela) and writes them to Firestore. It requires no request body.data/exchange_rates— current rates documentdata/exchange_rates/history/{id}— historical entry with a timestamp
Call a function that requires a request body
Most TMT Platform functions follow a consistent For user-facing functions (such as
{ data: { ... } } request body structure. For example, to set exchange rates manually:create_client, validate_user_type, and all order/payment functions), wrap your payload in a data key:Run functions locally
Use the Firebase Emulator Suite to develop and test functions without deploying.http://localhost:5001/<project-id>/<region>/<function-name>.
Next steps
Architecture
Understand how Firebase, Firestore, PostgreSQL, and third-party services fit together.
User management
Create and manage clients, collaborators, and staff accounts.
Events & Tickets
Generate tickets, manage access control, and run ticket offices.
Payments
Accept payments via Stripe, Banco Mercantil, and BCV.