“SBurK” Documentation


“Admin Web Panel ”


Table of Contents

  1. What is SBurK?
  2. Prerequisites
  3. Installation
  4. Configuration
  5. FAQ

A) What is SBurK? - top

SBurK is a comprehensive system for school bus tracking that manages the daily school bus operation. SBurK consists of three sub systems, which are

Here we present the Laravel admin web panel sub system


B) Prerequisites - top

To ensure that the Laravel admin panel fully operational, some prerequisites need to be installed. In the following, I will list the required prerequisites and show how you can install them on a Ubuntu machine

  1. Apache web server
  2. 	sudo apt update	
    	sudo apt install apache2
    
  3. Mysql server database engine
  4. 	sudo apt install mysql-server
    
  5. Set the password of the root for the mysql server database engine
  6. 		#open a mysql terminal
    		sudo mysql -u root #press enter when prompted for a password
    		#write the following in mysql terminal
    		ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR PASSWORD HERE';
    		#exit the mysql terminal
    		exit;
    
  7. Php 8.1
  8. 	sudo apt install software-properties-common
    	sudo add-apt-repository ppa:ondrej/php
    	sudo apt update
    	sudo apt install php8.1
    
  9. Php 8.1 extensions
  10. sudo apt install php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-dev php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-intl -y
    
    sudo apt-get install php-curl php-xml php-mbstring -y
    
  11. Enable mod_rewrite for Apache
  12. 	sudo a2enmod rewrite
    	sudo systemctl restart apache2
    
  13. Configure apache for php8.1
  14. 	sudo apt-get install libapache2-mod-php8.1
    	sudo a2enmod php8.1
    	sudo systemctl restart apache2
    
  15. Composer
  16. 	sudo apt-get update
    	php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    	sudo apt-get install curl php-cli php-mbstring git unzip
    	sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
    
  17. Please make sure that you have accounts for

C) Installation - top

I assume that the purchased Laravel admin web panel is located in the folder "schoolbustrackerbackend" at "/path/to/schoolbustrackerbackend". Please follow the following steps

  1. Go inside the folder
  2. 	cd /path/to/schoolbustrackerbackend
    
  3. Ensure that php 8.1 is the current verison of your php by typing the command
  4. 	sudo update-alternatives --config php
    
  5. Install dependencies
  6. 	composer install
    
  7. Make a link to storage folder in the public folder
  8. 	php artisan storage:link
    
  9. Create the .env file from the provided example .env
  10. 	cp .env.example .env
    
  11. Edit the .env file and set the following
  12. 	APP_URL = your web site url, for example www.mydomain.com
    	DB_USERNAME = root
    	DB_PASSWORD = password of root user of mysql database 
    
    	Note: Use V2 Checkbox when you register your backend site in Google Recaptcha as shown in the image below
    
    	RECAPTCHA_SITE_KEY= your Recaptcha site key
    	RECAPTCHA_SECRET_KEY= your Recaptcha secret key
    
    
    Recaptcha
  13. Generate a new key
  14. 	php artisan key:generate
    
  15. Give full permission to storage and bootstrap/cache folders
  16. 	chmod -R 777 storage bootstrap/cache
    
  17. Configure an Apache virtual host for SBurK
    • Change owner of the public folder
    • 	sudo chown -R $USER:$USER public
      	sudo chown -R $USER:$USER storage/app/public/avatars/
      
    • Create a configuration file for the virtual host for SBurK
    • 	sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/SBurK.conf
      
    • Edit the configuration file "/etc/apache2/sites-available/SBurK.conf" and replace its contents with the following
    • 	<VirtualHost *:80>
      		ServerName SBurK
      		DocumentRoot /path/to/schoolbustrackerbackend/public
      		<Directory /path/to/schoolbustrackerbackend/public>
      			Options Indexes FollowSymLinks MultiViews
      			AllowOverride All
      			Require all granted
      		</Directory>
      		ErrorLog ${APACHE_LOG_DIR}/error.log
      		CustomLog ${APACHE_LOG_DIR}/access.log combined
      	</VirtualHost>
      
    • Enable the configuration file "SBurK.conf"
    • 	sudo a2dissite 000-default.conf
      	sudo a2ensite SBurK.conf
      	sudo systemctl restart apache2
      
  18. Open mysql terminal and create a database with name "schoolbustracker_db"
  19. 	sudo mysql -u root -p #enter the root password when prompted
    	create database schoolbustracker_db; #then exit the mysql terminal
    
  20. Make sure that you give full permission to storage and bootstrap/cache folders
  21. 	sudo chmod -R 777 storage bootstrap/cache
    
  22. Migrate the database
  23. 	php artisan migrate --seed
    
  24. Install redis server
  25. 	sudo apt-get install redis-server
    	sudo systemctl enable redis-server.service
    	sudo apt-get install php-redis
    
  26. Install npm
  27. 	sudo apt-get install nodejs
    	sudo apt-get install npm
    
  28. Install Laravel echo server
  29. 	sudo npm install -g laravel-echo-server
    	sudo laravel-echo-server init #I recommend to press enter to choose the default answer for every question (except if you have https instead of http)
    	sudo nohup laravel-echo-server start & #start the laravel-echo-server in background and make it permanently alive
    
  30. Update permissions of privacy and terms pages.
  31. chmod 777 public/privacy.html 
    chmod 777 public/terms.html 
    
  32. Install Firebase cloud messaging
    • Go to your account in https://console.firebase.google.com and create a new project. Name it "SBurK".
    • Firebase create project
    • Continue until project ready
    • Firebase project ready
    • Create a new web app
    • Firebase add web app
    • Enter "sburk_web" for the new web app nickname, then click "Register app"
    • Firebase add web app
    • Go to settings of the web app, then open "Service accounts" tab. Click on "Generate new private key". Name the downloaded file "fcm.json" and add it to the public folder at "/path/to/schoolbustrackerbackend/public"
    • Firebase cloud messaging

