You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.9 KiB
1.9 KiB
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
ApiActordariApiAuthService— jangan gunakanAuth::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_caseplural (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-sha1untuk semua server (kecuali QNAP/Ollama yang pakai key terpisah)
Commit Convention
<type>: <deskripsi>
| 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/<service>/ - 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 |