# Onboarding — Coding Standard > **Terakhir Diperbarui:** 2026-06-29 --- ## PHP / Laravel (geonet-console) - **Service Layer wajib** — logic bisnis di `app/Services/`, bukan di controller - Controller: validasi → service → return response (tipis) - Gunakan `ApiActor` dari `ApiAuthService` — jangan gunakan `Auth::user()` - Setiap aksi write → `AuditLogService::log()` - Response mengikuti format di `docapi/common-response.md` - Error mengikuti format di `docapi/common-error.md` --- ## Database - Driver default: **PostgreSQL** (`pgsql`) — jangan ubah ke sqlite - Migration: `database/migrations/` — jalankan otomatis via entrypoint - Nama tabel: `snake_case` plural (`ldap_user_meta`, `service_tokens`) - Selalu gunakan connection name eksplisit untuk non-default DB --- ## PowerShell Scripts - Gunakan `Start-Process -FilePath "cmd.exe"` untuk pipe SSH (bukan heredoc) - Jangan gunakan `&&` — gunakan `;` sebagai separator di PowerShell - SSH flag wajib: `-m hmac-sha1` untuk semua server (kecuali QNAP/Ollama yang pakai key terpisah) --- ## Commit Convention ``` : ``` | Type | Kapan | |------|-------| | `feat` | Fitur baru | | `fix` | Bug fix | | `api` | Perubahan/tambah endpoint | | `db` | Migration atau perubahan DB | | `infra` | Nginx, Docker, scripts | | `docs` | Dokumentasi | | `chore` | Config, deps | --- ## Aturan Dokumentasi - Tambah endpoint baru → update `geonet-console/docapi/index.md` - Buat file dokumentasi di `geonet-console/docapi/services//` - Perubahan arsitektur → update `docs/architecture/` + buat ADR baru - Akhir sesi → update `perintah.md` (Sync terakhir) --- ## Naming Convention | Tipe | Konvensi | |------|----------| | PHP Class | `PascalCase` | | PHP method | `camelCase` | | DB tabel | `snake_case_plural` | | Route | `/kebab-case` | | Env var | `UPPER_SNAKE_CASE` | | Script | `verb-noun.ps1` | | Doc file | `kebab-case.md` |