Firebase
Deploy Localess to production on Firebase.
Firebase is the recommended way to run Localess in production. It uses Google Cloud infrastructure — Firebase Hosting, Firestore, Cloud Functions, and Cloud Storage — deployed automatically via Cloud Build.
For local exploration or personal use without a Google Cloud account, see the Docker or Local setup instead.
Prerequisites
Before you start:
- A Google account with billing enabled. Cloud Functions requires the Blaze (pay-as-you-go) plan.
- The Google Cloud SDK (
gcloud) installed and authenticated. - A fork of the Localess repository connected to your Cloud Build trigger (see Cloud Build).
Create Project
Open the Firebase console and create a new project.
Create Web App connection
- In the Firebase console, open Firebase Settings
- Go to your Apps section
- Select the Web App icon
- Fill in the App nickname field
- Check Also set up Firebase Hosting for this app checkbox
- Press Register app
- The registered app values will be used automatically during build in Cloud Build
- Press Next
- Press Next again
- Press Continue to console
Authentication
Localess uses Firebase Authentication to identify users and keep data secure. Enable Identity Platform in the Settings tab before configuring sign-in methods.
Email/Password
Login by Email and Password is enabled by default.
Google Identity Provider
- In the Firebase console, open the Auth section.
- On the Sign-in method tab, enable the Google sign-in method.
- Click Save.
To restrict access to a specific organisation domain, set the
_LOCALESS_AUTH_CUSTOM_DOMAINsubstitution variable in your Cloud Build trigger.
Microsoft Identity Provider
- In the Firebase console, open the Auth section.
- On the Sign-in method tab, enable the Microsoft provider.
- Add the Client ID and Client Secret from the Azure portal:
- Register a new app following the Azure AD v2.0 quickstart.
- Add
*.firebaseapp.comas a redirect URI for your Firebase project.
- Click Save.
Hosting
In the Firebase console, open the Hosting tab and create a default hosting site.
Firestore
In the Firebase console, open the Firestore tab and create a default database.
Service Account
Create a service account named build-deploy to assign to Cloud Builder. Follow the official guide.
The service account requires the following IAM roles:
| Role | Purpose |
|---|---|
| Cloud Build Service Account | Run builds |
| Firebase Admin | Full access to Firebase products |
| Service Account User | Act as the service account |
| Storage Usage Admin | Manage storage service state |
| Storage Object Admin | Full control over storage objects |
Enable Cloud APIs
Open Cloud Shell and run the following command. Some APIs take 5–10 minutes to become active after enabling, so run this ahead of your first deployment:
gcloud services enable \
firebasestorage.googleapis.com \
firebaseextensions.googleapis.com \
cloudfunctions.googleapis.com \
cloudbuild.googleapis.com \
artifactregistry.googleapis.com \
run.googleapis.com \
eventarc.googleapis.com \
pubsub.googleapis.com \
storage.googleapis.com \
translate.googleapis.com \
cloudbilling.googleapis.comThe command enables the following APIs:
| API | Service |
|---|---|
firebasestorage.googleapis.com | Cloud Storage for Firebase |
firebaseextensions.googleapis.com | Firebase Extensions |
cloudfunctions.googleapis.com | Cloud Functions |
cloudbuild.googleapis.com | Cloud Build |
artifactregistry.googleapis.com | Artifact Registry |
run.googleapis.com | Cloud Run |
eventarc.googleapis.com | Eventarc |
pubsub.googleapis.com | Pub/Sub |
storage.googleapis.com | Cloud Storage |
translate.googleapis.com | Cloud Translation |
cloudbilling.googleapis.com | Cloud Billing |
Configuration
The cloudbuild.yaml at the root of the repository is pre-configured for Localess deployments. No manual edits are required.
Cloud Build
To automatically deploy on every push, create a Cloud Build trigger:
- Open Cloud Build Triggers
- Click Create trigger and configure:
- Name — a name for your trigger
- Event — Push to a branch
- Repository — your fork of
https://github.com/Lessify/localess - Branch —
main - Configuration type — Cloud Build configuration file (YAML or JSON)
- Location — Repository
- Under Substitution variables, add:
| Variable | Description |
|---|---|
_LOCALESS_AUTH_CUSTOM_DOMAIN | Restrict sign-in to this domain (e.g. lessify.io). Leave empty to allow all domains. |
_LOCALESS_AUTH_PROVIDERS | Comma-separated auth providers. Available values: GOOGLE, MICROSOFT. |
_LOCALESS_LOGIN_MESSAGE | Optional message displayed on the login screen. |
- Click Create.
First start
After the first successful deployment, open the setup page to create your first user:
https://<firebase-project-id>.web.app/setuphttps://<firebase-project-id>.firebaseapp.com/setup
Troubleshooting
Cloud Function API not enabled
functions: missing required API cloudfunctions.googleapis.com. Enabling now...Enable Cloud Functions API in Marketplace, then re-run the Enable Cloud APIs command.
Artifact Registry API not enabled
artifactregistry: missing required API artifactregistry.googleapis.com. Enabling now...Enable Artifact Registry API in Marketplace, then re-run the Enable Cloud APIs command.
Cloud Run API not enabled
functions: missing required API run.googleapis.com. Enabling now...Enable Cloud Run API in Marketplace, then re-run the Enable Cloud APIs command.
Eventarc API not enabled
functions: missing required API eventarc.googleapis.com. Enabling now...Enable Eventarc API in Marketplace, then re-run the Enable Cloud APIs command.
Missing permissions
Missing permissions required for functions deploy. You must have permission iam.serviceAccounts.ActAs on service account project-id@appspot.gserviceaccount.com.Assign the Service Account User role to project-id@appspot.gserviceaccount.com. Changes may take a few minutes to propagate.
IAM Roles verification failed
functions: Failed to verify the project has the correct IAM bindings for a successful deployment.Run the gcloud projects add-iam-policy-binding commands shown in the error output. You can execute them directly in Cloud Shell.
Function requires manual deletion
Error: The following functions are found in your project but do not exist in your local source code:
importLocaleJson(us-central1)Delete the orphaned function from one of:
- Google Cloud Console → Cloud Functions
- Google Cloud Console → Cloud Run
- Firebase Console → Functions
Cloud Translation API not enabled
Cloud Translation API has not been used in project {projectId} before or it is disabledEnable Cloud Translation API in Marketplace, then re-run the Enable Cloud APIs command.