Configuration Guide

Configure ERP Mobile Bridge to match your requirements and integrate with Firebase for push notifications.

Environment Configuration

Basic Settings

Edit your .env file to configure basic application settings:

# Application
APP_NAME="Your App Name"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com

# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password

# Mail (Optional)
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="noreply@yourdomain.com"
MAIL_FROM_NAME="${APP_NAME}"
Important: Set APP_DEBUG=false in production to prevent sensitive information leakage.

Firebase Configuration

Firebase is required for push notifications. Follow these steps to configure Firebase:

Step 1: Create Firebase Project

  1. Go to Firebase Console
  2. Click "Add project" and follow the setup wizard
  3. Enable Google Analytics (optional)

Step 2: Get Service Account Key

  1. In Firebase Console, go to Project Settings (gear icon)
  2. Navigate to "Service accounts" tab
  3. Click "Generate new private key"
  4. Download the JSON file

Step 3: Configure in ERP Mobile Bridge

Place the Firebase service account JSON file in your project:

storage/app/firebase/firebase-credentials.json

Update your .env file:

FIREBASE_CREDENTIALS=firebase/firebase-credentials.json
Note: Ensure the storage/app/firebase/ directory exists and has proper permissions.

Step 4: Test Firebase Connection

You can test the Firebase connection by sending a test notification from the admin panel.

App Settings Configuration

Configure your app settings through the admin panel at /app-settings:

Basic Information
Field Description Example
App Name Your application name My Awesome App
Package Name Android/iOS package identifier com.example.myapp
Platform Target platform(s) Both, Android, or iOS
Website URL Your website to load in the app https://example.com

Logo Upload

Upload your app logos through the App Settings page:

App Logo

Recommended Size: 512x512px

Format: PNG with transparency

Usage: App icon, admin panel branding

This logo appears in the admin sidebar, login page, and is served to mobile apps.

Splash Logo

Recommended Size: 1080x1920px

Format: PNG with transparency

Usage: App splash screen

This logo appears when the mobile app launches.

Tip: Logos are stored in storage/app/public/logos/ and accessible via /storage/logos/

Color Customization

Customize your app's color scheme to match your brand:

Primary Color

Main brand color used for headers, buttons, and accents.

Default: #2196f3    

Secondary Color

Secondary brand color for highlights and CTAs.

Default: #ffc107    

Colors are sent to mobile apps via API and applied to native UI elements.

Feature Toggles

Enable or disable app features through the App Settings page:

Feature Description Default
Pull to Refresh Allow users to refresh content by pulling down Enabled
Exit Popup Show confirmation dialog when user tries to exit Enabled
Hide Header Hide the app header/toolbar Disabled
Hide Footer Hide the app footer/navigation Disabled
Maintenance Mode Show maintenance message to app users Disabled

Custom Messages

Share Message: Customize the message shown when users share your app.

Example: "Check out this amazing app!"

Offline Message: Message displayed when device is offline.

Example: "No internet connection. Please check your network settings."

Production Setup

Optimization

Before deploying to production, run these optimization commands:

# Cache configuration
php artisan config:cache

# Cache routes
php artisan route:cache

# Cache views
php artisan view:cache

# Optimize autoloader
composer install --optimize-autoloader --no-dev

Security Checklist

  • Set APP_DEBUG=false
  • Use strong database passwords
  • Enable HTTPS/SSL
  • Set proper file permissions (755 for directories, 644 for files)
  • Keep .env file secure and outside web root
  • Regularly update dependencies
  • Enable firewall and fail2ban
  • Regular database backups

Web Server Configuration

Apache (.htaccess)

Ensure mod_rewrite is enabled. The .htaccess file should already be in the public directory.

Nginx

Add this configuration to your Nginx server block:

server {
    listen 80;
    server_name yourdomain.com;
    root /path/to/web2app-pro/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

SSL/HTTPS Setup

Use Let's Encrypt for free SSL certificates:

# Install Certbot
sudo apt install certbot python3-certbot-nginx

# Get certificate
sudo certbot --nginx -d yourdomain.com

# Auto-renewal is configured automatically
Best Practice: Always use HTTPS in production for security and API compatibility.