Hostma – Hosting React & WHMCS Template

Vite Installation Setup

Create a workspace and initial application

You develop apps in the context of an vite-React workspace.
To create a new workspace and initial starter app just follow the below steps

  1. Run the command , as shown below
  2. 	First step :
    	
    	npm create vite@latest
    	
    	
  3. This new command prompts for the information about features to include in the initial app. Accept the defaults by pressing the Enter or Return key.
  4. Second step: provide your project name as my-app Project name : my-app Third step: select your required framework you are familiar with, Select a framework: React Fourth step: select your required script language you are familiar with, Select a variant: javascript

    The vite installs the necessary React npm packages and other dependencies. This can take a few minutes. This creates a new workspaces and a simple Welcome app, ready to run.

Run the application

The vite includes a server, so that you can build and serve your app locally.

  1. Navigate to the workspace folder, such as my-app.
  2. Run the following commands:
	cd my-app
	 npm run dev
									 

The yarn or npm serve command launches the server, watches your files, and rebuilds the app as you make changes to those files. The run dev just Option automatically opens your default browser to http://localhost:5173/.

Hostma React Setup

Step1:

Download the Admitro rar/zip file.

Extract it there you will find Hostma(main project file), Starter-kit(set of files and code that provides a basic structure and functionality for a specific type of application), Readme.txt, Documentation.

Step2:

Go to the Hostma folder/directory. open the command prompt/ terminal run the below command.

npm install
	// If you faced any issue running "npm install" Please make sure to use,
	npm install --force 	// This command will ignore if there was any dependency issue.
	(or)
	yarn install			// yarn can handle dependency issues better than npm.

Once the installation was successful then you can find node_modules folder where all the downloaded libraries are available.

Step3:

To serve the React project, In command prompt or terminal run the following command:

npm run dev

Once you serve your application by default port is set to :http://localhost:5173/

Deploying React Application

Step1:

Open the command prompt or terminal and navigate to the root directory of your React application.

Step2:

Run the following command to build the application.

npm run build

This will compile your React application and create a production-ready build in the `dist/` folder.

Step3:

If you're serving the app out of a subfolder, edit a version of index.html to set the base href appropriately. For Example, if the URL to indexpage is www.abc.com/hostma/preview/indexpage, set the base href to

<	base:"/hostma/preview/">