- 🎯 Overview
- ✨ Features
- 🛠️ Tech Stack
- 🚀 Installation
- 🔐 cURL & OpenSSL Configuration
- 📄 Ghostscript PDF Optimizer Setup
- 👥 Team
📚 File management system for PUP San Juan accreditation processes
🔐 Secure document handling with role-based access
📊 Real-time progress tracking and analytics
- 📤 Upload/Download with progress indicators
- 📁 File organization by areas & parameters
- 🔍 Advanced search & filtering
- 📑 Document viewer with PDF preview
- 🔑 Role-based access (Admin, Coordinator, Area Designee)
- 🛡️ Secure authentication with JWT
- 👤 User profiles & permission management
- 📋 Audit trail for all activities
- 🎯 Program management by academic areas
- 📈 Progress tracking with real-time updates
- 🤝 Collaborative review process
- 🏆 Exhibit management for accreditation
- 📱 Responsive design (mobile, tablet, desktop)
- 🌙 Dark/Light mode toggle
- 📊 Interactive dashboard with analytics
- 🔔 Real-time notifications
- 🐘 PHP 8.2+
- 🟢 Node.js 18+
- 🐘 PostgreSQL 13+
- 📦 Composer 2.x
- 👻 Ghostscript (for PDF optimization)
- 🔐 cURL & OpenSSL enabled
# 1️⃣ Clone repository
git clone https://github.com/TombstonePUP/PUPCON.git
cd PUPCON
# 2️⃣ Install dependencies
composer install
composer require mostafaznv/pdf-optimizer # 📄 Install PDF Optimizer package
npm install
# 3️⃣ Environment setup
cp .env.example .env
php artisan key:generate
php artisan storage:link
# 4️⃣ Database setup
php artisan migrate
php artisan db:seed --class=UserSeeder
php artisan db:seed --class=PagesSeeder
# 5️⃣ Start servers
composer run dev| 👤 Role | 🔐 Password | |
|---|---|---|
| 🛡️ Admin | johndoe@admin.com |
admin@123 |
| 👨💼 Chairman | keithlee@chairman.com |
chairman@123 |
| 👨💼 Accreditor | janedoe@accreditor.com |
accreditor@123 |
🎉 App running at http://localhost:8000
This application requires cURL and OpenSSL for secure API connections (Facebook API, external services, etc.). Follow these steps to enable and configure them properly.
-
Locate your
php.inifile:- XAMPP:
C:\xampp\php\php.ini - WAMP:
C:\wamp64\bin\php\php8.x.x\php.ini
- XAMPP:
-
Open
php.iniin a text editor (as Administrator) -
Enable extensions by removing the semicolon (
;):; Find these lines and uncomment them: extension=curl extension=openssl
# Check if extensions are enabled
php -m | grep -E 'curl|openssl'
# If not installed, use Homebrew
brew install curl openssl# Install cURL and OpenSSL
sudo apt-get update
sudo apt-get install php-curl php-openssl
# Restart Apache/PHP-FPM
sudo systemctl restart apache2
# OR
sudo systemctl restart php8.2-fpmTo fix SSL certificate errors (especially for Facebook API), you need to configure the CA certificate bundle:
# Download the latest CA certificate bundle
curl -o cacert.pem https://curl.se/ca/cacert.pemOr download manually from: https://curl.se/ca/cacert.pem
- Windows XAMPP:
C:\xampp\php\extras\ssl\cacert.pem - Windows WAMP:
C:\wamp64\bin\php\php8.x.x\extras\ssl\cacert.pem - macOS/Linux:
/usr/local/etc/openssl/cacert.pem
Open your php.ini file and add/update these lines:
[curl]
; A default value for the CURLOPT_CAINFO option.
curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
openssl.cafile = "C:\xampp\php\extras\ssl\cacert.pem"For Linux/macOS:
curl.cainfo = "/usr/local/etc/openssl/cacert.pem"
openssl.cafile = "/usr/local/etc/openssl/cacert.pem"# XAMPP - Restart Apache from Control Panel
# Linux
sudo systemctl restart apache2
# OR
sudo systemctl restart nginx
sudo systemctl restart php8.2-fpm
# macOS (Homebrew)
brew services restart phpRun these commands to verify cURL and OpenSSL are properly configured:
# Check if extensions are loaded
php -m | grep -E 'curl|openssl'
# Test cURL
php -r "echo (function_exists('curl_version') ? 'cURL is enabled' : 'cURL is disabled');"
# Test OpenSSL
php -r "echo (extension_loaded('openssl') ? 'OpenSSL is enabled' : 'OpenSSL is disabled');"
# Check CA certificate path
php -r "echo ini_get('curl.cainfo');"
php -r "echo ini_get('openssl.cafile');"❌ Error: "cURL error 60: SSL certificate problem"
Solution:
- Ensure you've downloaded the latest
cacert.pemfile - Verify the path in
php.iniis correct and points to thecacert.pemfile - Restart your web server after making changes
- Check file permissions (the PHP process must be able to read the file)
Temporary workaround for development only:
// In your .env file (NOT for production!)
CURL_VERIFY_SSL=false🚫 Error: "Call to undefined function curl_init()"
Solution:
- Verify cURL extension is enabled in
php.ini - Restart web server
- Check
php -m | grep curlto confirm it's loaded - On Linux:
sudo apt-get install php-curl
⚠️ Error: "SSL operation failed with code 1"
Solution:
- Update OpenSSL to the latest version
- Ensure both
curl.cainfoandopenssl.cafileare set inphp.ini - Verify the
cacert.pemfile is not corrupted (re-download if necessary)
🔍 How to find the correct `php.ini` file
# Command line
php --ini
# Or create a test file
echo "<?php phpinfo(); ?>" > info.php
# Then visit: http://localhost/info.php
# Look for "Loaded Configuration File"
# preferred modifications
upload_max_filesize = 2G
max_file_uploads = 50
memory_limit = 2G
post_max_size = 3G⚠️ Never disable SSL verification in production - Only useverify => falsefor local development- 🔄 Update cacert.pem regularly - CA certificates are updated periodically
- 🔐 Keep your PHP version updated - Newer versions have better SSL/TLS support
- 📊 Monitor your logs - Check
storage/logs/laravel.logfor SSL-related errors
Email notifications (password reset, user invitations, system alerts) require proper SMTP configuration.
Update the following values inside your .env file:
MAIL_MAILER=smtp
MAIL_ENCRYPTION=tls
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_generated_app_password
MAIL_FROM_ADDRESS="your_email@gmail.com"
MAIL_FROM_NAME="${APP_NAME}"Ghostscript is used to optimize and compress PDF files in the application for better performance and reduced storage.
First, install the Laravel PDF Optimizer package:
# Install via Composer
composer require mostafaznv/pdf-optimizerPackage Features:
- ✅ Automatic PDF compression
- ✅ Quality optimization
- ✅ Batch processing support
- ✅ Laravel integration
- ✅ Chainable methods
Documentation: https://github.com/mostafaznv/pdf-optimizer
-
Download Ghostscript:
- Visit: https://www.ghostscript.com/download/gsdnld.html
- Download the latest Windows installer (e.g.,
gs10.06.0w64.exefor 64-bit)
-
Run the installer:
- Follow the installation wizard
- Default installation path:
C:\Program Files\gs\gs10.06.0\bin
-
Add Ghostscript to System PATH:
- Right-click on "This PC" → Properties
- Click "Advanced system settings"
- Click "Environment Variables"
- Under "System variables", find and select "Path"
- Click "Edit" → "New"
- Add:
C:\Program Files\gs\gs10.06.0\bin(adjust version number if different) - Click "OK" on all dialogs
-
Verify installation:
gswin64c --version
-
Install using Homebrew:
brew install ghostscript
-
Verify installation:
gs --version
-
Install via apt:
sudo apt-get update sudo apt-get install ghostscript
-
Verify installation:
gs --version
Add Ghostscript and temporary directory paths to your .env file:
# Ghostscript Binary Path (adjust version number to match your installation)
PDF_OPTIMIZER_BIN_PATH="C:\\Program Files\\gs\\gs10.06.0\\bin\\gswin64c.exe"
# Temporary Directory for PDF Processing
TEMP="C:\\Users\\LENOVO\\Desktop\\Capstone\\PUPCON\\storage\\app\\public\\temp"
TMP="C:\\Users\\LENOVO\\Desktop\\Capstone\\PUPCON\\storage\\app\\public\\temp"
PDF_OPTIMIZER_TEMP_PATH="C:\\Users\\LENOVO\\Desktop\\Capstone\\PUPCON\\storage\\app\\public\\temp"
⚠️ Important: ReplaceC:\\Users\\LENOVO\\Desktop\\Capstone\\PUPCONwith your actual project path.
# Ghostscript Binary Path
PDF_OPTIMIZER_BIN_PATH="/usr/local/bin/gs"
# Temporary Directory for PDF Processing
TEMP="/path/to/your/project/storage/app/public/temp"
TMP="/path/to/your/project/storage/app/public/temp"
PDF_OPTIMIZER_TEMP_PATH="/path/to/your/project/storage/app/public/temp"# Ghostscript Binary Path
PDF_OPTIMIZER_BIN_PATH="/usr/bin/gs"
# Temporary Directory for PDF Processing
TEMP="/path/to/your/project/storage/app/public/temp"
TMP="/path/to/your/project/storage/app/public/temp"
PDF_OPTIMIZER_TEMP_PATH="/path/to/your/project/storage/app/public/temp"Ensure the temporary directory exists and has proper permissions:
# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "storage\app\public\temp"
# Linux/macOS
mkdir -p storage/app/public/temp
chmod 755 storage/app/public/temp💡 Note: If not set, the application will attempt to auto-detect the Ghostscript installation and use system temp directories.
The PDF optimizer can be used in your Laravel application:
use Mostafaznv\PdfOptimizer\Pdf;
// Basic optimization
Pdf::optimize('path/to/input.pdf')
->save('path/to/output.pdf');
// With quality settings
Pdf::optimize('path/to/input.pdf')
->quality(150) // DPI
->save('path/to/output.pdf');
// Chain multiple operations
Pdf::optimize('path/to/input.pdf')
->quality(150)
->grayscale()
->save('path/to/output.pdf');The PDF optimizer is automatically used when:
- 📤 Uploading supporting documents
- 📊 Generating reports
- 📁 Processing accreditation files
PDF files are compressed to reduce file size while maintaining quality (150 DPI for screen viewing).
❌ Error: "Ghostscript not found"
Solution:
- Verify installation: Run
gs --versionorgswin64c --version - Check PATH environment variable includes Ghostscript bin directory
- Verify
PDF_OPTIMIZER_BIN_PATHin.envpoints to correct executable - Restart your terminal/command prompt after modifying PATH
- On Windows, you may need to restart your computer
Windows - Check installation path:
Get-Command gswin64cLinux/macOS - Check installation path:
which gs🚫 Error: "Permission denied" or "Access denied"
Solution:
- On Linux/macOS: Check file permissions
sudo chmod +x /usr/bin/gs chmod 755 storage/app/public/temp
- On Windows: Run as Administrator or check folder permissions
- Ensure the temp directory exists and is writable
⚠️ Compression not working
Solution:
- Check storage permissions in
storage/app/public/temp - Ensure sufficient disk space
- Verify
PDF_OPTIMIZER_TEMP_PATHis correct - Review Laravel logs in
storage/logs/laravel.log - Test Ghostscript manually:
"C:\Program Files\gs\gs10.06.0\bin\gswin64c.exe" --version # Linux/macOS gs --version ``` </details>
📦 Package installation issues
Solution:
# Clear Composer cache
composer clear-cache
# Remove vendor directory and reinstall
rm -rf vendor
composer install
# If still having issues, update Composer
composer self-update
composer require mostafaznv/pdf-optimizer --with-all-dependencies🔍 How to find your Ghostscript installation path
Windows:
# Check registry
Get-ItemProperty HKLM:\Software\GPL\Ghostscript\*
# Or search in Program Files
Get-ChildItem "C:\Program Files" -Recurse -Filter gswin64c.exeLinux/macOS:
# Find Ghostscript binary
which gs
# Or search manually
find / -name gs 2>/dev/nullThe application uses the following Ghostscript settings for PDF optimization:
| Setting | Value | Description |
|---|---|---|
| 🎨 Device | pdfwrite |
PDF output device |
| 📏 Resolution | 150 DPI |
Optimized for screen viewing |
| 🗜️ Compression | JPEG |
Image compression method |
| 🎯 Quality | High |
Balances size and quality |
- ⚡ Automatic cleanup - Temporary files are deleted after processing
- 💾 Storage optimization - Original files are replaced with compressed versions
- 🔒 Security - Temp directory is isolated and regularly cleaned
- 📈 Performance - Reduces file sizes by up to 70% on average
⚠️ Version compatibility - Tested with Ghostscript 10.x (latest recommended)- 📦 Laravel Package - Uses mostafaznv/pdf-optimizer for seamless integration
![]() 🎯 Justine Bautista 📋 Project Manager |
![]() 📄 Regie San Juan 💻 Data Integrator |
![]() 🧪 Tamara Geronimo 🔍 QA Tester |
![]() 🎨 Mark Fulguerinas 💻 Frontend Developer |
![]() 🗄️ Charles Ilarde 🔧 Database Admin |




