Whitelisting

The CLHS PRS - Touch 'n Grow provides self-service whitelisting. Follow the steps in this website and download the file here:

Download App Code Free of Charge* T&C apply

    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.

    1. Server to host Admin panel (Check Initialization Step)
    2. Latest Android Studio with Flutter installed
    3. Firebase Console Account
    4. Visual Code Studio

    Initialization

    1. Download the Files from the link above.
    2. 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:

    https://www.ionos.com/help/server-cloud-infrastructure/accordions-to-plesk-panel/first-steps/log-in-to-the-plesk-panel/

    Next, follow the below steps for setup

    1. 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)
    2. Zip Website Script to upload
      • From the files you downloaded, Select “Website”
      • Right Click and compress in .ZIP file
    3. In cPanel / Plesk Panel, click on File Manager. Then, select Upload -> select upload option -> Upload Zip file -> Choose the zipped “Website” File.
    4. Unzip/Extract the zip file on server
    5. Setup Database -> Go to MySQL® Databases -> Create New Database. Remember your DB_DATABASE, DB_USERNAME and DB_PASSWORD
    6. On the same page, you need to Create New Database User
    7. 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
    8. Now Open phpmyadmin, then select your database. Then, Upload the SQL File you downloaded (clhsprs.sql) file into the Database.
    9. 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
    10. 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

    1. Go to This url : https://firebase.google.com/
    2. Add new project
    3. Enter Project Name and Accept Firebase Terms
    4. Complete Project Create
    5. Start Create Project
    6. After Successful Create Project, your need to create web
    7. Below Project Dashboard you will get firebase config
    8. Update Firebase Config in File resources/views/front/firebase_config.blade.php
    9. Update Firebase script version code in your file
    10. Step for create Cloud fFrestore
      • Create Dashboard
      • Step 1 Set Firestore Rules Mode
      • Step 2 Set Firestore location
    11. Step for create Realtime Database
      • Create Realtime Database Dashboard
      • Step 1 Set Realtime Rules Mode
      • Step 2 Set Realtime location
    12. Generate Firebase .json file from your firebase service account
    13. Upload Firebase Json File on to your script folder and rename json file to firebase_credentials.json file
    14. Replace json file path and change database url in .env file
    15. Click on cron tab for adding cron
    16. then create cron for your script
    17. 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]

    HOW TO GENERATE APK FOR ANDROID DOWNLOAD??

    OPEN MOBILE APPLICATION FILE WITH VISUAL CODE STUDIO, GO TO CONSOLE/TERMINAL, TYPE “flutter build apk” Wait for the APK file to be generated.