Setup Wizard
The Setup Wizard provides an interactive, step-by-step deployment experience for the Temp-Number App.
What is the Setup Wizard?
The Setup Wizard is an intelligent deployment script that:
- β Collects configuration through interactive prompts
- β Validates your environment and prerequisites
- β Configures Firebase and GCP projects as needed
- β Deploys to your chosen platform (Docker or Google Cloud)
- β Provides clear instructions for post-deployment tasks
- β Handles errors gracefully with helpful messages
Prerequisites
Before running the wizard, ensure you have:
Required
- Platfone Account: Get API credentials
- Google account: for access to Firebase Console
- Git: For cloning the repository
For Local Deployment
- Docker: Version 20.x or higher
- Docker Compose: Version 2.x or higher
For Google Cloud Deployment
- Google Cloud Account: With billing enabled
- gcloud CLI: Install instructions
- Domain Name: (Optional) For custom domain setup
π Getting Started
Step 1: Clone the Repository
git clone https://github.com/platfone-com/temp-number-deploy.git
cd temp-number-deployStep 2: Run the Setup Wizard
./setup-wizard.shThe wizard will start and guide you through the entire process.
Windows
Windows users: please refer to Windows Subsystem for Linux (WSL) guide.
βΆοΈ Demonstration Videos
Docker deploy demo
Google Cloud deploy demo
Wizard Flow
Step 1: Welcome Screen
The wizard displays a welcome message and overview of what it will do.
==========================================
π Temp Number - Setup Wizard
==========================================
This wizard will guide you through setting up the Temp Number application.
You can run it locally using Docker Compose or deploy it to Google Cloud.
Press Enter to continue...Action: Press Enter to proceed.
Step 2: Select Deployment Target
Choose where you want to deploy the application.
==========================================
Step 1: Select Deployment Target
==========================================
Where would you like to deploy the application?
1) Local Development (Docker Compose)
- Runs on your local machine
- Requires: Docker and Docker Compose
- Best for: Development and testing
2) Google Cloud Platform (Cloud Run)
- Hosted in the cloud
- Requires: GCP project with billing enabled
- Best for: Production deployment
Enter your choice [1-2]: 2
β Selected: Google Cloud PlatformOptions:
- 1 - Local Development: Runs the full stack on your local machine using Docker Compose
- 2 - Google Cloud Platform: Deploys to GCP using Cloud Run and CloudSQL
Recommendation:
- Use Local for development, testing, and learning
- Use GCP for production deployments with scalability
Step 3: Select Components to Deploy
(Local deployments only) Choose which components to include:
==========================================
Step 1b: Select Components to Deploy
==========================================
Which components would you like to deploy?
1) Full Stack (Database + Backend + Web Frontend)
- Complete application with web interface
- Best for: Full-stack deployment
2) Backend + Database Only (No Web Frontend)
- API server and database only
- Best for: Mobile app developers, API-only services
3) Web Frontend Only (requires existing Backend)
- Deploy/update web frontend only
- Best for: Updating web UI with existing backend
Enter your choice [1-3]: 1
β Selected: Full Stack (Database + Backend + Web)Options:
- 1 - Full Stack: Deploy complete application (MySQL + Backend + Web)
- 2 - Backend + Database Only: For mobile developers or API-only use cases
- 3 - Web Frontend Only: Update or redeploy web interface when backend is running
Note: This step only appears for local Docker deployments. GCP deployments always include all components.
Step 4: Prerequisites Check
The wizard verifies all required tools are installed.
==========================================
Step 2: Checking Prerequisites
==========================================
β gcloud CLI found
β Authenticated with gcloudWhat it checks:
For all deployments:
- gcloud CLI installation
- gcloud authentication status
For local deployments only:
- Docker installation
- Docker Compose availability
If checks fail:
- Install missing tools
- Authenticate with gcloud if prompted
- Re-run the wizard after fixing issues
Step 5: Source Code Repositories
The wizard checks if source code repositories are present and offers to clone them.
==========================================
Step 2b: Checking Source Code Repositories
==========================================
β Backend repository found
β Web repository foundWhat it does:
- Checks for
temp-number-backend/directory - Checks for
temp-number-web/directory - Offers to clone missing repositories if not found
If repositories are missing:
β Backend repository (temp-number-backend) not found
β Web repository (temp-number-web) not found
Missing repositories: temp-number-backend temp-number-web
These repositories contain the application source code and are required.
Would you like to clone the missing repositories now? (y/n):Options:
- y - Automatically clone repositories using git
- n - Skip and clone manually later
If you choose ‘y’: The wizard will run:
git clone https://github.com/platfone-com/temp-number-backend.git
git clone https://github.com/platfone-com/temp-number-web.gitStep 6: Firebase Project Setup
Firebase is required for all deployments (authentication).
==========================================
Step 3: Firebase Project Setup
==========================================
Firebase is required for user authentication.
Choose how to configure Firebase:
1) I have an existing Firebase project configured (provide key manually)
2) Set up a new or configure existing Firebase project (via GCP)
Enter your choice [1-2]: 2
βΉ Setting up new GCP project and Firebase...The wizard now offers two options for Firebase setup:
Option 1: Manual Firebase Key (Existing Project)
Use this option if you already have a Firebase project configured. This allows you to start without billing enabled.
If you answer ‘1’ (manual key for existing Firebase project):
Please download the Firebase Admin SDK key manually:
1. Go to Firebase Console: https://console.firebase.google.com/
2. Select your project
3. Go to Project Settings > Service Accounts
4. Click 'Generate New Private Key'
5. Save the file as: /path/to/config/secrets/firebase-service-account.json
Press Enter when you have downloaded the key...Steps:
- Visit Firebase Console
- Select your project
- Navigate to Project Settings (gear icon) β Service Accounts
- Click Generate New Private Key
- Download the JSON file
- Save it as:
config/secrets/firebase-service-account.json - Press Enter in the wizard
The wizard will:
- Verify the file exists
- Extract the project ID from the key
- Continue with setup
Option 2: Automated GCP & Firebase Setup
If you answer ‘2’ (automated setup via GCP), the wizard will guide you through a complete GCP and Firebase setup:
GCP Project Creation
==========================================
GCP Project Setup for Temp Number
==========================================
Select GCP Project:
1) Use existing project
2) Create new project
Enter choice [1-2]: 2
Enter new project ID (lowercase, hyphens allowed): temp-number
Enter project name [default: temp-number]:
βΉ Creating project 'temp-number'...
Create in progress for [https://cloudresourcemanager.googleapis.com/v1/projects/temp-number].
Waiting for [operations/create_project.global.8107866941552596405] to finish...done.
Enabling service [cloudapis.googleapis.com] on project [temp-number]...
Operation "operations/acat.p2-832601501946-408b1370-d5d2-46c4-84f1-012d142dc397" finished successfully.
INFORMATION: Project 'temp-number' has no 'environment' tag set. Use either 'Production', 'Development', 'Test', or 'Staging'. Add an 'environment' tag using `gcloud resource-manager tags bindings create`.
β Project created
Updated property [core/project].
β Active project: temp-numberThe wizard will:
- Create a new GCP project with your chosen ID
- Set it as the active project
- Check and enable billing
- Enable all required APIs
- Create a service account with necessary permissions
- Download the service account key
Billing Configuration
==========================================
Checking Billing
==========================================
βΉ Ensuring Cloud Billing API is enabled...
β Cloud Billing API is enabled
billingAccountName: ''
billingEnabled: false
name: projects/temp-number/billingInfo
projectId: temp-number
βΉ Checking billing status...
β Billing is not enabled for this project
βΉ Fetching available billing accounts...
Available billing accounts:
1) Firebase Payment
ID: 012345-67890AB-CDEFG
Select billing account [1-1]: 1
βΉ Linking project to billing account: Firebase Payment
billingAccountName: billingAccounts/012345-67890AB-CDEFG
billingEnabled: true
name: projects/temp-number/billingInfo
projectId: temp-number
β Billing account linked successfullyAPI Enablement
For local Docker deployments, API enablement is skipped:
βΉ Skipping API enablement (--skip-apis)
βΉ Skipping service account setup (--skip-service-account)For GCP cloud deployments, the wizard automatically enables all required APIs:
==========================================
Enabling Required APIs
==========================================
βΉ Enabling cloudbuild.googleapis.com...
β cloudbuild.googleapis.com enabled
βΉ Enabling run.googleapis.com...
β run.googleapis.com enabled
βΉ Enabling sqladmin.googleapis.com...
β sqladmin.googleapis.com enabled
βΉ Enabling secretmanager.googleapis.com...
β secretmanager.googleapis.com enabled
βΉ Enabling artifactregistry.googleapis.com...
β artifactregistry.googleapis.com enabledService Account Creation
For local Docker deployments, service account creation is skipped:
==========================================
Setup Summary
==========================================
β Setup completed successfully!
Project Details:
β’ Project ID: temp-number
β’ Service Account: Skipped
Service Account Key:
βΉ GCP Service Account: Skipped
Next Steps:
GCP project created.
1. Set up Firebase Authentication:
./setup_firebase_project.sh --project-id temp-number
2. For cloud deployment later, enable required APIs and service account:
./setup_gcp_project.sh --project-id temp-numberFor GCP cloud deployments, the wizard creates a service account:
==========================================
Creating Service Account
==========================================
βΉ Creating service account 'temp-number-deployer'...
β Service account created
==========================================
Granting IAM Roles
==========================================
βΉ Granting roles/cloudsql.admin...
β roles/cloudsql.admin granted
βΉ Granting roles/run.admin...
β roles/run.admin granted
βΉ Granting roles/secretmanager.admin...
β roles/secretmanager.admin grantedThe service account is granted these roles (GCP deployments only):
roles/cloudsql.admin- Manage CloudSQL databasesroles/cloudbuild.builds.editor- Build container imagesroles/run.admin- Deploy Cloud Run servicesroles/storage.admin- Access Cloud Storageroles/iam.serviceAccountUser- Act as service accountsroles/artifactregistry.admin- Manage container registryroles/secretmanager.admin- Manage secrets
Firebase Setup
After GCP project setup, the wizard configures Firebase:
β GCP project setup complete: temp-number
βΉ Setting up Firebase for project: temp-number
==========================================
Firebase Project Setup
==========================================
βΉ Setting GCP project: temp-number
βΉ Configuring quota project for Application Default Credentials...
βΉ Using current gcloud authentication
βΉ Active account: [email protected]
==========================================
Enabling Required APIs
==========================================
βΉ Enabling firebase.googleapis.com...
β firebase.googleapis.com enabled
βΉ Enabling identitytoolkit.googleapis.com...
β identitytoolkit.googleapis.com enabled
βΉ Enabling serviceusage.googleapis.com...
β serviceusage.googleapis.com enabled
βΉ Enabling cloudresourcemanager.googleapis.com...
β cloudresourcemanager.googleapis.com enabled
β All APIs enabled successfully
==========================================
Adding Firebase to Project
==========================================
β Firebase added to project successfully
==========================================
Initializing Firebase Authentication
==========================================
β Firebase Auth initialized successfullyFirebase Web App Creation
==========================================
Initializing Firebase Web App
==========================================
βΉ Checking for existing web apps...
βΉ Creating new Firebase web app...
βΉ Web app creation started (operation: operations/workflows/NjE3MGNmZWItYTRkMC00YzJkLWE0MjEtM2M2ZDQ4MTlmY2Iw)
βΉ Waiting for operation to complete...
βΉ Still waiting... (attempt 1/20)
β Operation completed
β Firebase web app created: 1:832601501946:web:0d4619583ad7a6382f1943
βΉ Waiting for app configuration to be ready...
βΉ Retrieving web app configuration...
β Firebase Web App Created Successfully!
==========================================
π₯ Firebase Web App Configuration
==========================================
βΉ Firebase SDK values retrieved and will be validated/populated automatically.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
VITE_FIREBASE_WEB_API_KEY=AIzaSyCUjyD24gCCv3R6U743Gdioo0s-f5BXXKw
VITE_FIREBASE_AUTH_DOMAIN=temp-number.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=temp-number
VITE_FIREBASE_APP_ID=1:832601501946:web:0d4619583ad7a6382f1943
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββAutomatic Configuration
The Firebase SDK values are now automatically populated in your web.env file. The wizard will validate and update the configuration file for you.
Authentication Provider Configuration
==========================================
Authentication Provider Configuration
==========================================
Which authentication providers would you like to enable?
Enable Email/Password authentication? (y/n) [default: y]:
Enable Google OAuth? (y/n) [default: n]:
Enable Apple OAuth? (y/n) [default: n]:
Enable Facebook OAuth? (y/n) [default: n]:
==========================================
Configuring Sign-In Methods
==========================================
βΉ β Email/Password: enabled (password required: true)
β Sign-in methods configured successfullyAuthorized Domains
==========================================
Configuring Authorized Domains
==========================================
βΉ Fetching existing authorized domains...
βΉ No existing domains found
βΉ Authorized domains to be configured:
β’ localhost
β’ temp-number.firebaseapp.com
β’ temp-number.web.app
β Authorized domains configured successfullyFirebase Admin SDK Key
==========================================
Downloading Firebase Admin SDK Key
==========================================
βΉ Looking for Firebase Admin SDK service account...
βΉ Attempt 1/12: Service account not found yet, waiting 5 seconds...
β Found Firebase service account: [email protected]
βΉ Creating service account key...
βΉ Attempt 1/5: Service account not fully provisioned yet, waiting 10 seconds...
β Key downloaded to: /home/user/temp-number-deploy/config/secrets/firebase-service-account.json
β Permissions set to 600Setup Summary
==========================================
Setup Summary
==========================================
β Setup completed successfully!
βΉ ==========================================
Project: temp-number
Configured Authentication Methods:
β Email/Password (password required: true)
Firebase Admin SDK Key: /home/user/temp-number-deploy/config/secrets/firebase-service-account.json
Authorized Domains:
- localhost
- temp-number.firebaseapp.com
- temp-number.web.app
Next Steps:
1. Verify Firebase Authentication settings in Firebase Console:
https://console.firebase.google.com/project/temp-number/authentication/providers
2. Update your backend configuration with Firebase credentials
βΉ For more details, see Firebase Console:
βΉ https://console.firebase.google.com/project/temp-number
β Firebase setup complete for project: temp-number
βΉ Skipping GCP service account setup (not needed for local Docker deployment)Step 7: Configuration Files Check
After Firebase/GCP setup is complete, the wizard verifies all configuration files are present.
==========================================
Step 5: Configuration Files
==========================================
Checking required configuration files...
β backend.env not found
β web.env not found
β backend.secrets not found
β firebase-service-account.json found
βΉ Creating missing configuration files from templates...
β Created backend.env from template
β Created web.env from template
β Created backend.secrets from template
β οΈ IMPORTANT: You need to edit the configuration files with your values
Configuration files that need editing:
β’ /home/user/temp-number-deploy/config/env/backend.env
(Database settings, server config)
β’ /home/user/temp-number-deploy/config/env/web.env
(Firebase config, API URLs)
β’ /home/user/temp-number-deploy/config/secrets/backend.secrets
(API keys, passwords, APP_KEY)
You can edit these files now or later.
The setup cannot continue until these files are properly configured.
Would you like to edit them interactively now? (y/n): yInteractive Editing:
If you answer y, the wizard opens each configuration file in nano editor for you to edit:
- backend.env - Opens in nano for editing
- web.env - Opens in nano for editing
- backend.secrets - Opens in nano for editing (this is where you set your
PLATFONE_API_KEY)
After Editing:
β Configuration files edited
==========================================
Validating Firebase Web Configuration
==========================================
β Firebase SDK values not set in web.env - populating automatically...
βΉ Backed up web.env to: /home/user/temp-number-deploy/config/env/web.env.backup.20251114_160920
β Firebase SDK values populated in web.env
βΉ Verifying configuration files...
βΉ Skipping DB_PASSWORD validation for local Docker deployment
βΉ Validating PLATFONE_API_KEY by making test request to https://temp-number-api.com/test/api/v1...
β PLATFONE_API_KEY is validThe wizard now:
- Automatically populates Firebase SDK values in
web.env(creates a backup first) - Validates your
PLATFONE_API_KEYby making a test API request - Skips database password validation for local deployments (uses default)
Minimal Configuration to Launch
For a quick demo build, you only need to set:
In backend.secrets:
PLATFONE_API_KEY- Your Platfone API key
All other values use sensible defaults.
For detailed configuration options, refer to Configuration Guide.
Step 8: Deploy Application
After all prerequisites are complete, the wizard offers to deploy.
βΉ All prerequisites are complete!
Ready to deploy? (y/n): yFor Docker Deployment
If you selected Local Development:
==========================================
Step 6: Deploy Application
==========================================
βΉ Deploying to local Docker Compose...
βΉ Configuring for local deployment...
βΉ Note: Configuration overrides for Docker deployment:
- DB_HOST='mysql'
- DB_PORT=3306
- DB_PASSWORD=temp_number_password (default if not set in backend.secrets)
- ALLOWED_ORIGINS='http://localhost:8080'
βΉ Starting Docker Compose...
This will:
1. Build Docker images
2. Start MySQL database
3. Start backend service
4. Start web frontend
5. Run database migrations
Press Enter to start deployment...
==========================================
Docker Compose Local Setup
==========================================
β Docker and Docker Compose are installed
βΉ Checking configuration files...
β Configuration files exist
β Firebase credentials found
βΉ Setting Firebase service account file permissions...
β Permissions set (644)
β Project directories found
βΉ Creating .env file for Docker Compose...
β Configuration loaded from .env file
βΉ Running mode: background (start services in background)
βΉ Starting services in background (profile: full)...What happens:
- The wizard runs
./docker-start.sh - Validates Docker and configuration files
- Sets proper permissions on Firebase credentials
- Creates Docker Compose
.envfile - Starts building Docker images for backend and web
Docker Build Output:
[+] Building 5.7s (27/34)
=> [web build 5/7] RUN npx update-browserslist-db@latest && npm install 3.5s
=> => # npm warn exec The following package was not found and will be installed: [email protected]
=> => # Latest version: 1.0.30001754
=> => # Installed version: 1.0.30001698
=> => # Removing old caniuse-lite from lock file
=> => # Installing new caniuse-lite version
=> => # $ npm install caniuse-liteThe build process:
- Uses cached layers where possible for faster builds
- Downloads and installs npm dependencies
- Builds the React frontend application
- Creates optimized production images
Success output:
π Deployment complete!
Your application is now running:
β’ Web Frontend: http://localhost:8080/app/
β’ Backend API: http://localhost:3333/api
β’ MySQL: localhost:3336
To manage your Docker services (view logs, stop, clean, etc.):
./docker-start.shFor GCP Deployment
If you selected Google Cloud Platform:
Step 6: Deploy Application
Deploying to Google Cloud Platform...
This will:
1. Create CloudSQL database instance
2. Deploy backend to Cloud Run
3. Run database migrations
4. Deploy web frontend to Cloud Run
Press Enter to start deployment...What happens:
- Runs
deploy_app.shwith all parameters - Creates CloudSQL MySQL instance
- Deploys backend to Cloud Run
- Runs database migrations
- Deploys web frontend to Cloud Run
- Configures environment variables and secrets
Success output:
β π Deployment complete!
Your application is now deployed to Google Cloud.
To get service URLs:
gcloud run services describe temp-number-web --region us-central1 --format='value(status.url)'
gcloud run services describe temp-number-backend --region us-central1 --format='value(status.url)'
To view logs:
gcloud logging read 'resource.type=cloud_run_revision' --limit 100 --project=temp-number
==========================================
Step 7: Configuring Firebase Authentication
==========================================
βΉ Checking current Firebase Auth configuration...
βΉ Web deployment: Using frontend URL from web.env
βΉ Callback URL: https://temp-number-web-p4oh4mgzxa-uc.a.run.app/app/deeplink
βΉ Authorized domain: temp-number-web-p4oh4mgzxa-uc.a.run.app
βΉ Setting Firebase Auth callback URL and authorized domain...Post-Deployment Firebase Configuration:
After GCP deployment completes, the wizard automatically:
- Retrieves the Cloud Run service URL for your web frontend
- Configures the Firebase Auth callback URL (for deep linking)
- Adds the Cloud Run domain to Firebase authorized domains
- Updates Firebase Auth settings to work with your deployed application
This ensures Firebase Authentication works correctly with your production deployment.
Automated Deployment
For automated or CI/CD deployments, please refer to:
CI/CD Integration
The setup wizard can be integrated into CI/CD pipelines for automated deployments. Setup wizard outputs commands it runs, which can be scripted in your pipeline.
Troubleshooting
Common Issues
Issue: “Docker not found”
# Install Docker
curl -fsSL https://get.docker.com | shIssue: “gcloud not authenticated”
# Authenticate with Google Cloud
gcloud auth login
gcloud auth application-default loginIssue: “Firebase credentials invalid”
- Ensure you downloaded the service account JSON from Firebase Console
- Check file path is correct and file is readable
- Verify the service account has required permissions
Issue: “Platfone API validation failed”
- Check your API key is correct
- Ensure your Platfone account is active
- Verify the API URL is correct
Getting Help
If you encounter issues:
- Review deployment output for errors and warnings
- Review troubleshooting section above
- Contact support at
What’s Next?
After successful deployment:
Configuration
Configure authentication, payments, and more
Development Guide
Customize and extend the application