Deploy

Server requirements

Depend on laravel version, now its 9.11.0 so you can check this official documentation - if laravel version updated - we'll update this page.

Requirements to run the project:

  • php: 8.0+
  • nodejs: v16.20.0 LTS (https://github.com/nvm-sh/nvm)
  • MySQL: 5.7+ (documentation)

Requirements to build the frontends:

npm install -g gulp

Compiling and local/dev start

1. Get project from GitHub
2. Install and compile all necessary scripts and styles
  • Got to folder src
cd ../src/
  • Install packages for assets
npm install
  • Copy qdt-env.sample.js to qdt-env.js or run command gulp init (config file for assets)
cp qdt-env.sample.js qdt-env.js
  • Compile all assets and copy to project
gulp compile
3. Install php components
  • Go to folder php from root
cd ../php/
  • Copy .env.example to .env (config file of project)
cp .env.example .env
  • Copy public/.htaccess.example to public/.htaccess (moved to gitignore for custom setting htpaswrd)
  • Check permissions on folders Docs
  • Run composer install (install all necessary libraries)
composer install
  • Run php artisan key:generate to generate application key for project
php artisan key:generate
  • Configure .env file
  • Create symlink for assets (this has to be done for each environment separately, copying symlink won't work)
php artisan storage:link
  • Now you can migrate database
php artisan migrate 
  • Then run the seeders to fill the db with some predefined data. If you have the dump of the database - skip this.
php artisan db:seed

If everything is filled right in config file - project is ready to run locally or deploy. To run project locally you can run with php artisan serve.

php artisan serve
4. Upload all folders and files from php folder (not from root folder if you don't expect to compile assets via ssh) via FTP or SFTP.
5. Make dump of your database and import it on server.
6. Create symlink for assets php artisan storage:link (run this command on server in root folder of project - you get exception symlink() has been disabled for security reasons - you need to enable this function on server instructions)
7. Also you need to upload icon assets in admin dashboard (section "Icons") for Booking, Linear, Streamline icons.

Thats all if you take project from Github.

Configure ".env" file

1. Set database credentials (DB_ variables, you must create database and fill this variables)
2. Project url (APP_URL, like https://business.booking.com)
3. Mail credentials (MAIL_ variables, create on server and set up here, mailtrap.io - this is default Laravel config file - we don't use it, this must be changed by your mail credentials)
4. MemSource (MEMSOURCE_ variables, webhook token you set in MemSource (explain in MemSource section), username and password for login to MemSource, template UID - get from memsource if you use template for project)
5. Maxmind (MAXMIND_ variables, will add to credentials)
6. Apiflash (APIFLASH_KEY, will add to credentials)

Seeders, dump of database

When starting the website locally we should use the seeders to populate the database. This is scheduled to be updated in issue. Seeders would populate the website with demo data. This does not mean a copy of the website.

Dump of database can be done with command mysqldump -u <user name> -p <database> > <path to file>.

If a copy of the website is desired - we need also a database dump from the server AND a copy with the folder php/storage/app (there are images, some custom css files for icons, files uploaded in admin dashboard, etc.)

SSH

Also you can do all this things on server via ssh - there must be installed all necessary tools like composer, npm.
For composer Laravel documentation doesn't specify the version.

For assets (src folder):

  1. nodejs 16.20.0 LTS
  2. gulp 4
  3. npm 7 or later

In this case you can take all folders from github (php and src) and point as root folder php/public (not like in Compiling section item 4) - so you can compile all assets on server via ssh.

MemSource

Add new webhook url (in memsource dashboard) like <your_domain>/webhooks/memsource/job-status-changed/ (where <your_domain> is current used domain, where you need memsource, https://business.booking.com for example) with trailing slash or not - how your project is configured, this is important. This webhook url you can set up on this page