Server Side Rendering (Optional)
This step is completely optional. If you do not need Server Side Rendering (SSR), you can skip this section and continue using the standard setup.
Requirements
Before proceeding, make sure your server meets the following requirement:
- Node.js 20+
Configuration
Follow these steps to configure SSR:
- Extract the downloaded
.zipfile from Codecanyon on your PC.
After extracting, you will find a folder named Docker. - Go to the Docker > Frontend folder.
- Open and edit the .env.prod file.
- Change the value of
API_BASEto the root URL of your admin panel. - Example: http://www.yourdomain.com/
⚠️ Make sure to add / at the end of the URL.
Node.js App Creation
Follow these steps to create the Node.js application in cPanel:
- Log in to your cPanel account.
- Scroll down to the Software section.
- Click on Set up Node.js App.
- Click on Create Application.
- Fill in the following details:
- Application root:
public_htmlor the subdomain directory where you want to run the script. - Application URL: Your domain.
- Application startup file:
.output/server/index.mjs
After completing the form, create the application.
Building the Frontend
Now it’s time to build the frontend locally and upload it to the server.
- Go to the Frontend folder on your computer.
- Open Command Prompt (or Terminal) inside that folder.
- Run:
bash
npm install- Then run:
bash
npm run buildImportant Notes
- Node.js must be installed on your computer.
- Make sure the Node.js version on your local machine matches the version on your server.
- To check your Node.js version, run:
bash
node -v- After building, compress the entire frontend folder.
- Upload it to your server inside
public_htmlor your intended subdomain directory. - Extract the uploaded file.
- Your website should now be accessible.
✅ SSR setup is now complete.