Shortzz

LiveStream + Realtime chats

Introduction

Here is the quick documentation to setup the web part of the Shortzz application created in PHP Laravel. Please follow all the steps correctly and carefully setup the project.

Prerequisites

    • PHP 8.0 and above and it will work on any kind of hosting

    • Hosting with cPanel (Strictly Recommended)

    • memory_limit should be 120M

    • AWS S3 bucket and it’s credentials to store files: Please Click Here to know the steps to create S3 bucket on AWS and get the credentials.

    • sightengine Account credential for Content Moderation : https://sightengine.com/

    • If you face any issue in video upload or it takes time in uploading video to the server that might be because of your server. Sometimes server gives this error if you check your error log file

    • The Allowed memory size of 33554432 bytes exhausted (tried to allocate 15756752 bytes)

    • If you see this error then you would need to upgrade your server or increase PHP memory limit by going into php.ini file. you need to google about where this file is. This file resides in different locations in different servers

Extracting the project and settings up database

    • Extract the folder you have downloaded from codecanyon and open the folder

    • Open it and find the database.sql file

    • Then open your cPanel provided by your web hosting provider.

    • Click the MySQLDatabase option under DATABASES section and create database for your app as shown in the images below.

    db_1
    • Add database name and click on create database.

    db_1
    • Now we will create a user to access the database

    • Like as shown in the image, enter username and password (save it to use later)

    • Click on create user and user will be created

    db_1
    • Now we have to add that created user to database. so scroll down and you can see like image below

    • Select the user from the list and select the database, and click on add button below

    db_1
    • After clicking on add button you will see like below.

    • There you can see ALL PRIVILEGES option, check the box before that

    • This will tick all the boxes shown below (Check the image below). Click on make changes and you are done.

    db_1
    • Now we have to import the database file. Search for phpMyAdmin and click on it.

    db_1
    • Then system will redirect you to the phpMyAdmin where you will be able to find the database we just created

    • Click on that database

    • Then find the import button on the Top bar and click on it

    db_1
    • It will open the page like below

    • Click on Choose File button and load the database.sql file which will be there in the folder you have extracted.

    db_1
    • Click on go button at the bottom of the page.

    • Now database is ready to use.

Setting Up Database credentials to the project

    • Now come back to the project folder and then extract shortzz_backend.zip file

    • In that folder, find the .env file, open it with any text editor and make the changes as below

    • There in the APP_URL Replace the https://yourdomain.com/ to Your Domain

    • At the image Replace the https://yourdomain.com/public/storage/ to Your Domain

    • Change Database Configuration, as shown in the example below

    db_1

    DB_DATABASE = database_name

    DB_USERNAME = database_username

    DB_PASSWORD = ”database_password”

    • And save the file by pressing Ctrl + s

  • Change AWS S3 configuration: (Line: 44 to 48)

AWS_ACCESS_KEY_ID = AWS_ACCESS_KEY

AWS_SECRET_ACCESS_KEY = AWS_SECRET_ACCESS_KEY

AWS_BUCKET = BUCKET_NAME

AWS_DEFAULT_REGION = AWS_REGION

DEFAULT_IMAGE_URL = URL_TO_YOUR_BUCKET

Setup Notification (FCM)

    • Follow This guide and setup project at firebase and collect private key .json

    • Open private key .json file in your text editor.

    • Copy content of private key .json file from your text editor.

    • Find the googleCredentials.json file in your backend folder and paste the content in that file.

    • Once this gets completed, Please subscribe to the Pay as you go Plan of Firebase, it is required for Chat to use a real-time database for more than 100 users. If you don't do that, app will stop working for chats and some other features once it reaches more than 100 users.

  • Run below command if you are getting permission issues while opening the admin panel


chmod 777 storage/logs/laravel.log

chmod 777 storage/framework/sessions/

chmod 777 storage/framework/views/

chmod 777 storage/framework/cache/data/

chmod 777 public/uploads/

Making the project live

    • Make the zip of backend folder

    • Upload that folder to your domain targeted directory and extract it there

    • Make sure that your targeted directory has the project files directly, and not wrapped in a folder

  • Linking the storage to access the files in the app

    • Now we need to link the storage to access the images in the app. This step is a step provided by Laravel

      • Go this location : public/ and check if there is storage folder there

      • If it is, then delete it

      • Now Go to the terminal by searching terminal on your cPanel

      • Go to the backend project location using cd command like below

      cd public_html/backend_folder
      • And then run below command at that location on terminal

      php artisan storage:link
    • Now web setup is completed and let's collect some credentials for the app setup

host your backend

    • Create a zip of the shortzz_backend folder

    • Upload that folder to your domain-targeted directory on your cPanel provided by your hosting provider. and extract the zip file.

    • Make sure that your targeted directory has the project files directly, and not wrapped in a folder

    • Cheers! Now try accessing your domain, the admin panel should be live there on your domain

sightengine (Optional)

Getting the credential

Now web setup is completed and let's collect some credentials for the app setup

    • Admin Panel URL : http://yourdomain.com/

    • Admin Panel User Name : admin

    • Admin Panel Password : admin123

    • Baseurl : http://yourdomain.com/api/

    • apiKey : dev123

Now save these credentials somewhere and start following the documentation to setup application.

Update info

    • To upgrade your project, you have to Add/Update/Remove files and fields in database . Please check below file for the information.

    • File name : README.md

    • Please be careful while making an updates this way, It might result in errors sometimes.

    • If it comes any issues while making an update, you are absolutely responsible for that since updating existing project is not included in the support.

Want to talk with us?