# ๐Ÿš€ Quick Start Guide - API Classification Panduan cepat untuk menjalankan sistem API klasifikasi penyakit padi. --- ## โšก 5 Menit Setup ### Terminal 1: Jalankan Python API Server ```bash cd "YOUR_PROJECT_PATH\rice leaf diseases dataset" # Install dependencies (hanya sekali) pip install -r requirements_api.txt # Jalankan server python api_server.py ``` **Expected Output:** ``` ============================================================ Rice Leaf Disease Classification API Server ============================================================ โœ“ Model ditemukan: rice_leaf_disease_model.keras โœ“ Model berhasil dimuat! Server berjalan di http://127.0.0.1:5000/ ``` --- ### Terminal 2: Jalankan Laravel Server ```bash cd "YOUR_PROJECT_PATH\web_TA" # Install dependencies (hanya sekali) composer install # Setup environment copy .env.example .env php artisan key:generate # Jalankan server php artisan serve ``` **Expected Output:** ``` INFO Server running on [http://127.0.0.1:8000]. ``` --- ### Terminal 3: Test API ```bash cd "YOUR_PROJECT_PATH" # Test connections python test_api.py ``` --- ## ๐Ÿ“ก API Endpoints Quick Reference ### Test Connection ```bash GET http://127.0.0.1:8000/api/classification/test ``` ### Classify Image ```bash POST http://127.0.0.1:8000/api/classification/classify Content: image file (multipart/form-data) Response: { "success": true, "data": { "predicted_class": "Bacterialblight", "confidence": "95.23%", "disease_info": {...} } } ``` ### Classify & Save ```bash POST http://127.0.0.1:8000/api/classification/classify-and-save Content: image file + optional notes Response: Same as above + image_path ``` --- ## ๐Ÿงช Test dengan cURL ```bash # Test koneksi curl -X GET http://127.0.0.1:8000/api/classification/test # Classify image curl -X POST http://127.0.0.1:8000/api/classification/classify \ -F "image=@C:/path/to/image.jpg" ``` --- ## ๐Ÿ› Troubleshooting | Problem | Solution | |---------|----------| | **"Tidak dapat menghubungi model API"** | Pastikan Terminal 1 (Python API) berjalan | | **"Model tidak ditemukan"** | Cek file `.keras` atau `.h5` ada di folder dataset | | **"Connection refused"** | Pastikan port 5000 & 8000 tidak digunakan program lain | | **"CORS Error"** | Flask API sudah dikonfigurasi CORS, tapi jika masih error reload page | --- ## ๐Ÿ“ File Structure ``` PROJECT TA/ โ”œโ”€โ”€ SETUP_GUIDE.md โ† Panduan lengkap โ”œโ”€โ”€ FLUTTER_INTEGRATION.md โ† Integrasi Mobile โ”œโ”€โ”€ setup.bat โ† Setup otomatis Windows โ”œโ”€โ”€ test_api.py โ† Test script โ”‚ โ”œโ”€โ”€ rice leaf diseases dataset/ โ”‚ โ”œโ”€โ”€ api_server.py โ† Flask API Server โญ โ”‚ โ”œโ”€โ”€ requirements_api.txt โ† Python dependencies โ”‚ โ”œโ”€โ”€ rice_leaf_disease_model.keras โ† Model CNN โ”‚ โ””โ”€โ”€ (gambar dataset) โ”‚ โ””โ”€โ”€ web_TA/ โ”œโ”€โ”€ app/Http/Controllers/ โ”‚ โ””โ”€โ”€ ClassificationController.php โ† API Controller โญ โ””โ”€โ”€ routes/ โ””โ”€โ”€ api.php โ† API Routes โญ ``` --- ## ๐ŸŽฏ Next Steps 1. โœ… Run Python API 2. โœ… Run Laravel Server 3. โœ… Test API 4. โžก๏ธ **Create UI** - Buat halaman upload 5. โžก๏ธ **Integrate Mobile** - Hubungkan Flutter app 6. โžก๏ธ **Deploy** - Siapkan untuk production --- ## ๐Ÿ“š Full Documentation - [SETUP_GUIDE.md](SETUP_GUIDE.md) - Panduan lengkap setup - [FLUTTER_INTEGRATION.md](FLUTTER_INTEGRATION.md) - Integrasi Flutter - API Code: [ClassificationController.php](web_TA/app/Http/Controllers/ClassificationController.php) - Python API: [api_server.py](rice%20leaf%20diseases%20dataset/api_server.py) --- **Created:** March 9, 2026 **Status:** Ready to Use โœ