.PHONY: setup test serve migrate queue monitor clear optimize status

setup:
	composer install
	cp -n .env.example .env || true
	php artisan key:generate
	php artisan migrate --force

test:
	php artisan test

serve:
	php artisan serve --host=0.0.0.0 --port=8000

migrate:
	php artisan migrate

queue:
	php artisan queue:work redis --queue=default,embeddings --tries=5 --timeout=600

monitor:
	php artisan queue:monitor redis:default,embeddings

clear:
	php artisan config:clear
	php artisan route:clear
	php artisan cache:clear
	php artisan view:clear

optimize:
	php artisan config:cache
	php artisan route:cache

status:
	curl -s http://127.0.0.1:8000/api/health | json_pp || curl -s http://127.0.0.1:8000/api/health
