# Server Setup Commands for SPGA Project

# 1. Install PHP dependencies
composer install --optimize-autoloader --no-dev

# 2. Set proper permissions (Linux/Mac)
chmod -R 755 storage/
chmod -R 755 bootstrap/cache/

# 3. Generate application key (if not in .env)
php artisan key:generate

# 4. Clear all caches
php artisan config:clear
php artisan route:clear
php artisan view:clear

# 5. Cache for production (optional but recommended)
php artisan config:cache
php artisan route:cache
php artisan view:cache

# 6. Create storage link (if using file storage)
php artisan storage:link

# 7. Run migrations (if using Option 2 for database)
php artisan migrate

# 8. Run seeders (if using Option 2 for database)
php artisan db:seed

# 9. Set proper file permissions for web server
# For Apache: make sure web server can read all files
# For Nginx: ensure proper ownership and permissions