📖 Setup & Documentation

Complete guide to deploying, configuring, and managing your PortfolioForge installation.

🚀 Quick Start (3 Steps)
Get your site live in under 5 minutes with these simple steps.
1

Edit config.php

Open config.php and update your database credentials, site URL, and site name.

define('DB_HOST', 'localhost');
define('DB_USER', 'your_cpanel_db_username');
define('DB_PASS', 'your_db_password');
define('DB_NAME', 'portfolioforge');
define('SITE_URL', 'https://yourdomain.com');
2

Upload All Files

Upload the entire folder content to your cPanel's public_html directory using FileZilla or cPanel File Manager.

3

Run the Installer

Visit https://yourdomain.com/install.php in your browser and click "Run Installation". Then delete install.php!

📦 Uploading Files
How to upload your files to cPanel shared hosting.
💡 Method 1 (Recommended): FileZilla FTP Client

Using FileZilla (FTP)

1. Download FileZilla from filezilla-project.org
2. In cPanel, create an FTP account under FTP Accounts
3. Connect using: Host: yourdomain.com | Port: 21
4. Navigate to public_html on the right panel
5. Drag and drop all files from the left (local) panel
6. Wait for upload to complete

💡 Method 2: cPanel File Manager

Using cPanel File Manager

1. Log into cPanel → File Manager → public_html
2. Click Upload button
3. ZIP all files first, then upload the ZIP
4. Right-click ZIP → Extract
5. Move extracted files to root if needed

⚠️ Make sure all files are in public_html root, not in a subfolder. If using a subfolder (e.g., /portfolio), update SITE_URL in config.php accordingly.
⚙️ Configuration
All settings are in config.php. Here's what each setting does:
SettingDescriptionExample
DB_HOSTDatabase host (usually localhost)localhost
DB_USERDatabase username from cPanelmysite_dbuser
DB_PASSDatabase passwordSecurePass123
DB_NAMEDatabase namemysite_portfolio
SITE_URLFull URL without trailing slashhttps://mysite.com
SITE_NAMEYour site/brand nameMyPortfolio
ADMIN_EMAILAdmin contact emailadmin@mysite.com
🎨 Adding New Templates
The template system is designed to make adding new templates as easy as creating a new folder.

Step 1: Create Template Folder

Create a new folder in templates/ with your template name (lowercase, no spaces):

templates/
  └── mytemplate/       ← your new template folder
      ├── template.php  ← required: the template HTML/PHP
      ├── meta.json     ← required: template metadata
      ├── preview.jpg   ← recommended: 800×500 preview image
      └── style.css     ← optional: additional styles

Step 2: Create meta.json

{
  "id": "mytemplate",
  "name": "My Awesome Template",
  "description": "A beautiful template for creative professionals.",
  "tags": ["modern", "creative", "colorful"]
}

Step 3: Create template.php

The template receives a $data array with these fields:

$data = [
  'full_name'     => 'John Doe',
  'title'         => 'Developer',
  'about'         => 'Bio text...',
  'email'         => 'john@example.com',
  'phone'         => '+1234567890',
  'location'      => 'New York, USA',
  'exp_years'     => '5+ years',
  'skills'        => ['PHP', 'React', 'MySQL'],
  'experience'    => [['title'=>'...','company'=>'...','start'=>'...','end'=>'...','desc'=>'...']],
  'projects'      => [['name'=>'...','tech'=>'...','desc'=>'...','url'=>'...','github'=>'...']],
  'profile_image' => 'https://yourdomain.com/uploads/profile_xxx.jpg',
  'accent_color'  => '#667eea',
  'social'        => ['linkedin'=>'...','github'=>'...','twitter'=>'...','website'=>'...'],
];
✅ Once the folder is created with the required files, the template will automatically appear in the template selection grid on the homepage!
🌐 Domain & Subdirectory Setup

Root Domain Setup (yourdomain.com)

Upload files to public_html/ and set:

define('SITE_URL', 'https://yourdomain.com');

Subdirectory Setup (yourdomain.com/portfolio)

Upload files to public_html/portfolio/ and set:

define('SITE_URL', 'https://yourdomain.com/portfolio');

Also update the RewriteBase in .htaccess:

RewriteBase /portfolio/
🔧 Maintenance
Regular maintenance tasks to keep your site running smoothly.

📊 View Database

Go to cPanel → phpMyAdmin → Select your database → Browse the portfolios table to view all generated portfolios.

🗑 Delete Old Portfolios

In phpMyAdmin, run:

-- Delete portfolios older than 90 days
DELETE FROM portfolios WHERE created_at < DATE_SUB(NOW(), INTERVAL 90 DAY);

📁 Clean Upload Files

Uploaded images are stored in uploads/. Use cPanel File Manager to delete old ones or add this SQL query to find orphaned records:

SELECT id, slug, created_at FROM portfolios ORDER BY created_at DESC;

💾 Database Backup

cPanel → Backup Wizard → Select your database → Download. Schedule automatic backups in cPanel → Backup if available.

❓ Frequently Asked Questions

Q: Portfolios show 404 after upload?

Make sure your hosting has mod_rewrite enabled. Check cPanel → Apache Modules. Also verify .htaccess was uploaded correctly (some FTP clients hide dotfiles).

Q: Images not uploading?

Check that the uploads/ folder exists and has write permissions (755 or 777). In cPanel File Manager, right-click → Change Permissions.

Q: How to add password protection?

Use cPanel → Directory Privacy to add HTTP basic auth to your site, or add a session-based admin panel.

Q: Can I use this on localhost?

Yes! Use XAMPP or Laragon. Set SITE_URL to http://localhost/portfolioforge and enable mod_rewrite in Apache.

Q: How to limit or disable public portfolio creation?

In generate.php, add a secret key check or comment out the form submission handling. You can redirect unauthorized requests to a login page.

📁 File Structure
portfolioforge/ ├── index.php ← Homepage ├── create.php ← Portfolio form ├── generate.php ← Form processor ├── portfolio.php ← Portfolio viewer ├── success.php ← Post-generation page ├── setup.php ← This guide ├── config.php ← 🔧 EDIT THIS FIRST ├── install.php ← ⚠️ Delete after setup ├── 404.php ← Custom 404 page ├── .htaccess ← URL rewriting rules ├── includes/ │ ├── db.php ← Database class │ └── functions.php ← Helper functions ├── assets/ │ ├── css/ │ │ └── style.css ← Main stylesheet │ └── js/ │ ├── main.js ← Core JavaScript │ └── form.js ← Form interactions ├── templates/ │ ├── clean/ ← Clean Professional template │ ├── dark/ ← Dark Modern template │ └── creative/ ← Creative Colorful template └── uploads/ ← User uploaded images
Built with ❤️ | PortfolioForge Documentation