111 lines
2.8 KiB
Markdown
111 lines
2.8 KiB
Markdown
# ✅ Setup Complete: Desktop → HP Hotspot → Backend
|
|
|
|
## 📊 Konfigurasi Akhir
|
|
|
|
### Network Setup
|
|
| Komponen | IP/Port | Status |
|
|
|----------|---------|--------|
|
|
| **Desktop** | 10.119.236.99 | ✅ Connected ke hotspot HP |
|
|
| **HP Android** | (Hotspot Provider) | ✅ Providing WiFi Hotspot |
|
|
| **Backend Laravel** | 10.119.236.99:8000 | ✅ Running |
|
|
| **Flutter App** | Device ID: dda0f45a | ✅ Building & Deploying |
|
|
|
|
---
|
|
|
|
## 🔧 Apa yang Sudah Dikonfigurasi
|
|
|
|
### 1. Backend Laravel
|
|
**Status:** ✅ Running di port 8000
|
|
```bash
|
|
php artisan serve --host=0.0.0.0 --port=8000
|
|
```
|
|
- Accessible dari: `http://10.119.236.99:8000`
|
|
- Bisa diakses dari HP via hotspot
|
|
|
|
### 2. Flutter App Configuration
|
|
**Files Updated:**
|
|
- ✅ `lib/config/environment.dart` - API Base URL updated ke `http://10.119.236.99:8000`
|
|
- ✅ `lib/config/app_config.dart` - Server URL updated ke `http://10.119.236.99:8000`
|
|
|
|
**API Endpoints:**
|
|
- Base: `http://10.119.236.99:8000/api`
|
|
- Storage: `http://10.119.236.99:8000/storage`
|
|
|
|
### 3. Device Detection
|
|
**Status:** ✅ Device Terdeteksi
|
|
- Device ID: `dda0f45a`
|
|
- Model: M2012K11AG (Xiaomi)
|
|
- ADB Status: Connected & Authorized
|
|
|
|
---
|
|
|
|
## 🚀 Apa yang Sedang Terjadi
|
|
|
|
Flutter app sedang di-build dan di-deploy ke device fisik Anda dengan Gradle.
|
|
|
|
**Build Progress:** `Launching lib\main.dart on M2012K11AG in debug mode`
|
|
|
|
Proses ini biasanya butuh **2-5 menit** untuk first build.
|
|
|
|
---
|
|
|
|
## ✨ Setelah App Berjalan
|
|
|
|
1. **Verifikasi Koneksi**
|
|
- Buka app di HP
|
|
- Cek apakah halaman utama loading data (berarti backend connected)
|
|
- Jika ada error koneksi, lihat bagian Troubleshooting di bawah
|
|
|
|
2. **Lihat Logs** (jika perlu debug)
|
|
```bash
|
|
flutter logs -d dda0f45a
|
|
```
|
|
|
|
3. **Hot Reload** (jika modify code)
|
|
- Tekan `r` di terminal untuk hot reload
|
|
- Tekan `R` untuk hot restart
|
|
- Tekan `q` untuk quit
|
|
|
|
---
|
|
|
|
## 🔍 Troubleshooting
|
|
|
|
### Jika App Crash / Connection Error
|
|
|
|
**Kemungkinan 1: Backend belum bisa diakses dari HP**
|
|
- HP harus terhubung ke hotspot desktop (bukan hotspot HP)
|
|
- Cek: `ipconfig` di desktop harus sama dengan gateway di HP
|
|
- Cek firewall: pastikan port 8000 tidak di-block
|
|
|
|
**Kemungkinan 2: API URL masih lama**
|
|
- Verifikasi di app → Settings/Debug → cek API URL
|
|
- Harus: `http://10.119.236.99:8000`
|
|
|
|
**Kemungkinan 3: Backend crash**
|
|
- Lihat terminal backend di desktop
|
|
- Jika ada error, screenshot dan lapor
|
|
|
|
### Reset Setup
|
|
|
|
Jika perlu restart ulang:
|
|
```bash
|
|
# Stop Flutter app (tekan q di terminal flutter)
|
|
# Stop Backend (Ctrl+C di terminal Laravel)
|
|
# Reconnect HP USB
|
|
# Restart backend dulu
|
|
php artisan serve --host=0.0.0.0 --port=8000
|
|
# Lalu flutter run lagi
|
|
flutter run -d dda0f45a
|
|
```
|
|
|
|
---
|
|
|
|
## 📋 Checklist
|
|
|
|
- ✅ IP Desktop: 10.119.236.99
|
|
- ✅ Backend running: Port 8000
|
|
- ✅ Flutter Config updated: API URL correct
|
|
- ✅ Device detected: dda0f45a
|
|
- ✅ App building & deploying...
|
|
|