To run this project you need to have the following installed:
- Go version 1.20
- Docker version 20
- Docker Compose version 1.29
- GNU Make
http://localhost:54321/swagger/index.html
To start working, execute
go get .
To run the project, run the following command:
go run main.go
You should be able to access the API at http://localhost:54321
To run the project, run the following command:
docker-compose up -d
To run the project, run the following command:
make swag
You should be able to access the API at http://localhost:54321/swagger/index.html
│── constant
│ └── constant.go
├── docs
│ └── swagger.json
│ └── swagger.yaml
└── database
│ └── migrate_sql.go
│ └── mysql.go
│ └── postgres.go
├── pkg
│ └── gin.go
│ └── jwt.go
│ └── smtp.go
└── docker
│ └── swagger
│ │ └── Dockerfile
│ │ └── openapi.yml
│ └── mysql
│ │ └── Dockerfile
│ │ └── mysql.cnf
│ └── golang
│ │ └── Dockerfile
├── module
│ └── auth
│ │ └── entity
│ │ │ └── auth.go
│ │ └── repository
│ │ │ └── auth.go
│ │ └── usecase
│ │ │ └── auth.go
│ │ └── controller
│ │ │ └── auth.go
│ │ └── interface.go
│ └── user
│ │ └── entity
│ │ │ └── user.go
│ │ └── repository
│ │ │ └── user.go
│ │ └── usecase
│ │ │ └── user.go
│ │ └── controller
│ │ │ └── user.go
│ │ └── interface.go
└── presentation
│ └── server
│ │ └── server.go
└── dto
│ └── auth.go
│ └── user.go
└── util
│ └── helper.go
│ └── random.go
Folder Name | Description |
---|---|
entity | Kumpulan struct yang menggambarkan struktur data di table database atau dari data external. |
Folder Name | Description |
---|---|
controller | Kumpulan fungsi yang digunakan untuk menghandle semua request yang di kirimkan dari client melalui routing, dimana nanti requestnya tersebut akan di teruskan ke layer usecase dan layer repository untuk di proses lebih lanjut, yang nanti nya akan digunakan untuk aplikasi itu sendiri. |
Folder Name | Description |
---|---|
Repositorys | *Kumpulan fungsi yang digunakan untuk mengambil atau mengirim data. sumber nya bisa dari database, Rest API dll * |
Folder Name | Description |
---|---|
usecase | Kumpulan fungsi yang berisi logic bisnis |
Folder Name | Description |
---|---|
dto | Kumpulan Object yang digunakan untuk merepresentasikan structure request yang di inginkan, sesuai dengan request yang di perlukan oleh database, yang nanti nya akan digunakan untuk aplikasi itu sendiri. |