“SBurK” Documentation
“Admin Web Panel ”
Table of Contents
- What is SBurK?
- Prerequisites
- Installation
- Configuration
- 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
- Laravel admin web panel
- Android mobile app for parents
- Android mobile app for drivers
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
- Apache web server
sudo apt update
sudo apt install apache2
- Mysql server database engine
sudo apt install mysql-server
- Set the password of the root for the mysql server database engine
#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;
- Php 8.1
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1
- Php 8.1 extensions
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
- Enable mod_rewrite for Apache
sudo a2enmod rewrite
sudo systemctl restart apache2
- Configure apache for php8.1
sudo apt-get install libapache2-mod-php8.1
sudo a2enmod php8.1
sudo systemctl restart apache2
- Composer
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
- 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
- Go inside the folder
cd /path/to/schoolbustrackerbackend
- Ensure that php 8.1 is the current verison of your php by typing the command
sudo update-alternatives --config php
- Install dependencies
composer install
- Make a link to storage folder in the public folder
php artisan storage:link
- Create the .env file from the provided example .env
cp .env.example .env
- Edit the .env file and set the following
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
- Generate a new key
php artisan key:generate
- Give full permission to storage and bootstrap/cache folders
chmod -R 777 storage bootstrap/cache
- 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
- Open mysql terminal and create a database with name "schoolbustracker_db"
sudo mysql -u root -p #enter the root password when prompted
create database schoolbustracker_db; #then exit the mysql terminal
- Make sure that you give full permission to storage and bootstrap/cache folders
sudo chmod -R 777 storage bootstrap/cache
- Migrate the database
php artisan migrate --seed
- Install redis server
sudo apt-get install redis-server
sudo systemctl enable redis-server.service
sudo apt-get install php-redis
- Install npm
sudo apt-get install nodejs
sudo apt-get install npm
- Install Laravel echo server
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
- Update permissions of privacy and terms pages.
chmod 777 public/privacy.html
chmod 777 public/terms.html
- Install Firebase cloud messaging
- Go to your account in https://console.firebase.google.com and create a new project. Name it
"SBurK".
- Continue until project ready
- Create a new web app
- Enter "sburk_web" for the new web app nickname, then click "Register 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"
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
-
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.
-
Open your web site and login with the superadmin account.
User: superadmin@SBurK.com
Password : admin
- Navigate to "Activation" menu from the sidebar
-
Enter your secure key and click "Activate"
-
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
-
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=
- Change your email and password
- 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
- In Currency and billing cycle, select the following
- In SMS, select your SMS gateway (optional)
- 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
- RazorPay
- RazorPay Key Id
- RazorPay Key Secret
- Flutterwave
- Flutterwave Public Key
- Flutterwave Secret Key
- Flutterwave Environment (Test or Production)
- (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
- Configure Stripe payment gateway
- If you enable Stripe, get the "API keys" from your Stripe
account
- Edit the payment plans
- Configure RazorPay payment gateway
- 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"
- Get both "Key Id" and "Key Secret" and enter them in SBurK settings page
- Edit the payment plans
- Configure Flutterwave payment gateway
- 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"
- Get both "Public Key" and "Secret Key" and enter them in SBurK settings page
- Edit the payment plans
- Configure Paytabs payment gateway
- 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)
- Choose one of the following regions: 'ARE','EGY','SAU','OMN','JOR','GLOBAL'
- 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
- Configure Ads
- Enable or disable ads on both apps
- 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
Windows Steps:
- 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.
- Install Bitnami
- Download and install composer from here https://getcomposer.org/Composer-Setup.exe
- Open WAMP Bitnami application from start menu
- 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
- Open CMD
- Run: cd C:\Bitnami\wampstack-7.4.30-0\apache2\sburkbackend
- Run: composer install (if it fails run: composer self-update 1.10.1 and retry)
- Run: php artisan storage:link
- Rename .env.example to .env
- Replace YOUR_PASSWORD_HERE with your MySQL password
- Run: php artisan key:generate
- From WAMP Bitnami application, open phpMyAdmin, enter user and password (root user credentials)
- Open phpMyAdmin console from the lower part. Write create database schoolbustracker_db;
- Return to your CMD, then run: php artisan migrate --seed
- Copy the content of the public folder inside C:\Bitnami\wampstack-7.4.30-0\apache2\htdocs
- Edit the index.php file in htdocs folder by changing the lines:
- require __DIR__.'/../vendor/autoload.php'; to require __DIR__.'/../sburkbackend/vendor/autoload.php';
- $app = require_once __DIR__.'/../bootstrap/app.php'; to $app = require_once __DIR__.'/../sburkbackend/bootstrap/app.php';
18. Open localhost then you will be able to see SBurK running
For installation video click here
E) FAQ - top
- How many payment plans can be added to SBurK?
There is no limit on the number of plans.
- Are all plans in SBurK are paid plans?
No. There is always one "free" plan that can not be removed.
The super admin can add any number of paid plans after that.
- Are all plans in SBurK must be paid by schools?
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).
- What happened when a school admin unsubscribes from a plan?
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.
- What happened when a school admin deletes a driver?
The parents assigned to this driver will be displayed in red until school admin re-assign them to another
driver.
- Laravel-echo-server not working
Configure your firewall and make sure that you allow traffic through the port 6001
- How do I know that the laravel-echo-server is working correctly?
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
- 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
- After registration of a new school account, the system displays error that it can not create avatar for
the new school
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