Introduction

Thank you for purchasing DigiCode - Digital Marketplace SaaS. This guide will walk you through the installation process on both Shared Hosting (cPanel) and VPS environments.

Server Requirements

IMPORTANT: For cPanel/Linux deployment, you must update your prisma/schema.prisma file to include Linux binaries:
binaryTargets = ["native", "debian-openssl-1.1.x"]

Installation on Shared Hosting (cPanel)

We have optimized this application for easy installation. You do NOT need to run any commands or install dependencies manually.

Step 1: Create Database

1. Log in to cPanel and search for MySQL Database Wizard.

MySQL Database Wizard
Create a new database and user.

2. Create a Database (e.g., mydomain_digicode).

3. Create a User (e.g., mydomain_admin) and set a strong password.

4. Important: Grant "ALL PRIVILEGES" to the user for that database.

5. Open phpMyAdmin, select your new database, and click Import.

6. Choose the database.sql file found in the public folder of your download, and click Go. (This creates all necessary tables).

Step 2: Upload Files

1. Go to File Manager.

2. Create a folder for your app (or use public_html).

3. Upload the `project.zip` file (included in your download) and Extract it.

4. You should see folders like node_modules, public, and files like server.js.

Step 3: Configure Database

1. Find the .env.example file and rename it to .env.

2. Edit the file and enter your Database details:

DATABASE_URL="mysql://user:password@127.0.0.1:3306/db_name"
NEXTAUTH_URL="https://your-domain.com"
NEXTAUTH_SECRET="any-random-secret"

3. Save the file.

Step 4: Start the App

1. Go to Setup Node.js App in cPanel.

2. Create Application with these settings:

3. Click Create.

4. Do NOT click "Run NPM Install" (It is already installed!).

5. Click Restart.

That's it! Your site is live.

Installation on VPS (Ubuntu/CentOS)

# 1. Update System
sudo apt update && sudo apt upgrade

# 2. Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# 3. Install MySQL
sudo apt install mysql-server
sudo mysql_secure_installation

# 4. Clone/Upload Project
git clone https://github.com/your-repo/digicode.git /var/www/digicode
cd /var/www/digicode

# 5. Configure Environment
cp .env.example .env
nano .env  # Update DATABASE_URL with your MySQL credentials

# 6. Install Dependencies
npm install

# 7. Build
npm run build

# 8. Start with PM2
npm install -g pm2
pm2 start npm --name "digicode" -- start
pm2 save
            

Running the Auto-Installer

Once your server is running, open your browser and go to:

http://your-domain.com/install
1
Welcome: Checks basic requirements.
2
License Verification: Enter your Envato Purchase Code.
3
Database Config: Enter the DB Name, User, and Password you created in cPanel/VPS.
4
Admin Setup: Create your master administrator account.

The installer will automatically write the .env file, migrate the database tables, and seed dummy data.

Troubleshooting

500 Server Error? Check the Node.js logs. It usually means the database connection failed or the build failed.

Styles not loading? Make sure your domain is correctly pointed and you are not using a subpath without configuring `basePath`.

Error "next: command not found"? This means `npm install` failed or your server cannot run build commands. Solution: Build locally on your PC, zip the `.next` folder, and upload it to the server manually.

Support & Customization

If you need help with installation, configuration, or want custom modifications for your marketplace, get in touch with our support team.

WhatsApp Support: +8801628669266