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.1is required for optimal performance. - Database Server: MySQL is the supported database management system.
- Web Server: The platform is compatible with both
Apacheandnginxservers.
Setup Instructions
Follow these steps to install and configure Alg2mer Shop:
- Database Preparation: Create a new database on your server.
- SQL Import: Import the SQL file located at
.sql/shop.sqlinto your newly created database. - Project Files: Transfer the project files into your server's public directory.
- Configuration File: Duplicate the example configuration file using
cp config.example.json config.json. - Configure Settings: Edit
config.jsonto match your server and database settings. - Dependencies: Execute
composer installto install PHP dependencies. - Database Seeder: Navigate to
https://your-domain.com/seeder.phpto populate the database with initial data. - Admin Access: Log in with the default admin credentials (phone:
123456789, password:123456) to start using the system. - Security Measures: Create a new admin user and disable the default account for enhanced security.
- 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.pngwith your primary color logo. - Favicon: Update
/assets/img/brand/favicon.pngwith your favicon. - White Logo: Change
/assets/img/brand/white.pngto 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) andmysqlifor database interaction. - database_config: Specify your database settings here.
- sms_driver: Select an SMS gateway. Options include local gateways like
brqsmsandniloge, as well as international options liketwilio,vonage, andplivo. - 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
productionfor full functionality ordevelopmentfor 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
Access Firebase Console
- Go to Firebase Console.
- Select your project.
Open Project Settings
- Click the ⚙️ gear icon and choose Project settings.
Generate a Service Account Key
- Navigate to the Service accounts tab.
- Click "Generate new private key".
- A
.jsonfile will be downloaded—this is yourfirebase_credentials.json.
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.
Enabling Deep Links
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:
- Navigate to the
.well-known/apple-app-site-associationfile and open it. - Locate the placeholder
YOUR_TEAM_ID.com.example.app. - Replace
YOUR_TEAM_IDwith your actual Apple Developer Team ID. - Substitute
com.example.appwith your app's bundle ID. - Save your changes and close the file.
- 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:
- Open the
.well-known/assetlinks.jsonfile. - Enter your app's package name in the
package_namefield. - Insert your SHA-256 certificate fingerprints in the
sha256_cert_fingerprintsarray. You can obtain this from the Google Play Console under theApp Signingsection. - Save your changes and close the file.
- 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:
* * * * * curl https://your-domain.com/api/v1/cron/process_sms.php