Patient Portal Replicable Workflow

Comprehensive guide including Installation, Deployment Checklist, and File Permissions.

Patient Portal

Replicable Installation Guide

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

1 Upload Files

Upload all files to your web server:

  • index.php
  • layout.php
  • setup.php
  • setup_process.php
  • branding.php.example (template file)
  • All other application files (pages/, includes/, assets/, etc.)
2 Set Permissions

Ensure the root directory is writable so branding.php can be created:

chmod 755 /path/to/your/website
3 Access Your Site

Navigate to your domain in a web browser:

https://yourdomain.com/
4 Complete Setup Wizard

On first access, you'll see the setup wizard. Fill in the following information:

Database Configuration

Database Host: Usually localhost
Database Name: Your database name
Database Username: Your database user
Database Password: Your database password

Site Branding

Site Name: e.g., "Patient Portal", "Health Clinic"
Site Domain: e.g., "drsergio.tl", "clinic.com"
Site Tagline: Your custom tagline

Contact Information

Phone Number: Display number (e.g., "77262600")
WhatsApp Number: Full number with country code (e.g., "67077262600")
Contact Email: Your support email

Doctor Information

Doctor's Name: Full name of the primary doctor
Medical License: License number (optional)
Title/Credentials: e.g., "Medical Doctor & Specialist"

Admin Credentials

Admin Username: For administrative access
Admin Password: Minimum 8 characters

Regional Settings

Timezone: Select your timezone (e.g., Asia/Dili)
5 Setup Complete

After submitting, the system will:

  1. Validate database connection
  2. Create branding.php file
  3. 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)

  1. Upload all files EXCEPT branding.php
  2. Access the new domain
  3. Complete the setup wizard with new site details

Method 2: Manual Configuration

  1. Upload all files
  2. Copy branding.php.example to branding.php
  3. Edit branding.php manually with your settings
  4. Ensure correct file permissions (644)

Updating Branding

To update branding after initial setup:

Option 1: Re-run Setup Wizard

  1. Delete branding.php
  2. Access your site - setup wizard will appear
  3. Fill in new information

Option 2: Manual Edit

  1. Edit branding.php directly
  2. Update constants as needed
  3. Save file

Security Considerations

Important: 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.php already 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.php is loaded before layout.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.example for 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
Note: Always backup your branding.php file before making changes or upgrades.

Patient Portal

Deployment Checklist

Deployment Progress
0%

0 of 0 tasks completed

Pre-Deployment Preparation

1. Server Requirements

2. Database Setup

3. Domain Configuration

Deployment Steps

1. File Upload

2. File Permissions

Run these commands:
# Set directory permissions
chmod 755 /path/to/site
chmod 755 /path/to/site/assets
chmod 755 /path/to/site/pages
chmod 755 /path/to/site/includes

# Set file permissions
find /path/to/site -type f -exec chmod 644 {} \;
chmod 755 /path/to/site/*.php

3. Asset Preparation

4. Initial Access

Setup Wizard Configuration

1. Database Information

Deployment Information

Deployment Complete!

Congratulations on successfully deploying your Patient Portal. Don't forget to save your progress and backup all configuration files.

File Permissions Guide

Complete Guide to Setting File Permissions for Patient Portal

What Are File Permissions?

File permissions control who can read, write, or execute files on your server. There are 3 ways to set them depending on what access you have to your server.

Method 1: Using cPanel File Manager (Easiest - Most Common)
Need More Help?

Choose the method that matches your access level: cPanel (easiest), FTP (intermediate), or SSH (advanced)