# Usage icon

search or pick icon in <a href="https://icon-sets.iconify.design/mingcute/?keyword=mingcute">here</a>

# Set up queue for running automatically

-   Install Supervisor

```
sudo apt update && sudo apt install supervisor -y
```

-   Create Supervisor Config

```
sudo nano /etc/supervisor/conf.d/laravel-worker.conf

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/arifal/development/sibedas-pbg-web/artisan queue:work --queue=default --timeout=82800 --tries=1
autostart=true
autorestart=true
numprocs=1
redirect_stderr=true
stdout_logfile=/home/arifal/development/sibedas-pbg-web/storage/logs/worker.log
stopasgroup=true
killasgroup=true
```

-   Reload Supervisor

```
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker
sudo supervisorctl restart laravel-worker
sudo supervisorctl status
```

# How to running

-   Install composer package

```
composer install
```

-   Install npm package

```
npm install && npm run build
```

-   Create symlinks storage

```
php artisan storage:link
```

-   Running migration

```
php artisan migrate
```

-   Running seeder

```
php artisan db:seed
```

-   Create view table
-   excute all sql queries on folder database/view_query

# Add ENV variable

-   API_KEY_GOOGLE

```
Get api key from google developer console for and turn on spreadsheet api or feaature for google sheet
```

-   SPREAD_SHEET_ID

```
Get spreadsheet id from google sheet link
```

-   OPENAI_API_KEY

```
Get OpenAI API key from chatgpt subscription
```

-   ENV

```

API_KEY_GOOGLE="xxxxx"
SPREAD_SHEET_ID="xxxxx"
OPENAI_API_KEY="xxxxx"

```

# Technology version

-   php 8.3
-   Laravel 11
-   node v22.13.0
-   npm 10.9.2
-   mariadb Ver 15.1 Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
-   Ubuntu 24.04
