Deployment
Project Extraction
-
First you have to extract the
whoxa-app.ziporwhoxa-web.ziporwhoxa-business-app.zipthen you will get two zip files.- whoxa-admin.zip (If you have business App or Web Version)
- whoxa-website.zip (If you have regular Web Version)
- whoxa-app.zip (If you have Regular App Version)
- whoxa-backend.zip (If you have regular Web or App Version)
- whoxa-business-backend.zip (If you have business Web or App Version)
- whoxa-business-admin.zip (If you have business app Version)
- whoxa-business-app.zip (If you have Business App Version)
-
Upload
whoxa-backend.ziporwhoxa-business-backend.zipto a location where you want to deploy Project using FileZilla/var/www/whoxa(This is the recommended location)
-
Install unzip to
unzipthe Project . Run following command to install unzip
sudo apt install unzip
unzip whoxa-backend.zip
Configurations
- After the extraction you will see the Project files
ENV file configurations (For Regular version)
- Make a
.envfile from thedemo.envin the project on folder which containpackage.jsonwith following content.
Port="3047"
NODE_ENV="production"
screteKey="screteKey"
DB_USERNAME="postgres"
DB_PASSWORD="root@1142"
DB_DATABASE="whoxa_advanced"
JWT_EXPIRY="24h"
baseUrl="http:{{HOST}}:{{PORT}}"
TWILIO_ACCOUNT_SID="TWILIO_ACCOUNT_SID"
TWILIO_AUTH_TOKEN="TWILIO_AUTH_TOKEN"
TWILIO_PHONE_NUMBER="TWILIO_PHONE_NUMBER"
MSG91_SENDER_ID="MSG91_SENDER_ID"
MSG91_API_KEY="MSG91_API_KEY"
MSG91_TEMPLATE_ID="MSG91_TEMPLATE_ID"
IS_TWILIO_ENABLED=true
IS_MSG91_ENABLED=false
IS_CLIENT=true
ONE_SIGNAL_APP_ID="ONE_SIGNAL_APP_ID"
ONE_SIGNAL_API_KEY="ONE_SIGNAL_API_KEY"
ANDROID_CHANNEL_ID="ANDROID_CHANNEL_ID"
ENV file configurations (For Business version)
- Make a
.envfile from thedemo.envin the project on folder which containpackage.jsonwith following content.
Port="3047"
NODE_ENV="production"
screteKey="screteKey"
DB_USERNAME="postgres"
DB_PASSWORD="root@1142"
DB_DATABASE="whoxa_advanced"
JWT_EXPIRY="24h"
baseUrl="http:{{HOST}}:{{PORT}}"
TWILIO_ACCOUNT_SID="TWILIO_ACCOUNT_SID"
TWILIO_AUTH_TOKEN="TWILIO_AUTH_TOKEN"
TWILIO_PHONE_NUMBER="TWILIO_PHONE_NUMBER"
MSG91_SENDER_ID="MSG91_SENDER_ID"
MSG91_API_KEY="MSG91_API_KEY"
MSG91_TEMPLATE_ID="MSG91_TEMPLATE_ID"
IS_TWILIO_ENABLED=true
IS_MSG91_ENABLED=false
IS_CLIENT=true
ONE_SIGNAL_APP_ID_BUSINESS="ONE_SIGNAL_APP_ID_BUSINESS"
ONE_SIGNAL_API_KEY_BUSINESS="ONE_SIGNAL_API_KEY_BUSINESS"
ANDROID_CHANNEL_ID_BUSINESS="ANDROID_CHANNEL_ID_BUSINESS"
Server Starting
- Open Terminal on the location where
package.jsonis located. - Run following command to install dependencies
npm install
- After successful running of
npm installinstall global dependency to auto configure the DB related tasks by running following command.
npm install -g sequelize sequelize-cli
- To install PM2 Globally
npm install -g pm2
- To run server run following command within the terminal where
package.jsonis located.
pm2 start index.js --name whoxa
Peer Js installation
- Install
PeerJSglobally
npm install -g peer
- Run following command to run
peerserver on port 4001
pm2 start "peerjs --port 4001" --name "peerjs-server"
Auto restart on server reboot
- Run following command to save all the process running on pm2
pm2 save
- Run following command to restart all the saved processes on server restart
pm2 startup systemd
- Run following command to see running pm2 processes
pm2 status
- Run following command to see logs of a process
pm2 log {index}
Open webpages
For Web version
Frontend will be at
http://{your_server_ip}:{port_on_which_server_is_running}
VITE_API_URL={{your_server_ip}}:{{port}}/api
VITE_SOCKET_URL={{your_server_ip}}:{{port}}/
VITE_Google_MAP_KEY="Google Map API Key"
VITE_GIPHY_API_KEY="Giphy API Key"
VITE_IS_DEMO="false"
Environment Configuration Update Instructions
Step 1: Update the .env File
Navigate to the project’s root directory (the folder where package.json is located).
Open the existing .env file.
Update the required configuration values (such as API URLs, keys, ports, etc.).
Save the file after making the changes.
- Make sure all environment variables are correctly defined before proceeding to the next step.
Step 2: Create a Production Build (Frontend)
Open a terminal inside the frontend project root directory.
Run the following command to create a production build:
npm run build
After the build process is completed, a dist folder will be generated.
Verify that all the compiled files are available inside the dist folder.
Select all files inside the dist folder and create a .zip file containing those files.
Step 3: Replace Frontend Files in Backend Project
Go to your backend project directory.
Inside the backend project, locate the folder named frontend.
Delete all existing files inside the frontend folder.
Upload the newly created frontend .zip file into the backend project.
Extract (unzip) the files inside the frontend folder.
After extraction, all new build files should be present inside the backend frontend folder.
Step 4: Restart the Backend Project
Admin Panel will be at
http://{your_server_ip}:{port_on_which_server_is_running}/admin
For App version
Admin Panel will be at
http://{your_server_ip}:{port_on_which_server_is_running}
Default API Endpoint in both App and Web Version
http://{your_server_ip}:{port_on_which_server_is_running}/api
- email:
demo@whoxa.com
- password:
Admin@123?