Table of Contents
Overview
This Patient Portal system is designed to be easily replicable across multiple installations. All site-specific settings are centralized in a single configuration file (branding.php), making it simple to deploy the same codebase to different domains with different branding.
Features
Centralized Configuration
All settings in one file for easy management
Automatic Setup
Setup wizard on first run
Database Management
Easy database configuration
Multi-Language
EN, PT, ID, and Tetum support
Easy Customization
No code changes required
Secure
Password hashing and protection
Installation Steps
Upload all files to your web server:
index.phplayout.phpsetup.phpsetup_process.phpbranding.php.example(template file)- All other application files (pages/, includes/, assets/, etc.)
Ensure the root directory is writable so branding.php can be created:
chmod 755 /path/to/your/website
Navigate to your domain in a web browser:
https://yourdomain.com/
On first access, you'll see the setup wizard. Fill in the following information:
Database Configuration
localhost
Site Branding
Contact Information
Doctor Information
Admin Credentials
Regional Settings
After submitting, the system will:
- Validate database connection
- Create
branding.phpfile - Redirect you to the main site
File Structure
├── index.php # Main entry point (checks for branding.php)
├── layout.php # Main layout template (uses branding constants)
├── setup.php # Setup wizard interface
├── setup_process.php # Setup form processor
├── branding.php # Site-specific configuration (auto-generated)
├── branding.php.example # Template file for reference
├── includes/
│ ├── i18n.php # Translation system
│ └── ...
├── pages/
│ ├── home.php
│ ├── dashboard.php
│ └── ...
└── assets/
├── img/
│ ├── logo.png
│ ├── favicon.png
│ └── flags/
└── ...
Branding Configuration
The branding.php file contains all customizable settings:
Database Settings
DB_HOST, DB_NAME, DB_USER, DB_PASS
Site Branding
SITE_NAME, SITE_TAGLINE, SITE_DOMAIN, SITE_YEAR
Contact Information
CONTACT_PHONE, CONTACT_PHONE_FULL, CONTACT_EMAIL
Doctor Information
DOCTOR_NAME, DOCTOR_TITLE, DOCTOR_LICENSE
Asset Paths
LOGO_PATH, FAVICON_PATH, FLAG_EN, FLAG_PT, FLAG_ID, FLAG_TET
Application Settings
TIMEZONE, DATE_FORMAT, TIME_FORMAT
Redeploying to Another Site
Method 1: Using Setup Wizard (Recommended)
- Upload all files EXCEPT
branding.php - Access the new domain
- Complete the setup wizard with new site details
Method 2: Manual Configuration
- Upload all files
- Copy
branding.php.exampletobranding.php - Edit
branding.phpmanually with your settings - Ensure correct file permissions (644)
Updating Branding
To update branding after initial setup:
Option 1: Re-run Setup Wizard
- Delete
branding.php - Access your site - setup wizard will appear
- Fill in new information
Option 2: Manual Edit
- Edit
branding.phpdirectly - Update constants as needed
- Save file
Security Considerations
branding.php contains sensitive database credentials. Ensure proper file permissions.
1. Database Credentials
branding.php contains sensitive database credentials. Ensure proper file permissions (644 or 600).
2. Admin Password
The setup wizard automatically hashes the admin password using password_hash().
3. File Permissions
chmod 644 branding.php
chmod 755 setup.php setup_process.php
4. Remove Setup Files
After setup, consider removing or renaming setup files for security:
mv setup.php setup.php.bak
mv setup_process.php setup_process.php.bak
Troubleshooting
Setup Wizard Doesn't Appear
- Check if
branding.phpalready exists - Ensure directory is writable
- Check PHP error logs
Database Connection Failed
- Verify database credentials
- Ensure database exists
- Check database user permissions
- Confirm database server is running
Can't Create branding.php
- Check directory permissions:
chmod 755 /path/to/site - Check PHP user has write permissions
- Verify disk space is available
Layout Not Displaying Correctly
- Ensure
branding.phpis loaded beforelayout.php - Check all constants are defined
- Verify asset paths are correct
Customization Beyond Branding
For additional customization:
Logo/Images
Replace files in assets/img/ directory
Translations
Update files in translation system
Styling
Modify Bootstrap/Tailwind classes in templates
Features
Edit branding.php feature flags:
ENABLE_APPOINTMENTS, ENABLE_PRESCRIPTIONS,
ENABLE_LAB_RESULTS, ENABLE_PAYMENTS
Support
For issues or questions:
- Check troubleshooting section above
- Review
branding.php.examplefor all available options - Contact: info@drsergio.tl
Version History
v1.0 - Initial Replicable Version
- Centralized branding configuration
- Automatic setup on first run
- Multi-language support
branding.php file before making changes or upgrades.