WhatsClone With Socket

WhatsClone Documentation


Thank you for purchasing

Thank you for purchasing my item. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

Whatsclone will Not work on any Shared Hosting , So lets start by setting up your VPS ...

S1 - Buy a VPS must have at least 2 GB ram 50GB Space Also 2 cores for CPU ( get cheap VPS) 

Install UBUNTU 16.x after 

Login to VPS with any SSH client (PUTTY for Windows)

-----------------------------------------------------------------------------------------------------

Update Your VPS and Install Some needy tools 

apt-get update -y

 

apt-get upgrade -y
 
apt-get install wget vsftp vim curl -y
 
you install above modules seperately 
 
apt-get install wget -y
 
apt-get install vim -y 
apt-get install nano
_____________________________________________________________

INSTALL APACHE

apt-get install apache2
 
systemctl enable apache2 or systemctl enable apache  // To auto start apache after boot //  
 
Now type you IP in browser if you see a apache welcome page means apache2 is installed
 
 
_____________________________________________________________

INSTALL SQL

apt-get install mysql-server
 
mysql_secure_installation
 
Set a root password when asked and note that .
Folow on screen instructions to complete SQL installation
 
_____________________________________________________________

INSTALL PHP7

apt-get install php libapache2-mod-php php-mcrypt php-mysql
 
Now Edit dir.config and move index.php to first place as shown below 
 
vim /etc/apache2/mods-enabled/dir.conf
open and match with below
 
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
 
install some other PHP modules
 
apt-get install php-cli
 
apt-get install php7.0-curl
 
apt-get install php-curl
 
After installing restart apache
systemctl restart apache2
 
for more info visit : https://goo.gl/agVbXm
_____________________________________________________________

INSTALL PHPMyADMIN

apt-get install phpmyadmin apache2-utils
 
mysql_secure_installation
 
It will ask you for some thing folow on screen installation to complete installation
Note: Allow remote login to phpMyAdmin So you can access phpMyAdmin from your PC
Create a password so you can login with USER : root and the password you setup during phpMyAdmin installation
install some other modules
 
apache2ctl configtest
 
apt-get install php-mbstring
 
If you have not enabled root user for PHPMYADMIN create a new user
 enable phpMyAdmin to access from your ip Create a MYSQL USE
 
Note : replace USERNAME & PASSWORD with your desired , that will be used to login to phpmyadmin
 
msql -u root
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';
FLUSH PRIVILEGES;
 
 
after installing PHPmyAdmin Restart 
 
service mysql restart
 
systemctl restart apache2
 
no goto http://your-ip-address/phpmyadmin
 
for more info visit : https://goo.gl/cCWnfy
 
_____________________________________________________________

 htaccses active  (Enable rewrite mode)

    This is Optional But you should do this , it may show your error on app ( NOT FOUND ) or on some vps it may cause issue to your backed installation.search google for complete guide

Step 1— Enabling mod_rewrite

First, we need to activate mod_rewrite. It's available but not enabled with a clean Apache 2 installation.

sudo a2enmod rewrite

This will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.

sudo systemctl restart apache2

mod_rewrite is now fully enabled. In the next step we will set up an .htaccess file that we'll use to define rewrite rules for redirects.

Step 2 — Setting Up .htaccess

 .htaccess file allows us to modify our rewrite rules without accessing server configuration files. For this reason, .htaccess is critical to your web application's security. The period that precedes the filename ensures that the file is hidden.

We will need to set up and secure a few more settings before we can begin.

By default, Apache prohibits using an .htaccess file to apply rewrite rules, so first you need to allow changes to the file. Open the default Apache configuration file using nano or your favorite text editor.

sudo nano /etc/apache2/sites-available/000-default.conf

Inside that file, you will find a <VirtualHost *:80> block starting on the first line. Inside of that block, add the following new block so your configuration file looks like the following. Make sure that all blocks are properly indented.

                                                                    /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
  <Directory /var/www/html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
  </Directory>
. . .
</VirtualHost>

Save and close the file. To put these changes into effect, restart Apache.

​sudo systemctl restart apache2
 
 
_____________________________________________________________
 
Its also optional to edit php.ini file , it is to increase upload file size limit form 2mb and server execution time .
search google and make the following changes ( its an example you should set it for your requirment)
 
// php.ini //
 
max_execution_time = 300
max_input_time = 600
post_max_size = 128M
upload_max_filesize = 200M
max_file_uploads = 200
default_socket_timeout = 120
extension=php_curl.dll
 
after making changes restart apache:
 
sudo systemctl restart apache2
 
 

 