D) Activation & Configuration - top

Once you installed SBurK as indicated above, login with the super admin account credentials to set the different keys used by SBurK

  1. Go to this link and enter your purchase key. You can get the purchase key from your CodeCanyon download section. More information is here. domain (or localhost). You will get two secure keys. One for your web site url and the other for localhost. Copy your secure keys and keep it in a safe place as you will not be able to generate them again.

  2. Open your web site and login with the superadmin account.

    	User: superadmin@SBurK.com
    	Password : admin
    

  3. Navigate to "Activation" menu from the sidebar
  4. Enter your secure key and click "Activate"

  5. Email settings:
    • Setting the email is very important for sending the reset password links and for sending payment remainders.
    • Edit the .env file by changing the following lines
    • Note that, if you use gmail, then the app password is not as the same of your gmail account password. You can check here to learn how to generate the password.
    	MAIL_USERNAME=YOUR GMAIL EMAIL
    	MAIL_PASSWORD=YOUR APP PASSWORD
    	MAIL_FROM_NAME=SBurK
    
  6. reCAPTCHA settings:
    • Get your reCAPTCHA keys and make sure that you have selected v2 Checkbox when you register your backend site.
    • Edit the .env file by changing the following lines to the add the keys
    	RECAPTCHA_SITE_KEY=
    	RECAPTCHA_SECRET_KEY=
    
  7. Change your email and password
  8. Super admin profile
  9. Go to "settings" from the left pane and set
    • Google maps API key
    • In Personalize your system, set the following
      • System name
      • Company title
      • Company website
      • Company email
      • Company telephone
      • Facebook link
      • Twitter link
      • Instagram link
      • Linkedin link
      • Ad settings
      Super admin profile
    • In Currency and billing cycle, select the following
      • Currency
      • Billing cycle
    • In SMS, select your SMS gateway (optional)
    • Super admin profile
    • Stripe or RazorPay or Flutterwave enable (optional but 'Pay As You Go plan' will not work if you did not setup the payment gateway)
      • Stripe
        • Stripe Publishable key
        • Stripe Secret key
        Super admin profile
      • RazorPay
        • RazorPay Key Id
        • RazorPay Key Secret
        Super admin profile
      • Flutterwave
        • Flutterwave Public Key
        • Flutterwave Secret Key
        • Flutterwave Environment (Test or Production)
        Super admin profile
    • (optional) Choose your SMS gateway and enter the configuration of the selected gateway. For example, if you select Twilio, then you will need to get the following configuration from Twilio dashboard
      • Twilio account SID
      • Twilio auth token
      • Twilio phone number
      Super admin profile
  10. Configure Stripe payment gateway
    1. If you enable Stripe, get the "API keys" from your Stripe account stripe_api_keys
    2. Edit the payment plans
    3. Plans
  11. Configure RazorPay payment gateway
    1. If you enable RazorPay, you need to get both "Key Id" and "Key Secret" from RazorPay dashboard
      • Open your "RazorPay" account dashboard
      • Choose "Settings" section in the left pane, then click on "API Keys"
      • RazorPay Get Keys
      • Get both "Key Id" and "Key Secret" and enter them in SBurK settings page
    2. Edit the payment plans
    3. Plans
  12. Configure Flutterwave payment gateway
    1. If you enable Flutterwave, you need to get both "Public Key" and "Secret Key" from Flutterwave dashboard
      • Open your "Flutterwave" account dashboard
      • Choose "Settings" section in the left pane, then click on "API"
      • Flutterwave Get Keys
      • Get both "Public Key" and "Secret Key" and enter them in SBurK settings page
    2. Edit the payment plans
    3. Plans
  13. Configure Paytabs payment gateway
    1. If you enable Paytabs, you need to get the "API Key" from Paytabs dashboard
      • Open your "Paytabs" account dashboard
      • Choose "Developers" section in the left pane, then click on "API"
      • Get the "API Key" and enter them in SBurK settings page
      • Obtain your Profile Id and enter it in the SBurK settings page (the number before your name)
      • Flutterwave Get Keys
      • Choose one of the following regions: 'ARE','EGY','SAU','OMN','JOR','GLOBAL'
  14. Add scheduling entry for cron. This step is very important to handle plan expiration for both schools and parents
    • First open your terminal and run
    • 	crontab -e
      
    • Then add the following line
    • 	* * * * * cd /path-to-your-sburkbackend-folder && php artisan schedule:run >> /dev/null 2>&1
      
  15. Configure Ads
    • Enable or disable ads on both apps
    • Ads
  16. You can choose which maps will be used in the apps. To choose Map Type
    • Enable or disable the usage of MapBox instead of Google Maps in the apps
    • MapBox

