Appearance
Local installation
Installation
To install the application first run:
bash
composer install
Also, you need to create a database and execute migrations:
bash
php artisan key:generate --force
php artisan migrate --seed
Then, install extensions for image processing.
bash
brew install jpegoptim
brew install optipng
brew install pngquant
brew install svgo
brew install gifsicle
bash
sudo apt install jpegoptim optipng pngquant gifsicle
npm install -g svgo
Environment variables
Copy .env.example to .env and fill in the required values:
APP_*- application settings (do not forget to set APP_URL)DB_*- database connection details
If you want to use image optimization, you need to set the following variables:
IMAGE_OPTIMIZATION_ENABLED- set totrue
GPU api key
Application uses GPU api to process images. You should obtain the API key from our GPU platform and set it in the .env file:
bash
BACKEND_API_TOKEN=<token>
Queue
To run the queue, you need to add the following command:
bash
* * * * * php /path/to/artisan queue:work --queue=default
If you would like to optimize images, you need to run this command instead of the previous one:
bash
* * * * * php /path/to/artisan queue:work --queue=default,media-processing
Ngrok installation
Your application should be available on the Internet. To do this, you can use ngrok.
After installing ngrok, run the following command:
php
php artisan serve --host=9080
Then run Ngrok by the following command:
bash
ngrok http 9080
Environment variables
Also do not forget to set APP_URL in the .env file.