docs: Add deployment guide dan fix vendor installation instructions
This commit is contained in:
50
README.md
50
README.md
@@ -20,6 +20,8 @@ Sistem API Retribusi berbasis Slim Framework 4 dengan arsitektur modular untuk i
|
||||
|
||||
## 🔧 Installation
|
||||
|
||||
### Development
|
||||
|
||||
1. Clone repository:
|
||||
```bash
|
||||
git clone https://git.btekno.cloud/kangmin/api-btekno.git
|
||||
@@ -44,10 +46,50 @@ mysql -u your_user -p your_database < migrations/002_create_hourly_summary.sql
|
||||
mysql -u your_user -p your_database < migrations/003_create_realtime_events.sql
|
||||
```
|
||||
|
||||
5. Setup web server:
|
||||
- DocumentRoot: `public/`
|
||||
- PHP 8.2+
|
||||
- Enable mod_rewrite (Apache) atau nginx config
|
||||
### Production Deployment (aaPanel)
|
||||
|
||||
**PENTING: Vendor folder TIDAK di-commit ke git. Harus di-install di server!**
|
||||
|
||||
1. Clone atau pull repository:
|
||||
```bash
|
||||
cd /www/wwwroot/api.btekno.cloud/api
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
2. **WAJIB: Install dependencies** (ini yang menyebabkan error jika di-skip):
|
||||
```bash
|
||||
composer install --no-dev --optimize-autoloader
|
||||
```
|
||||
|
||||
3. Setup environment:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
nano .env # Edit dengan konfigurasi production
|
||||
```
|
||||
|
||||
4. Apply migrations (jika belum):
|
||||
```bash
|
||||
mysql -u sql_retribusi -p sql_retribusi < migrations/001_create_audit_logs.sql
|
||||
mysql -u sql_retribusi -p sql_retribusi < migrations/002_create_hourly_summary.sql
|
||||
mysql -u sql_retribusi -p sql_retribusi < migrations/003_create_realtime_events.sql
|
||||
```
|
||||
|
||||
5. Setup web server (aaPanel):
|
||||
- DocumentRoot: `/www/wwwroot/api.btekno.cloud/api/public`
|
||||
- PHP Version: 8.2 atau 8.3
|
||||
- Enable rewrite rules
|
||||
|
||||
6. Set permissions:
|
||||
```bash
|
||||
chown -R www:www /www/wwwroot/api.btekno.cloud/api
|
||||
chmod -R 755 /www/wwwroot/api.btekno.cloud/api
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
**Error: vendor/autoload.php not found**
|
||||
- **Solusi**: Jalankan `composer install --no-dev --optimize-autoloader` di server
|
||||
- Vendor folder tidak di-commit ke git, harus di-install manual di setiap environment
|
||||
|
||||
## 📁 Struktur Project
|
||||
|
||||
|
||||
Reference in New Issue
Block a user