Skip to content

braiyenmassora/lalan-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lalan BE

API for managing outdoor rental operations used by admin, hoster, and customer.

Tech Stack

Field Value
Language Go (1.24.4+)
Database PostgreSQL (via Supabase)
Storage Bucket Supabase Bucket
Payment Gateway Xendit

Getting Started

Clone the project:

git clone https://github.com/braiyenmassora/lalan-be.git

Go to the project directory and install dependencies:

go mod download

Set 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.go

Architecture

lalan-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

Feature Guide

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.

About

Backend API for managing outdoor rental operations via an admin dashboard

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages