Deployment From Source Code
This is the step-by-step guide to help you set up the Backend API in your server, with which, all the API endpoints for Spurtcommerce Admin panel, Vendor panel and Storefront gets deployed.
Single Server Deployment in Ubuntu
In order to begin with Single Server deployment, you need to have the prerequisites ready in the Server .
If you have not installed required prerequisite software please install now following the Set up development environment link
Now, follow the steps to begin the deployment process:
Step 1 - Set up API following the link API Setup.
Step 2 - After building the source code in your local development machine, move the required folders listed below
demo/
dist/
sitemap/
package.json
views/
.env
Step 3- You have to edit your ENV file based on your infrastructure. please follow Environment Configuration link to edit your env file.
Step 4- To install Node packages use the command
Step 5- Change apache configuration and specify ProxyPass rules inside virtual host in 000-default.conf.
Run the following commands from system's root directory
Then restart apache with below command
Step 6- Click the link given below to install PM2. Skip if it is already installed.
https://www.npmjs.com/package/pm2
Check whether you are having
ecosystem.config.js
in api folder. If it does not exist, then create the file and copy and paste the following code in that file
"PORT" : {your port number}
"NODE_ENV": {your env type}
Step 7- To run Api use pm2 command
pm2 start
For additional PM2 commands follow the referral link https://www.npmjs.com/package/pm2
Step 7- After having followed the above steps correctly, you have successfully setup the API server. You can now open the browser and give this URL —
- http://<YOUR_IP_ADDRESS>/backend/api
check the API documentation with the URL
http://<YOUR_IP_ADDRESS>/backend/apidoc
Last updated