Check out the amazing AI-generated wiki for more insights:
DeepWiki - Ranking Web Overview
-
Copy the environment configuration file:
cp .env.example .envRecommended: Edit
.envand changeDB_PASSWORDto a secure password before starting the services. -
Start all services:
docker compose up -d --build -
Enter the Laravel container and install PHP dependencies:
docker compose exec laravel.test composer install --no-scripts -
Generate the Laravel application key:
docker compose exec laravel.test php artisan key:generate --ansi -
Run database migrations:
docker compose exec laravel.test php artisan migrate -
Install frontend dependencies and build assets:
docker compose exec laravel.test bash -c "npm install && npm run dev" -
Fix permissions and make sail scripts executable (if needed):
sudo find . -type d -exec chmod 775 {} \; sudo find . -type f -exec chmod 664 {} \; sudo chown -R $USER:$USER . chmod +x vendor/laravel/sail/bin/sail chmod -R +x vendor/bin/* docker compose exec laravel.test php artisan storage:link
Note: If you use Docker installation above, you do not need to install PHP and Composer manually on your host system. This section is only for manual/local installation.
- Install PHP 8.2
# Update package lists
sudo apt update
# Install necessary packages
sudo apt install -y software-properties-common
# Add ondrej/php which has PHP 8.2
sudo add-apt-repository ppa:ondrej/php
# Update package lists
sudo apt update
# Install PHP 8.2
sudo apt install -y php8.2
- Install Composer 2.7
# Download Composer installer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# Install Composer
php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.7.0
# Remove installer
php -r "unlink('composer-setup.php');"
- Run
composer install. If you encounter missing dependencies, use the--ignore-platform-reqsflag. - Run
php artisan sail:installand select (1)mysql, (2)minio, (3)redis, (4)selenium (5)soketi. - Run
./vendor/bin/sail up -dto set up services. - Run
./vendor/bin/sail migrateto set up the database. - Run
./vendor/bin/sail npm install & npm run devto set up static HTML/CSS/JS files. - Start your project at
http://localhost.
Visit localhost:9000 to log in to your Minio account (see docker-compose.yml). You need to create a bucket and generate an access key. Then, put the access key and other Minio configurations in your .env file. (See the following example .env)
# .env
...
# minio configuration example
AWS_ACCESS_KEY_ID=xxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxx
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=xxxxxx
AWS_URL=http://localhost:9000/xxxxxx
AWS_ENDPOINT=http://ranking-web-minio-1:9000
AWS_USE_PATH_STYLE_ENDPOINT=true
After registering, put your API key in the .env file:
YOUTUBE_API_KEY=put_your_api_key_here
After entering the sail shell, run the following scripts to start the queue workers and scheduler in the background:
chmod +x ./start_worker.sh
chmod +x ./start_schedule.sh
./start_worker.sh &
./start_schedule.sh &This will start all queue workers and the Laravel scheduler as background processes.
When you change the code, you have to restart the workers and scheduler:
./start_worker.sh &
./start_schedule.sh &-
You may encounter permission issues when using Docker. Make sure your user is in the Docker group.
sudo usermod -aG docker $USER -
If you encounter file or directory permission issues, you can fix them with:
sudo find . -type d -exec chmod 775 {} \;
sudo find . -type f -exec chmod 664 {} \;
# Change ownership to your user (replace $USER with your username if needed)
sudo chown -R $USER:$USER .