Account ×
Login

StarterLibrary © 2025 All rights reserved

DirectoryPro Leaf Setup Guide

Follow these steps to install Composer, configure the Leaf CLI globally, create your Leaf web application named directorypro, and install the required DirectoryPro app dependencies.

1. Install Composer

If Composer is not already installed, run the following commands:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer -V
          

2. Install and Configure Leaf CLI

Install the Leaf CLI globally:

composer global require leafs/cli
          

Add the Composer global vendor binaries to your PATH (run this once):

echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
          

Verify the Leaf CLI installation:

leaf -V
          

3. Create the Leaf Web Application

Navigate to your web root directory (for example, /var/www/html):

cd /var/www/html
          

Create a new Leaf app named directorypro:

leaf create directorypro
          

Now, navigate into the newly created app directory:

cd /var/www/html/directorypro
          

4. Install DirectoryPro App Dependencies

Within the directorypro app directory, install the required dependencies:

composer require leafs/leaf
composer require lcobucci/jwt firebase/php-jwt
composer require phpmailer/phpmailer
composer require google/apiclient
          

5. Finalize & Test Your Application

Restart your PHP-FPM and web server (adjust the commands as needed):

sudo systemctl restart php-fpm
sudo systemctl restart nginx
          

Start the PHP built-in server to test your application locally:

php -S localhost:5500 -t .
          

Open your browser and visit http://localhost:5500 to see your application in action.