for this error "Doctrine Querybuilder ORDER BY clause is not in SELECT list" appear on dashboard .if you face this problem you will not be able to save messages and updates on database so :

You have to edit the /etc/mysql/mysql.cnf by adding these lines:
 
[mysqld]
sql-mode=""
 
after making changes restart mysql:
 
sudo service mysql restart
Your VPS is Ready to HOST WhatsClone
if you have any error or issue comment on codecanyon we will help you in installation

So  You have installed LAMP on  UBUNTU for whatsclone Great ...

UPDATE GUIDE

If you have installed old version of whatsClone be upgrade Step by Step i.3 from v1 to v2 to v3 then v4 .

Dont Upgrade from v1 to v4 directly , it applies on most of apps and codes 

--------------------------------------------------------------------------------------

NOTICE : Be CAREFUL DON’T replace “Uploads” & “Config” folders because you will lose images and videos and audio of users. Upload New Backend to your VPS follow instructions below ..

after uploading to correct loction ( from SSH stop server.js ) 

To stop type : pm2 delete appname

if it doesnot work deleter server.js file first then type pm2 kill 

 

 

now goto your ip/upgrade i.e

http://your-ip-address/upgrade  or http//your/-ip-address/myapp/upgrade  (it depends where is backend installed)

 

it will update setting and upgrade backend ( now login with old username & password).

then remove upgrade folder from your backend for security reasons .

Now lets install backend (FRESH INSTALL)

Things you need , VIM , FTP , phpMyAdmin , Unzip , (wget if you preffer)

----------------------------------------------------------------------------------------

Connect to you VPS using FTP you have installed in above step (apt-get install vsftpd)

Open a ftp client and connect 

hostname= your ip 

username= root (if you have created a user type user name)

