docs: perbaiki instruksi instalasi dan troubleshooting di README

This commit is contained in:
ardhikaxx 2026-04-13 20:07:10 +07:00
parent a46431b72a
commit 7574f8984b
1 changed files with 58 additions and 35 deletions

View File

@ -229,63 +229,86 @@ ### 📦 PHP Extensions Required
## 🚀 Instalasi ## 🚀 Instalasi
### 1⃣ Clone Repository ### ⚡ Cara Cepat (Setelah Clone)
```bash
git clone https://github.com/ardhikaxx/banyu-biru-nganjuk.git
cd banyu-biru-nganjuk
```
### 2⃣ Install Dependencies
```bash ```bash
# 1. Masuk ke folder project
cd wisata-web
# 2. Install semua dependencies
composer install composer install
npm install npm install
```
### 3⃣ Konfigurasi Environment # 3. Buat file .env dan generate application key
```bash
cp .env.example .env cp .env.example .env
php artisan key:generate php artisan key:generate
```
Edit file `.env` dan sesuaikan konfigurasi database: # 4. Buat database (via phpMyAdmin atau command)
```env # Windows (XAMPP):
DB_CONNECTION=mysql C:\xampp\mysql\bin\mysql.exe -u root -e "CREATE DATABASE wisata_web CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=wisata_db
DB_USERNAME=root
DB_PASSWORD=
```
### 4⃣ Migrasi Database # 5. Jalankan migrations (tabel sessions sudah termasuk!)
```bash
php artisan migrate php artisan migrate
```
### 5⃣ Seed Data (Opsional) # 6. Seed data (opsional - untuk data awal)
```bash
php artisan db:seed php artisan db:seed
```
### 6⃣ Compile Assets # 7. Compile frontend assets
```bash
npm run build npm run build
# atau untuk development
npm run dev
```
### 7⃣ Storage Link # 8. Buat storage link
```bash
php artisan storage:link php artisan storage:link
```
### 8⃣ Jalankan Server # 9. Jalankan server
```bash
php artisan serve php artisan serve
``` ```
> 🌐 **Akses**: `http://127.0.0.1:8000` > 🌐 **Akses**: `http://127.0.0.1:8000`
### 📝 Catatan Penting
- ✅ **Tabel `sessions` sudah termasuk** dalam migration Laravel default, tidak perlu command tambahan
- ✅ **Cukup jalankan** `php artisan migrate` untuk membuat semua tabel
- ⚠️ **Pastikan database sudah dibuat** di MySQL/phpMyAdmin sebelum menjalankan migration
---
## 🐛 Troubleshooting
### ❌ Error: Table doesn't exist
Jika muncul error seperti `Table 'wisata_web.sessions' doesn't exist`:
```bash
# Hapus dan buat ulang database
C:\xampp\mysql\bin\mysql.exe -u root -e "DROP DATABASE IF EXISTS wisata_web; CREATE DATABASE wisata_web CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
# Jalankan ulang migrations
php artisan migrate:fresh
```
### ❌ Error: Tablespace corrupted
Jika muncul error `Tablespace for table exists. Please DISCARD the tablespace before IMPORT`:
```bash
# Hapus folder database manual (Windows XAMPP)
rmdir /s /q C:\xampp\mysql\data\wisata_web
# Buat database baru
C:\xampp\mysql\bin\mysql.exe -u root -e "CREATE DATABASE wisata_web CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
# Jalankan migrations
php artisan migrate:fresh
```
### ❌ Error: .env file not found
```bash
cp .env.example .env
php artisan key:generate
```
--- ---
## 👤 Default Login ## 👤 Default Login