Skip to content

Alg2mer Shop Overview

Alg2mer Shop, built on PHP, is a comprehensive e-commerce platform that encompasses a mobile application, designed to streamline the management of business operations and customer interactions seamlessly.

Environment Requirements

Ensure your hosting environment meets the following requirements:

  • PHP Version: php8.1 is required for optimal performance.
  • Database Server: MySQL is the supported database management system.
  • Web Server: The platform is compatible with both Apache and nginx servers.

Setup Instructions

Follow these steps to install and configure Alg2mer Shop:

  1. Database Preparation: Create a new database on your server.
  2. SQL Import: Import the SQL file located at .sql/shop.sql into your newly created database.
  3. Project Files: Transfer the project files into your server's public directory.
  4. Configuration File: Duplicate the example configuration file using cp config.example.json config.json.
  5. Configure Settings: Edit config.json to match your server and database settings.
  6. Dependencies: Execute composer install to install PHP dependencies.
  7. Database Seeder: Navigate to https://your-domain.com/seeder.php to populate the database with initial data.
  8. Admin Access: Log in with the default admin credentials (phone: 123456789, password: 123456) to start using the system.
  9. Security Measures: Create a new admin user and disable the default account for enhanced security.
  10. Launch: Explore and enjoy Alg2mer Shop's features.

Customizing Logos

Customize the platform's appearance by updating the logos:

  • Primary Logo: Replace /assets/img/brand/blue.png with your primary color logo.
  • Favicon: Update /assets/img/brand/favicon.png with your favicon.
  • White Logo: Change /assets/img/brand/white.png to your white and transparent background logo.

Configuration Details

Configure your system with specific parameters to ensure its smooth operation:

  • server_url: Define the server's root path.
  • db_mode: Choose between pdo (default) and mysqli for database interaction.
  • database_config: Specify your database settings here.
  • sms_driver: Select an SMS gateway. Options include local gateways like brqsms and niloge, as well as international options like twilio, vonage, and plivo.
  • jwt_secure: Use a unique UUID for generating JWT tokens for security.
  • ttl: Set the duration for token validity.
  • company_name: Specify your company's name in Arabic for system presentation.
  • company_name_en: Your company's name in English.
  • company_url: The URL to your company's website.
  • IMAGE_MAX_SIZE and VIDEO_MAX_SIZE: Define maximum file sizes for image and video uploads.
  • ses_name: Customize session parameter names for added security.
  • enable_ssl: Enable (1) or disable (0) SSL.
  • bulk_limit: Set the maximum number of SMS messages sent in one batch.
  • env: Choose production for full functionality or development for testing with a default SMS code.

Enabling Firebase Notifications

To enable notifications in the mobile application, you need to generate a firebase_credentials.json file and replace the placeholder file in the project's root directory.

Generating firebase_credentials.json

  1. Access Firebase Console

  2. Open Project Settings

    • Click the ⚙️ gear icon and choose Project settings.
  3. Generate a Service Account Key

    • Navigate to the Service accounts tab.
    • Click "Generate new private key".
    • A .json file will be downloaded—this is your firebase_credentials.json.
  4. Store the JSON File Securely

    • Move the downloaded file to your project's root directory.
    • Ensure it is not exposed in version control (e.g., by adding it to .gitignore).

Creating a Firebase Project

If you don't have a Firebase project yet, you can follow the steps outlined in the Google Services Setup Guide to create and configure your project properly.

To integrate deep linking into your application, adjustments are required on the backend for both iOS and Android platforms. These modifications involve specific files dedicated to each operating system. Follow the below instructions to enable deep links for your app:

For iOS:

To set up deep links for an iOS application, you need to modify the .well-known/apple-app-site-association file. Here are the steps:

  1. Navigate to the .well-known/apple-app-site-association file and open it.
  2. Locate the placeholder YOUR_TEAM_ID.com.example.app.
  3. Replace YOUR_TEAM_ID with your actual Apple Developer Team ID.
  4. Substitute com.example.app with your app's bundle ID.
  5. Save your changes and close the file.
  6. To ensure everything is configured correctly, use the AASA (Apple App Site Association) validator at this link.

For Android:

Setting up deep links for an Android application involves the .well-known/assetlinks.json file. Follow these steps:

  1. Open the .well-known/assetlinks.json file.
  2. Enter your app's package name in the package_name field.
  3. Insert your SHA-256 certificate fingerprints in the sha256_cert_fingerprints array. You can obtain this from the Google Play Console under the App Signing section.
  4. Save your changes and close the file.
  5. To verify the setup, use the Digital Asset Links tool at this link.

Cron Jobs

To automate message sending, add this cron job to your server:

cmd
* * * * * curl https://your-domain.com/api/v1/cron/process_sms.php