Windows Steps:

  1. Download Bitnami Wamp from https://downloads.bitnami.com/files/stacks/wampstack/7.4.30-0/bitnami-wampstack-7.4.30-0-windows-x64-installer.exe. Make sure that the version is 7.4.
  2. Install Bitnami
  3. Download and install composer from here https://getcomposer.org/Composer-Setup.exe
  4. Open WAMP Bitnami application from start menu
  5. Click on "Goto Application Folder". It will open the folder "C:\Bitnami\wampstack-7.4.30-0". Navigate to "apache2" folder and copy the sburkbackend into this folder
  6. Open CMD
  7. Run: cd C:\Bitnami\wampstack-7.4.30-0\apache2\sburkbackend 
  8. Run: composer install (if it fails run: composer self-update 1.10.1 and retry)
  9. Run: php artisan storage:link
  10. Rename .env.example to .env
  11. Replace YOUR_PASSWORD_HERE with your MySQL password
  12. Run: php artisan key:generate
  13. From  WAMP Bitnami application, open phpMyAdmin, enter user and password (root user credentials)
  14. Open phpMyAdmin console from the lower part. Write create database schoolbustracker_db;
  15. Return to your CMD, then run: php artisan migrate --seed
  16. Copy the content of the public folder inside C:\Bitnami\wampstack-7.4.30-0\apache2\htdocs
  17. Edit the index.php file in htdocs folder by changing the lines:

      18. Open localhost then you will be able to see SBurK running

For installation video click here

E) FAQ - top

  1. How many payment plans can be added to SBurK?
  2. There is no limit on the number of plans.

  3. Are all plans in SBurK are paid plans?
  4. No. There is always one "free" plan that can not be removed. The super admin can add any number of paid plans after that.

  5. Are all plans in SBurK must be paid by schools?
  6. No. There is always one "Pay As You Go" plan that can not be removed. This plan allows parent to recharge their wallets and pay for using the tracking apps (not the schools).

  7. What happened when a school admin unsubscribes from a plan?
  8. The new plan will take effect immediately and the school account will not be able to continue its current subscription. If the new plan is a downgrade compared with the existing plan, some drivers are removed to meet the new plan limit. The parents assigned to deleted drivers will be displayed in red until school admin re-assign them to another set of drivers. Note that, the deleted drivers may be recovered if the school admin subscribes to a higher plan with a larger number of drivers such that the deleted number of drivers are within the plan limit if they are restored.

  9. What happened when a school admin deletes a driver?
  10. The parents assigned to this driver will be displayed in red until school admin re-assign them to another driver.

  11. Laravel-echo-server not working
  12. Configure your firewall and make sure that you allow traffic through the port 6001

  13. How do I know that the laravel-echo-server is working correctly?
  14. Go to the url of the admin panel and append it with 6001, i.e., open http://YOUR_WEBSERVER_URL:6001 and check if it gives OK

  15. The home page of the admin panel gives a blank white page
    • Make sure that you give full permission to storage and bootstrap/cache folders by
    • 	chmod -R 777 storage bootstrap/cache
      
    • Make sure that you edit the .env file correctly
  16. After registration of a new school account, the system displays error that it can not create avatar for the new school
  17. Make sure that you give full permission to storage folder


Once again, thank you so much for using SBurK. As I said at the beginning, I'd be glad to help you if you have any questions. I'll do my best to assist. If you have a more general question relating to the items on CodeCanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.

CreativeAppsDev Team

Go To Table of Contents