SchoolTripTrack is a comprehensive multi-vendor school bus tracker system for managing the daily school bus operation that links the school, the guardians and the buses into one powerful system..
SchoolTripTrack consists of two Flutter apps for guardians and drivers along with an Admin panel with a Laravel API system as a back-end and a Vue.js front-end system as a web interface.
Here we present the Admin web panel sub system
To ensure that the 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
sudo apt update sudo apt install apache2
sudo apt install mysql-server
#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;
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'YOUR PASSWORD HERE';
sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php8.4
sudo apt install php8.4-common php8.4-mysql php8.4-xml php8.4-xmlrpc php8.4-curl php8.4-gd php8.4-imagick php8.4-cli php8.4-dev php8.4-imap php8.4-mbstring php8.4-opcache php8.4-soap php8.4-zip php8.4-intl php8.4-bcmath php8.4-redis -y
php8.4 -m | grep -E '^(pdo_mysql|curl|gd|zip|intl|bcmath|redis|imagick|soap|mbstring|xml)$'
sudo a2enmod rewrite sudo systemctl restart apache2
sudo apt-get install libapache2-mod-php8.4 sudo a2enmod php8.4 sudo systemctl restart apache2
sudo a2dismod php8.1 sudo a2enmod php8.4 sudo systemctl restart apache2 sudo update-alternatives --set php /usr/bin/php8.4
sudo apt-get update
sudo apt-get install curl php8.4-cli php8.4-mbstring git unzip
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer --version
Please record them as we will use them later.
Please record the file name as we will use it later.
Please record email, password, and UID as we will use them later.
Please record them as we will use them later.
Please record them as we will use them later.
Please record them as we will use them later.
Please record them as we will use them later.
Please record them as we will use them later.
Please record them as we will use them later.
As we indicated, the admin panel composed of a Laravel API system as a back-end and a Vue.js front-end system as a web interface. We indicate the installation steps for each of them separately.
I assume that the purchased admin web panel is located in the folder "SchoolTripTrack" at "/home/SchoolTripTrack". You can modify this path if you download the folder in a different path. Please follow the following steps for installation
cd /home/SchoolTripTrack
sudo update-alternatives --config php
composer install
ln -s ../../storage/app/public public/backend/storage
cp .env.example .env
APP_URL = your web site url, for example www.mydomain.com DB_USERNAME = root DB_PASSWORD = password of root user of mysql database FIREBASE_CREDENTIALS=Write the downloaded name in step (C)-5 and pre-append it with ./ (for example, ./SchoolTripTrack-demo-firebase-adminsdk-jm2jc-c057abcdef.json) Note: Use Score based (v3) Recaptcha keys in the following RECAPTCHA_SITE_KEY= your Recaptcha site key RECAPTCHA_SECRET_KEY= your Recaptcha secret key If you want to use Braintree, then set the following BRAINTREE_ENV=sandbox or live BRAINTREE_MERCHANT_ID= your Braintree merchant ID from step (D)-1 BRAINTREE_PUBLIC_KEY= your Braintree public key from step (D)-1 BRAINTREE_PRIVATE_KEY= your Braintree private key from step (D)-1 If you want to use RazorPay, then set the following RAZORPAY_KEY= your RazorPay key id from step (D)-2 RAZORPAY_SECRET= your RazorPay key secret from step (D)-2 If you want to use FlutterWave, then set the following FLW_PUBLIC_KEY= your FlutterWave public key from step (D)-3 FLW_SECRET_KEY= your FlutterWave secret key from step (D)-3 If you want to use PayStack, then set the following PAYSTACK_PUBLIC_KEY= your PayStack public key from step (D)-4 PAYSTACK_SECRET_KEY= your PayStack secret key from step (D)-4 If you want to use Stripe, then set the following STRIPE_KEY= your Stripe publishable key from step (D)-5 STRIPE_SECRET= your Stripe secret key from step (D)-5
If you want to use Google Maps, then set the following GOOGLE_MAPS_SERVER_KEY= Your Google Maps server key (Routes API), restricted to your server IP address If you want to use Mapbox, then set the following MAPBOX_SECRET_TOKEN= Your Mapbox secret token (sk.) from step (B) MAPBOX_USERNAME= Your Mapbox account username Optional Mapbox settings (the defaults are fine for most installations) MAPBOX_TEMP_TOKEN_TTL=15 MAPBOX_TEMP_TOKEN_SCOPES=styles:read,styles:tiles,fonts:read,datasets:read,vision:read
The server uses the Mapbox secret token to calculate routes and to create short-lived Mapbox tokens (15 minutes by default) for the driver and guardian apps. The apps renew these tokens automatically, so there is nothing to configure in the apps for Mapbox. If you change the .env file after running "php artisan config:cache", run "php artisan config:clear" so the new values are used.
MAIL_USERNAME MAIL_PASSWORD MAIL_FROM_ADDRESSPlease note that, if you are using gmail, you need to get the app password from your gmail account. You can get it from the following link https://myaccount.google.com/apppasswords. Do not use your gmail password here. Use the app password instead. You can find more details here.
php artisan key:generate
chmod -R 777 storage bootstrap/cache
sudo chown -R $USER:$USER public sudo chown -R $USER:$USER storage/app/public/avatars/
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/SchoolTripTrack.conf
<VirtualHost *:80>
ServerName SchoolTripTrack
DocumentRoot /home/SchoolTripTrack/public
<Directory /home/SchoolTripTrack/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>
sudo a2dissite 000-default.conf sudo a2ensite SchoolTripTrack.conf sudo systemctl restart apache2
mysql -u root -p #enter the root password when prompted create database SchoolTripTrack_db; #then exit the mysql terminal
Database migration will fail if you did not do this
chmod -R 777 storage bootstrap/cache
Database migration will fail if you did not do this
sudo chown -R $USER:$USER public sudo chown -R $USER:$USER storage/app/public/avatars/
Database migration will fail if you did not do this
$user = User::create([
'name' => 'SuperAdmin',
'email' => 'admin@yourdomain.com',
'password' => Hash::make('admin123456'),
'role' => 0,
'status_id' => 1,
'uid' => "l8nIta8bjOVLifjV0uktyUu5iF53"
]);
php artisan migrate:fresh --seed
sudo apt-get install redis-server sudo systemctl enable redis-server.service sudo apt-get install php-redis
sudo apt-get install nodejs sudo apt-get install npm
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
chmod 777 public/privacy.html chmod 777 public/privacy_local.html chmod 777 public/terms.html chmod 777 public/terms_local.htmlNow, the Laravel API system is ready to be used. You can verify that by opening the url "your domain and append it with /backend (for example www.mydomain.com/backend) in a browser. You should see the following image
In the following, we show how to install the Vue.js front end that will be used as a web interface for the admin panel
cd /home/SchoolTripTrack
cd front-end
cp .env.production.example .env.production
Edit the file ".env.production" and set the following
# API Config VUE_APP_API_URL=your web site url, for example www.mydomain.com and append it with /backend. For example, www.mydomain.com/backend # Firebase Config VUE_APP_API_KEY=AIzaSy..... (from step (C)-4) VUE_APP_AUTH_DOMAIN=SchoolTripTrack.... (from step (C)-4) VUE_APP_PROJECT_ID=SchoolTripTrack.... (from step (C)-4) VUE_APP_STORAGE_BUCKET=SchoolTripTrack.... (from step (C)-4) VUE_APP_MESSAGING_SENDER_ID=544..... (from step (C)-4) VUE_APP_APP_ID=1:544.......:web:01b......... (from step (C)-4) # System Name VUE_APP_SYSTEM_NAME= Your System Name (instead of SchoolTripTrack) # RECAPTCHA Config VUE_APP_RECAPTCHA_SITE_KEY= Your Recaptcha site key
Note that no map key is set in this file. The Google Maps key or the Mapbox public token is entered by the super admin in the admin panel (see step (F)-7), so changing or rotating it does not need a rebuild.
Edit the file "front-end/public/index.html" and set the title to your system name (instead of SchoolTripTrack)
<title>Your System Name</title>
npm install
npm run build
cp -r dist/* ../public/Now, the Vue.js front end is ready to be used. You can verify that by opening the url "your domain (for example www.mydomain.com) in a browser. You should see the login page of the admin panel
Once you installed SchoolTripTrack as indicated above, login with the super admin account credentials to set the different keys used by SchoolTripTrack
Go to this link and enter your purchase key. Please enter your complete website URL, for example https://www.mydomain.com and append it with /backend. For example,https:// www.mydomain.com/backend 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 super admin credentials.
You will see "Activate your account" button. Click on it and you will be redirected to the activation page
Enter your secure key and click "Activate"
crontab -e
* * * * * cd /home/SchoolTripTrack && php artisan schedule:run >> /dev/null 2>&1
Change the timezone in config/app.php. Select one from here
Make sure that you write the crontab command correctly. Please see step (F)-5 above
Note that the apps are working on a copied version from the trips table. This means that any change in the trips table will not be reflected immediately in the apps, but will reflected in future trips.
Configure your firewall and make sure that you allow traffic through the port 6001
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
chmod -R 777 storage bootstrap/cache
The keys in the .env file (GOOGLE_MAPS_SERVER_KEY, MAPBOX_SECRET_TOKEN) are server-side keys. The server uses them to calculate routes, and the Mapbox secret token is also used to create the tokens of the mobile apps. They are never sent to browsers or apps. The key in the admin panel (Settings > Map settings) is the browser key used by the web panel to show maps and search addresses.
Use a different key for each place it is used, and restrict each one:
No. Mapbox cannot restrict a token to a mobile app, so the apps never get a permanent token. After login, the server gives the apps a short-lived Mapbox token (15 minutes by default, set with MAPBOX_TEMP_TOKEN_TTL) and the apps renew it automatically. If an account misuses it, suspend the account; its Mapbox access ends when the current token expires.
The apps fall back to Google Maps when the server cannot give them a Mapbox token. Make sure MAPBOX_SECRET_TOKEN and MAPBOX_USERNAME are set in the .env file, that the secret token has the scopes listed in step (B), and run "php artisan config:clear" if you cached the configuration. The reason is written in storage/logs/laravel.log (search for "Mapbox temporary token").
Once again, thank you so much for using SchoolTripTrack. 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