This project combines Laravel as the backend framework with Reverb for websocket server. Follow the instructions below to set up and run the project.
- PHP (>= 8.2)
- Composer
- Node.js (>= 18.x)
- npm (comes with Node.js)
- MySQL or another database of your choice
- Redis for QUEUE driver
-
Clone the repository:
https://github.com/imsat/barikoi-test.git
-
Install Laravel dependencies:
composer install
-
Install Laravel dependencies:
cp .env.example .env
-
Update the database configuration in the .env file:
DB_CONNECTION=mysql DB_HOST=your_database_host DB_PORT=your_database_port DB_DATABASE=your_database_name DB_USERNAME=your_database_username DB_PASSWORD=your_database_password
-
Generate the application key:
php artisan key:generate
-
Generate the JWT secret:
php artisan jwt:secret
-
Run database migrations and seed data:
php artisan migrate --seed
-
Update your Redis configuration in the .env file:
REDIS_CLIENT=phpredis REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379
-
Update your Laravel Reverb configuration in the .env file:
REVERB_APP_ID=634432 REVERB_APP_KEY=fgqyraal4g6fdjoszbwi REVERB_APP_SECRET=eu8udabmbg4turcywt0g REVERB_HOST="localhost" REVERB_PORT=8080 REVERB_SCHEME=http
-
Run this command for start websocket server:
php artisan reverb:start
-
Run this command for queue process:
php artisan queue:work
- Run the Laravel development server:
php artisan serve
- Access the application in your browser:
Open your browser and navigate to http://127.0.0.1:8000 or desired port show in your terminal.