Commerce Portal Setup

TABLE OF CONTENTS

This article helps to Configure and Host the Commerce Portal. 

Deployment and Setup for Commerce Portal

Comprehensive Guide to Host on IIS with Additional Domain Requirements:

To host the Commerce portal on the server, we will require three domains for

  1. CP API Gateway

  2. CP Admin

  3. CP API

Prerequisites:

Before proceeding with the setup, ensure the following software is installed on your

system:

  1. Visual Studio Code 64-bit for Windows - Download Link

  2. Node.js 64-bit - Download Link

  3. Git Desktop 64-bit for Windows

  4. NET 7 Core (64-bit) - Download Link

  5. Microsoft Access Database Engine 2016 Redistributable - Download Link

Commerce Portal API Gateway

  • Open the Znode.APIGateway application and make the following changes:

  • In the Ocelot.json file, Replace "Host": "localhost" with the domain name based on the port. For example, if Port 44375 is for API, replace it with the API domain name and leave the "Port" field blank. Refer to the screenshot below


  • Similarly, replace "Host": "localhost" with the domain name based on the port. For instance, Port 44309 is for CP API, so replace it with the CP API Domain name and keep the "Port" field blank. Refer to the screenshot.

  • In the appsettings.json file, replace all the localhost URLs with the respective domain URLs and domain names. Please refer to the screenshot below:

  • After making the above changes, build the project with no errors. Publish the API Gateway Project in release mode.


Deployment and IIS Configuration:

  • Deploy this build on the server in the Znode folder where all others (Admin, API, Webstore, and Payment API) are present.
  • In IIS, create a new domain for the CP API Gateway, and give the path of the above folder. Below is the reference of how the API Gateway looks:


Commerce Portal Admin

Following are the configurations to host CP Admin on the server:

React Application Setup on the local environment:


  • Navigate to the file explorer and open the Znode.Engine.CommercePortal folder, enter the cmd command in the URL.
  • Write the command as code. and press enter. The visual studio code will open:
  • Click on Terminal and select New Terminal.
  • Write the command as npm install
  • Now write the command as npm start.
  • After executing the above command, the CP Admin will run locally and will look as follows:

  • To host this on IIS, we need to replace all the localhost URLs with the respective domain URLs

  • Next, run the command npm run build.

  • After executing the above command, the build folder will be created in the file explorer path. For instance:


Deployment and IIS Configuration:

  • On the server, create a folder for CP Admin (where all other folders are present). Copy and paste the above build folder into the newly created folder.
  • Add the new domain in IIS for the CP Admin. Set the path to the CP Admin folder in IIS.


Commerce Portal API

Setup on the local environment:

  • In the Znode Multifront project, ZnodeServiceApiRootUri is present for CP API in the admin web config.
  • Database Setup:
    • Ensure the ZnodeDomain entry for localhost on port 44309 exists in the database.
    • If the entry for ZnodeDomain 44309 is not present, insert it into the database.SQL Query.
      Below is the reference for the CP API:
  • In the Znode.Engine.CommercePortal.Api project, navigate to the Web. config and update the connection string.

  • Build the Znode.Engine.CommercePortal.Api project with no errors. Publish the project in release mode.


Deployment and IIS Configuration:

  • Deploy the build of Znode.Engine.CommercePortal.Api on the server. Update the connection string in Web.config.
  • Insert the entry for CP API in the ZnodeDomain Table.
  • Add a new domain for CP API in IIS. 
  • Place the deployed folder where all other application folders are present.
  • In IIS, set the path of this folder to the domain created for CP API.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.