Left Icon Right Icon
Squehub SqueHub

πŸš€ Installation Guide

Squehub is a lightweight, modern, elegant PHP framework built for performance, flexibility, and developer productivity. This guide walks you through installing the framework, setting up your development environment, and properly backing up and upgrading your project when new versions are released.

πŸ“Œ Current Squehub Version: v1.2.0

βœ… System Requirements

Ensure your system meets the following minimum requirements:

  • PHP 8.2 or higher
  • Composer installed globally
  • Required PHP extensions:
    • pdo
    • mbstring
    • openssl

πŸ›  Installing Composer

If Composer is not installed on your system, follow the steps below:

Windows:
  • Visit getcomposer.org and download the Composer installer.
  • Run the installer and complete the setup wizard.
macOS / Linux:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
sudo mv composer.phar /usr/local/bin/composer

πŸ“¦ Installing Squehub

Choose one of the installation methods below to get started:

1. Install via Composer (Recommended)
composer create-project squehub/squehub myapp
2. Clone via Git (For Contributors)
git clone https://github.com/squehub/squehub.git myapp
cd myapp
composer install
3. Download ZIP Archive
composer install
4. Deploy or Install on XAMPP / Live Server

You can deploy or install the Squehub framework directly on a local server (like XAMPP) or a live/production server. This is suitable for both initial development and moving a completed project to production.

  • πŸ–₯ Local (XAMPP): Copy your project folder into the htdocs/ directory (e.g., C:/xampp/htdocs/yourapp).
  • 🌐 Live Server: Upload your full project to the root directory of your server (e.g., /var/www/html/).

For security and proper routing, it's recommended to configure your web server (Apache, Nginx, etc.) to serve from the /public directory.

πŸ’‘ Note: Squehub supports flexible deployment environments:
  • βœ”οΈ Serving from /public/index.php (recommended)
  • βœ”οΈ Or directly from /index.php in the root directory (e.g., for shared hosting)
If your server doesn't support custom document roots, you can use an .htaccess redirect or symbolic link to point to the correct entry point.
βœ… Deployment Tip: After placing your project on the server, simply visit http://localhost/yourapp (for XAMPP) or your live domain to run the app β€” no extra steps required.

πŸ“ Project Structure

Once installed, your Squehub project will look something like this:

myapp/
β”œβ”€β”€ app/                                  # Application source files
β”‚   β”œβ”€β”€ Clis/                             # CLI command handlers
β”‚   β”‚   β”œβ”€β”€ dump/                         # Commands for data dumping/seeding
β”‚   β”‚   β”‚   └── dump.php                  # Main dumper entry
β”‚   β”‚   β”œβ”€β”€ make/                         # Commands for generating boilerplate code
β”‚   β”‚   β”‚   β”œβ”€β”€ MakeController.php        # Generate a new controller
β”‚   β”‚   β”‚   β”œβ”€β”€ MakeDumper.php            # Generate a new data dumper
β”‚   β”‚   β”‚   β”œβ”€β”€ MakeMiddleware.php        # Generate a new middleware class
β”‚   β”‚   β”‚   β”œβ”€β”€ MakeMigration.php         # Generate a new migration file
β”‚   β”‚   β”‚   └── MakeModel.php             # Generate a new model
β”‚   β”‚   └── clis.php                      # CLI command entry file
.................. etc

πŸ–₯ Start the Server

Squehub provides a built-in CLI tool to launch a local development server without needing Apache or Nginx.

php squehub start

After running the command, open your browser and visit: http://localhost:8000

🌐 Running via Web Server or Hosting Panel

Squehub can also be deployed directly on local or live servers by placing the project inside a web root directory.

  • For XAMPP: Place the project inside C:/xampp/htdocs/
  • For Live Servers: Upload the project to your web root, e.g. /var/www/html or public_html

By default, Squehub is designed to be served from the /public/index.php file for better security and routing separation. However, it also supports being served directly from the project root via /index.php.

πŸ’‘ Supported Server Entry Points:
  • βœ”οΈ /public/index.php β€” Recommended (set your web server’s document root to the /public folder)
  • βœ”οΈ /index.php β€” Optional fallback if your server or shared host doesn't support document root configuration

If using shared hosting or environments without virtual hosts, you may use an .htaccess redirect or symlink to point requests to the appropriate entry file.

🌐 Environment Configuration

The .env file is used to define environment-specific variables such as database credentials and application settings. This file is critical for managing different configurations between local development, staging, and production.

If your project is missing the .env file, you can generate it by copying the default template:

cp .env.example .env
πŸ“„ Default .env Example
APP_NAME="SqueHub Framework"
DB_HOST=localhost 
DB_DATABASE=squehub-officlal
DB_USER=root
DB_PASSWORD=
APP_ENV=development 
APP_DEBUG=true
πŸ” Explanation of Each Variable
  • APP_NAME – The name of your application, shown in titles and error pages.
  • DB_HOST – Your database host (typically localhost or a remote IP).
  • DB_DATABASE – The name of your database schema.
  • DB_USER – The username used to connect to your database.
  • DB_PASSWORD – The password for the above database user.
  • APP_ENV – The current application environment (development, production, etc.). This controls debugging, error reporting, and behavior.
  • APP_DEBUG – Enables or disables debug mode (true shows full error traces, false hides them).
πŸ” Keep It Secure
⚠️ Important: Never commit your .env file to version control (e.g., Git). It contains sensitive information such as credentials and debug settings.
πŸ“ Tip for Shared Hosting

If you're deploying on shared hosting and the command cp .env.example .env isn't available, just manually duplicate the .env.example file, rename it to .env, and edit the contents accordingly.

βœ‰οΈ Email Configuration

Squehub handles outgoing emails using settings defined in config/mail.php. Unlike some frameworks that rely on the .env file, all mail configuration in Squehub is centralized and editable directly via PHP.

Here is the default configuration:

'host' => 'mail.Squehub.com',
'port' => '587',
'username' => 'dev@Squehub.com',
'password' => '123456790$',
'encryption' => 'tls',
'from_address' => 'dev@Squehub.com',
'from_name' => 'Squehub Framework'
πŸ”§ Updating Mail Settings

To use your own mail service (like Gmail, Mailgun, SendGrid, etc.), open config/mail.php and update the values accordingly:

return [
    'host' => 'smtp.yourmailserver.com',
    'port' => '587',
    'username' => 'your@email.com',
    'password' => 'your-mail-password',
    'encryption' => 'tls',
    'from_address' => 'your@email.com',
    'from_name' => 'Your App Name'
];
πŸ’‘ Tip: Use services like Mailtrap for development and SMTP credentials from your host or provider (like Gmail, SendGrid, etc.) in production.
⚠️ Security Note: Never commit real passwords or API keys to version control. Consider setting up dynamic config loading or keeping sensitive files excluded from Git using .gitignore.
;