Whitelisting
The CLHS PRS - Touch 'n Grow provides self-service whitelisting. Follow the steps in this website and download the file here:
Whitelisting: Step-by-Step Guide
WHITELISTING REQUIRES PEOPLE WITH CODING KNOWLEDGE / ARE FAMILIAR WITH CODE
You will need the following sofwares to customize this template.
- Server to host Admin panel (Check Initialization Step)
- Latest Android Studio with Flutter installed
- Firebase Console Account
- Visual Code Studio
Initialization
- Download the Files from the link above.
- Unzip the file using any extractor. The file is divided into 3 parts, web application (website), mobile application (CLHSPRS) and SQL File (clhsprs.sql)
Setup Website
Website/Admin Panel is required to key in PRS & GBK data, and allow GBK & PRS to view appointments.
For a Server to host Admin Panel, a website hosting panel is used. Most schools already has this, as KPM provides School Website Domain for free. However, you can also buy one at the price of RM5, from IONOS. (Check this website)
To use the server, you must login/setup the cPanel / Plesk Panel. If you get your server from IONOS, check this link:
Next, follow the below steps for setup
- FOR MAC OS USERS ONLY : windows user go to Step 3
- Under Folder PHPScript check if .env file is visible ?
- if Not visible than you can make it visible by pressing COMMAND + SHIFT + (.DOT)
- Zip Website Script to upload
- From the files you downloaded, Select “Website”
- Right Click and compress in .ZIP file
- In cPanel / Plesk Panel, click on File Manager. Then, select Upload -> select upload option -> Upload Zip file -> Choose the zipped “Website” File.
- Unzip/Extract the zip file on server
- Setup Database -> Go to MySQL® Databases -> Create New Database. Remember your DB_DATABASE, DB_USERNAME and DB_PASSWORD
- On the same page, you need to Create New Database User
- Add User to Database –> 1. Select your database –> 2. Select Database User –> Add
It will open new page for privileges, here click on ALL PRIVILEGES and submit - Now Open phpmyadmin, then select your database. Then, Upload the SQL File you downloaded (clhsprs.sql) file into the Database.
- Update .env file
- In phpMyAdmin edit file .env right click on file and select Edit
- Change DB_DATABASE Add Database name we created in step 6
- Change DB_USERNAME and DB_PASSWORD username and password we created in step 7
- In PhP My Admin, check the column “Users”. Edit the Admin Password to login.
Configure App
Change Backend/Server Link
To connect android app with your admin panel or backend you need to change url in string.xml file, follow below instructions.
First, open the Mobile Application File (CLHSPRS) you downloaded with Visual Code Studio.
In Visual Code Studio, Locate main.dart under the folder lib > main.dart
In link replace url with your admin panel url.
1
2
|
// CHANGE URL HERE Do not forgot to add /api/ after your admin url const String SERVER_ADDRESS = "website-url"; |
Firebase Setup
Following below step to config firebase chat
- Go to This url : https://firebase.google.com/
- Add new project
- Enter Project Name and Accept Firebase Terms
- Complete Project Create
- Start Create Project
- After Successful Create Project, your need to create web
- Below Project Dashboard you will get firebase config
- Update Firebase Config in File resources/views/front/firebase_config.blade.php
- Update Firebase script version code in your file
- Step for create Cloud fFrestore
- Create Dashboard
- Step 1 Set Firestore Rules Mode
- Step 2 Set Firestore location
- Step for create Realtime Database
- Create Realtime Database Dashboard
- Step 1 Set Realtime Rules Mode
- Step 2 Set Realtime location
- Generate Firebase .json file from your firebase service account
- Upload Firebase Json File on to your script folder and rename json file to firebase_credentials.json file
- Replace json file path and change database url in .env file
- Click on cron tab for adding cron
- then create cron for your script
- After 1 minute, your cron will be ran successfully and you get success mail for server then your cron is setup successfully
Change app icon
1. Paste your icon in asset folder. use icon name as icon.png and pase it in root assest folder.
2. Open android studio’s terminal and paste execute these command there:
flutter pub get
flutter pub run flutter_launcher_icons:main
Change Package / App Name
It is assumed that you have successfully imported the flutter project to your system. Now in order to
change package name of your application open up the android studio terminal and paste this command
flutter pub run change_app_package_name:main com.new.package.name or
flutter pub run change_app_package_name:main com.[your package name here]