API for managing outdoor rental operations used by admin, hoster, and customer.
| Field | Value |
|---|---|
| Language | Go (1.24.4+) |
| Database | PostgreSQL (via Supabase) |
| Storage Bucket | Supabase Bucket |
| Payment Gateway | Xendit |
Clone the project:
git clone https://github.com/braiyenmassora/lalan-be.gitGo to the project directory and install dependencies:
go mod downloadSet up .env.dev:
# App base
APP_ENV=
APP_PORT=
# JWT
JWT_SECRET=
# Redis
REDIS_URL=
# CORS
ALLOWED_ORIGIN_DEV=
ALLOWED_ORIGIN_STAGING=
# Database
DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=
# Storage
STORAGE_ACCESS_KEY=
STORAGE_SECRET_KEY=
STORAGE_ENDPOINT=
STORAGE_REGION=
STORAGE_PROJECT_ID=
STORAGE_DOMAIN=
# hoster
STORAGE_CUSTOMER_BUCKET=
STORAGE_HOSTER_BUCKET=
Start the server:
make dev
# or
go run ./cmd/main.golalan-be/
├── cmd/ # entrypoint (main.go)
├── internal/
│ ├── config/ # configuration (DB, env, redis)
│ ├── domain/ # entity / model DB (single source of truth)
│ ├── dto/ # request & response DTO (API contracts)
│ ├── features/ # vertical slices (per actor / feature)
│ │ ├── admin/
│ │ ├── auth/
│ │ ├── customer/
│ │ ├── hoster/
│ │ └── public/
│ ├── middleware/ # auth, logging, CORS, etc
│ ├── response/ # standard API response
│ └── utils/ # helper (upload, time, etc)
├── migrations/ # SQL migrations
└── .env.dev
| Step | Description |
|---|---|
| 1 | Definisikan model di internal/domain jika membutuhkan tabel baru. |
| 2 | Buat DTO untuk request/response di internal/dto/ untuk menjaga kontrak API. |
| 3 | Buat folder fitur: internal/features/[actor]/[feature]/ dengan minimal file: handler.go (HTTP layer), service.go (business logic), repository.go (data access), route.go (endpoint registration). |
| 4 | Tambahkan migrasi SQL di migrations/ bila perlu. |
| 5 | Sertakan tes dan dokumentasi endpoint saat menyelesaikan fitur. |