password= your root password ( if you have created a user type users password 

port= 21 ( if you have ssl use port 22)

after sucessful connection you will see root folder of your VPS 

now go back 1 folder 

---------------------------------------------------------------------------------------

UPLOAD BACKEND

to insatll whatsclone in folder/directory  of your VPS i.e http://your-ip.address/myapp

goto

var/www/html/myapp

and upload Backed part , ( if its zipped ) See unzip below

Note: you need to create myapp folder in /html/

-----------------------------------------------------------------------------------------

Unzip BACKEND

if your backedn file is zipped you can unzip by ssh 

login to server using SSH 

to unzip backed on root i.e /var/www/html/myapp/backedn.zip

type :

cd /var/www/html/myapp

type:

unzip backend.zip

------------------------------------------------------------------------------------------------

Set File Permission 

Delete config.php (if its there , it should not be there in new update)

and set permission to  777 for

"videosFiles & audioFiles & documentFiles & imagesFiles"  folders they exists under "Uploads" folder

also before start installation you need to set permission to 777 for "config" folder

 

------------------------------------------------------------------------------------------

SQL User & DB

Now creata a SQL database and user 

got http://your-ip/phpmyadmin 

login with user you created in SETUP VPS

-- click on users 

-- add new user

--- username= what ever you want

--- Hostname = localhost

--- password= a strong one

--- retype password = your strong passsword again

 

IMP: if you wnat to creata a database in this step 

check : create a database with same name ( your username)

give all permission 

CLICK ON GO 

------------------------------------------------------------------------------------

Install backend 

goto your ip address in a browser  

 http://your-ip/myapp/install

 

Fill the required feilds in STEP1

Hostname=localhost

DB User = Database user you created above

DB Pass = Your strong password 

DB Name = Same as your user name ( if you have create a seprate database type that and make permission is ok)

 

then it will show you the admin username and password  like this 
 

username  : admin

password : admin 

so you can change them one you connect to your dashboard :

 http://your-ip/myapp/admin/

Admin Username = Set your admin user name 

Admin Password = Set Admin Password 

NOTICE : before you  run your app you need to set the app name   on settings section :
App Name = Your app name 

--------------------------------------------------------------------------

Setup PORT & Secret KEY

NOTCIE : the old backend has server.js file now this new update the name is app.js and exist under node_app folder

Now Login to your admin cp by Going to your ip 

After logging in click on settings

edit  app.js file under node_app folder 

Set : Port (usually 9001 ) if you are running anyother app make sure same port is not used by that app

Secret ( server sceret key should be same on both Android APP and Backend Server )

 

Change other setting , and click on SAVE

--------------------------------------------------------------------------------------

If you have any issue contact us ...

Unzip Download whatsclone copy

Copy android code folder in a short path i.e C:\Android\Myapp

Open Android Studio

Close any open project and click on Open Exesting Android Studio Project "Import"

Wait for 2-3 minutes it will load some gradle settings (depends on your PC & Internet Speed

If you have latest SDK installed it will load smoothly but if you have older version of plugins or missing SDK plugin/modules. you will see error Gradle Sync Failed . it will ask to install missing Dependiences , click on first dependiences and SDK will popup and will install missing files .

Gradle will SYNC agan and this tilme it will show Gradle Sync Completed in xx Minutes !

-----------------------------------------------------------------------------------------

Now Rename Package name .

After Opening Project ( if you cant see left panel where app is press ALT+1)

After importing if you see empty screen press ALT+1

Select Android from DropDown and Click on Android .

Now click on APP> JAVA < Click setting Gear as shown in pic , unselect Compact Empty Middle Package

Now Right Click on Sourcecanyon and REFACTOR > Rename , type you app middle name

e.g if your app name is com.yourname.apname ( In this place tyoe yourname)

Now rename APP name in package

DO same and rename this time right click on whatsclone > refactor > rename type your app name.

Click on Refactor . and when promoted for confirmation Click on Do Rectify

----------------------------------------------------------------------------------------------------------

To make this app run also change package name in some Gradle Script > build.gradle

Rename com.sourcecanyon.whatsclone with you package name com.yourname.appname

------------------------------------------------------------------------------

To Change APP name ( that will appear on Main Activity and Phone When Installed

Rename app in strings.xml under res folder Replace WhatsClone With Your App Name

----------------------------------------------------------------------------------------

That is ALL , You have imported and renamed your App
for more info visit :  https://youtu.be/lpbuHxC3X9Q

Setup Firebase 

Login to your Firebase account / Login with google account (gmail)

after click on GO TO CONSOLE on the right-top :

 

Click on ADD PROJECT  to create a new one  then create project :

after creating project is done :

now you need to click on Add Firebase to your Android app :

fill the info  


set the same package name of the app 

then click on register app

next step is the firebase will generate a file  "google-services.json"  click on download and follow instructions on this image :

after you done with this click CONTINUE  

the last step i already add firebase to gradle so you can just click on finish .

now the android side for firbase is done : 
now we have to setup firebase for dashboard :

on your console click options icon of project then on settings :

after this go to CLOUD MESSAGING :

all what we need here is  Server key  and Sender ID .

copy Server key  and go to settings section on dashboard and past it on  google api key  field .
copy Sender ID  and go to settings section on dashboard and past it on  google sender id field .

That's all for setup firebase if you have any issues contact us .

We need to enable Google drive because with it users cannot do any backup

go to :

https://console.developers.google.com/apis/library?project="id of project"

Make sure you replace "id of project" to your project id like :

https://console.developers.google.com/apis/library?project=testproject-3287a&authuser=3

Now click on Drive API under G Suite APIs after that click enable to enable google drive

after enable it now go to "credentials" to create new server key :

click on "create credentials"

and select "OAuth client ID"

last step fill feilds and accept terms and click on create

If you face a problem to get signinng certificate fingerprint then check the solution here to get it try the first answer :
https://stackoverflow.com/questions/42663114/keystore-file-does-not-exist
Once your create your account on Twilio web site ,then please follow this

If you enable Facebook kit account on android project you have to disable twillio on dashboard ,just one is required

so you need to create your app on facebook console developers : go to :

https://developers.facebook.com/

Once you create the app click on it to get into dashboard :

Now you need to click on add product to add Account kit then click setup :

so we finish setup facebook side on facebook console :

The last step is to copy the App ID on the top and Account Kit Client Token and past them on strings.xml file on android project :

The last thing don't forget to change the Mode for fb kit by change the DEV-MODE make app visible to users like in those images

This step for admob ,so you can cntrol your ads from your admin panel

Install NodeJs and npm

 
apt-get install python-software-properties
apt-get install curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install nodejs
 

Check Node and Npm

node -v
npm -v
 
Install pm2
npm install pm2 -g
 

Start your app 

if you haev installed on VPS root . http://your-ip-address/
 
pm2 start watson.coffee --max-memory-restart 600M
pm2 start /var/www/html/app.js -n "Your app name"
If you want to specific the limit memory to restart your app automaticly then just start your app using pm2 like this (600MB is limit in this exemple ) :
pm2 start /var/www/html/app.js -n "Your app name" --max-memory-restart 600M
pm2 save (to save processes)
pm2 list (to show list of processes)
pm2 logs (to show logs of server)

I’ve used the following libraries.

Once again, thank you so much for purchasing this item. As I said at the beginning, I’d be glad to help you if you have any questions relating to this item. No guarantees, but I’ll do my best to assist. If you have a more general question relating to this item on Codecanyon, you might consider visiting the forums and asking your question in the “Item Discussion” section.