{"id":23061872,"url":"https://github.com/gs1068/golang-ddd-sample","last_synced_at":"2025-08-17T21:17:46.800Z","repository":{"id":65184154,"uuid":"468576585","full_name":"gs1068/golang-ddd-sample","owner":"gs1068","description":"Golang clean architecture sample APP","archived":false,"fork":false,"pushed_at":"2024-02-01T02:23:55.000Z","size":29355,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T06:24:43.119Z","etag":null,"topics":["clean-architecture","ddd","golang","gomock","gotest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gs1068.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-11T02:11:16.000Z","updated_at":"2024-06-04T00:21:42.000Z","dependencies_parsed_at":"2024-02-01T03:49:37.777Z","dependency_job_id":null,"html_url":"https://github.com/gs1068/golang-ddd-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Fgolang-ddd-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Fgolang-ddd-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Fgolang-ddd-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs1068%2Fgolang-ddd-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gs1068","download_url":"https://codeload.github.com/gs1068/golang-ddd-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229901972,"owners_count":18141802,"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","ddd","golang","gomock","gotest"],"created_at":"2024-12-16T03:18:40.370Z","updated_at":"2024-12-16T03:18:40.892Z","avatar_url":"https://github.com/gs1068.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang DDD Sample\n\nuse DDD Architecture\n\n## interface\n\nクライアントからのリクエストを受け取る。\nusecase 層からのレスポンスをユーザーに返す。\nリクエストやレスポンスが変わってもここだけ修正すれば済むようになる\n\n## usecase\n\ninterface 層からのリクエストを捌く。（参照、保存、削除など）\n基本的に domain の repository を介してアクセスすることで、domain 層に依存させる\n\n## domain\n\nDDD の中心となる部分。\nドメインのルールやデータの加工を担う。\ndomain 層には技術的な関心ごとを実装しな\n　 →DB の種類、ORM など\n\n## infrastructure\n\n技術基盤へのアクセス。\nデータを永続化するために DB の操作などを担う。\nDB や ORM の種類が変更されてもこの層のみの変更で対応できるように実装する\n\n# File Tree\n\n```\nsrc\n├── api(mainファイル)\n│   └── main.go\n├── config\n│   └── database.go\n├── domain(中心となる部分)\n│   ├── model:構造体やモデルがどんなものかが書かれる\n│   │   └── user.go\n│   └── repository:DBとのやりとりやCRUDが書かれる\n│       └── user.go\n├── infra\n│   └── user.go\n├── interface\n│   ├── handler\n│   │   └── user.go\n│   └── router\n│       └── user.go\n└── usecase\n    └── user.go\n```\n\n# Requirement\n\n- Golagn 1.16\n  - Echo\n  - Gorm\n\n# Installation\n\nDocker コンテナ立ち上げ\n\n```bash\ndocker-compose build\ndocker-compose up -d\n```\n\nDatabase 立ち上げと Seed 作成\n\n```bash\nmake remake\nmake migrate\n```\n\n# Usage\n\nEcho サーバー立ち上げ(fresh によるホットリロードが効くためファイル変更時に立ち上げ直す必要なし)\n\n```bash\nmake main\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgs1068%2Fgolang-ddd-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgs1068%2Fgolang-ddd-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgs1068%2Fgolang-ddd-sample/lists"}