{"id":21036468,"url":"https://github.com/moemoe89/go-clean-arch-ratu","last_synced_at":"2026-04-13T05:40:37.697Z","repository":{"id":57709331,"uuid":"237933896","full_name":"moemoe89/go-clean-arch-ratu","owner":"moemoe89","description":"💕 Simple Go Clean Arch by Uncle Bob with MariaDB for database","archived":false,"fork":false,"pushed_at":"2020-06-14T16:06:49.000Z","size":19678,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T16:18:11.763Z","etag":null,"topics":["clean-architecture","codecov","docker","gin","go","golang","goose","mariadb","rest-api","swagger","travis-ci","uncle-bob"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moemoe89.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-03T09:56:40.000Z","updated_at":"2020-06-14T16:06:52.000Z","dependencies_parsed_at":"2022-09-12T22:40:17.379Z","dependency_job_id":null,"html_url":"https://github.com/moemoe89/go-clean-arch-ratu","commit_stats":null,"previous_names":["moemoe89/simple-go-clean-arch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-clean-arch-ratu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-clean-arch-ratu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-clean-arch-ratu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moemoe89%2Fgo-clean-arch-ratu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moemoe89","download_url":"https://codeload.github.com/moemoe89/go-clean-arch-ratu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243476665,"owners_count":20296926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-architecture","codecov","docker","gin","go","golang","goose","mariadb","rest-api","swagger","travis-ci","uncle-bob"],"created_at":"2024-11-19T13:20:11.152Z","updated_at":"2025-12-30T05:46:27.340Z","avatar_url":"https://github.com/moemoe89.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/moemoe89/go-clean-arch-ratu.svg?branch=master)](https://travis-ci.org/moemoe89/go-clean-arch-ratu)\n[![codecov](https://codecov.io/gh/moemoe89/go-clean-arch-ratu/branch/master/graph/badge.svg)](https://codecov.io/gh/moemoe89/go-clean-arch-ratu)\n[![Go Report Card](https://goreportcard.com/badge/github.com/moemoe89/go-clean-arch-ratu)](https://goreportcard.com/report/github.com/moemoe89/go-clean-arch-ratu)\n\n# GO-CLEAN-ARCH-RATU #\n\nSimple Go Clean Arch Using Golang (Gin Gonic Framework) as Programming Language, MariaDB as Database\n\n## Directory structure\nYour project directory structure should look like this\n```\n  + your_gopath/\n  |\n  +--+ src/github.com/moemoe89\n  |  |\n  |  +--+ go-clean-arch-ratu/\n  |     |\n  |     +--+ main.go\n  |        + api/\n  |        + routers/\n  |        + ... any other source code\n  |\n  +--+ bin/\n  |  |\n  |  +-- ... executable file\n  |\n  +--+ pkg/\n     |\n     +-- ... all dependency_library required\n\n```\n\n## Setup and Build\n\n* Setup Golang \u003chttps://golang.org/\u003e\n* Setup MariaDB \u003chttps://www.mariadb.org/\u003e\n* Under `$GOPATH`, do the following command :\n```\n$ mkdir -p src/github.com/moemoe89\n$ cd src/github.com/moemoe89\n$ git clone \u003curl\u003e\n$ mv \u003ccloned directory\u003e go-clean-arch-ratu\n```\n\n## Running Migration\n* Copy `config-sample.json` to `config.json` and changes the value based on your configurations.\n* Create MySQL database for example named `simple_api` and do migration with `Goose` \u003chttps://bitbucket.org/liamstask/goose/\u003e\n* Change database configuration on dbconf.yml like `dialect` and `dsn` for each environtment\n* Do the following command\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ goose -env=development up\n```\n\n## Documetation with Swagger\nFor open swagger access via browser\n```\n{{url}}/swagger/index.html\n```\nFor updating swagger\n```\n$ swag init\n```\n\n## Running Application with Makefile\nMake config file for local :\n```\n$ cp config-sample.json config-local.json\n```\nBuild\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ make build\n```\nRun\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ make run\n```\nStop\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ make stop\n```\nMake config file for docker :\n```\n$ cp config-sample.json config-docker.json\n```\nDocker Build\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ make docker-build\n```\nDocker Up\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ make docker-up\n```\nDocker Down\n```\n$ cd $GOPATH/src/github.com/moemoe89/go-clean-arch-ratu\n$ make docker-down\n```\n\n## How to Run with Docker\nMake config file for docker :\n```\n$ cp config-sample.json config.json\n```\nBuild\n```\n$ docker-compose build\n```\nRun\n```\n$ docker-compose up\n```\nStop\n```\n$ docker-compose down\n```\n\n## How to Run Unit Test\nRun\n```\n$ go test ./...\n```\nRun with cover\n```\n$ go test ./... -cover\n```\nRun with HTML output\n```\n$ go test ./... -coverprofile=c.out \u0026\u0026 go tool cover -html=c.out\n```\n\n## Reference\n\nThanks to this medium [link](https://medium.com/golangid/mencoba-golang-clean-architecture-c2462f355f41) for sharing the great article\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoemoe89%2Fgo-clean-arch-ratu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoemoe89%2Fgo-clean-arch-ratu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoemoe89%2Fgo-clean-arch-ratu/lists"}