{"id":45253158,"url":"https://github.com/wesionaryteam/go_clean_architecture","last_synced_at":"2026-02-20T23:03:16.706Z","repository":{"id":37101073,"uuid":"274318569","full_name":"wesionaryTEAM/go_clean_architecture","owner":"wesionaryTEAM","description":"Go Clean Architecture Used at @wesionaryteam","archived":false,"fork":false,"pushed_at":"2025-11-04T11:00:44.000Z","size":50848,"stargazers_count":146,"open_issues_count":15,"forks_count":25,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2025-11-04T12:19:47.655Z","etag":null,"topics":["clean-architecture","fx","gin","go","golang","gorm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wesionaryTEAM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-23T05:39:00.000Z","updated_at":"2025-06-24T11:39:12.000Z","dependencies_parsed_at":"2024-01-02T10:47:50.016Z","dependency_job_id":"6f24e39c-ab1f-4041-bb67-0651938d2015","html_url":"https://github.com/wesionaryTEAM/go_clean_architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/wesionaryTEAM/go_clean_architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesionaryTEAM%2Fgo_clean_architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesionaryTEAM%2Fgo_clean_architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesionaryTEAM%2Fgo_clean_architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesionaryTEAM%2Fgo_clean_architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wesionaryTEAM","download_url":"https://codeload.github.com/wesionaryTEAM/go_clean_architecture/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesionaryTEAM%2Fgo_clean_architecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","fx","gin","go","golang","gorm"],"created_at":"2026-02-20T23:03:09.290Z","updated_at":"2026-02-20T23:03:16.701Z","avatar_url":"https://github.com/wesionaryTEAM.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Clean Architecture\n\nClean Architecture with [Gin Web Framework](https://github.com/gin-gonic/gin)\n\n## Features :star:\n\n-   Clean Architecture written in Go\n-   Application backbone with [Gin Web Framework](https://github.com/gin-gonic/gin)\n-   Dependency injection using [uber-go/fx](https://pkg.go.dev/go.uber.org/fx)\n-   Uses fully featured [GORM](https://gorm.io/index.html)\n\n## Linter setup\n\nNeed [Python3](https://www.python.org/) to setup linter in git pre-commit hook.\n\n```zsh\nmake lint-setup\n```\n\n---\n\n## Run application\n\n-   Setup environment variables\n\n```zsh\ncp .env.example .env\n```\n\n-   Update your database credentials environment variables in `.env` file\n-   Update `STORAGE_BUCKET_NAME` in `.env` with your AWS S3 bucket name.\n\n### Locally\n\n-   Run `go run main.go app:serve` to start the server.\n-   There are other commands available as well. You can run `go run main.go -help` to know about other commands available.\n\n### Using `Docker`\n\n\u003e Ensure Docker is already installed in the machine.\n\n-   Start server using command `docker-compose up -d` or `sudo docker-compose up -d` if there are permission issues.\n\n---\n\n## Folder Structure :file_folder:\n\n| Folder Path                      | Description                                                                                            |\n| -------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| `/bootstrap`                     | Contains modules required to start the application.                                                    |\n| `/console`                       | Server commands; run `go run main.go -help` for all available commands.                                |\n| `/docker`                        | Docker files required for `docker-compose`.                                                            |\n| `/docs`                          | Contains project documentation.                                                                        |\n| `/domain`                        | Contains models, constants, and a folder for each domain with controller, repository, routes, and services. |\n| `/domain/constants`              | Global application constants.                                                                          |\n| `/domain/models`                 | ORM models.                                                                                            |\n| `/domain/\u003cname\u003e`                 | Controller, repository, routes, and service for a domain (e.g., `user` is a domain in this template).  |\n| `/hooks`                         | Git hooks.                                                                                             |\n| `/migrations`                    | Database migration files managed by Atlas.                                                             |\n| `/pkg`                           | Contains shared packages for errors, framework utilities, infrastructure, middlewares, responses, services, types, and utils. |\n| `/pkg/errorz`                    | Defines custom error types and handlers for the application.                                           |\n| `/pkg/framework`                 | Core framework components like environment variable parsing, logger setup, etc.                        |\n| `/pkg/infrastructure`            | Setup for third-party service connections (e.g., AWS, database, router).                               |\n| `/pkg/middlewares`               | HTTP request middlewares used in the application.                                                        |\n| `/pkg/responses`                 | Defines standardized HTTP response structures and error handling.                                        |\n| `/pkg/services`                  | Shared application services or clients for external services (e.g., Cognito, S3, SES).                 |\n| `/pkg/types`                     | Custom data types used throughout the application.                                                       |\n| `/pkg/utils`                     | Global utility and helper functions.                                                                   |\n| `/seeds`                         | Seed data for database tables.                                                                         |\n| `/tests`                         | Application tests (unit, integration, etc.).                                                           |\n| `.env.example`                   | sample environment variables                                                                           |\n| `docker-compose.yml`             | `docker compose` file for service application via `Docker`                                             |\n| `main.go`                        | entry-point of the server                                                                              |\n| `Makefile`                       | stores frequently used commands; can be invoked using `make` command                                   |\n\n---\n\n## 🚀 Running Migrations\n\nThis project uses [Atlas](https://atlasgo.io/) for database schema migrations. Atlas enables declarative, versioned, and diff-based schema changes.\n\n---\n\n### 🧰 Prerequisites\n\nMake sure you have the following set up:\n\n- **Atlas CLI**: Install Atlas by running:\n\n  ```sh\n  curl -sSf https://atlasgo.sh | sh\n  ```\n\n  \u003e For other installation methods or details, visit the [official installation guide](https://atlasgo.io/getting-started/installation).\n\n- **`.env` file** at the project root with the following environment variables:\n\n  ```env\n  DB_USER=root\n  DB_PASS=secret\n  DB_NAME=exampledb\n  DB_FORWARD_PORT=3306\n  ```\n\n---\n\n### 📦 Available Migration Commands\n\nBelow are the supported `make` commands for managing database migrations:\n\n| Make Command          | Description                                                                 |\n| --------------------- | --------------------------------------------------------------------------- |\n| `make migrate-status` | Show the current migration status                                           |\n| `make migrate-diff`   | Generate a new migration by comparing models to the current DB (`gorm` env) |\n| `make migrate-apply`  | Apply all pending migrations                                                |\n| `make migrate-down`   | Roll back the most recent migration (`gorm` env)                            |\n| `make migrate-hash`   | Hash migration files for integrity checking                                 |\n\n---\n\n📚 For more on schema management and best practices, refer to the [Atlas documentation](https://atlasgo.io).\n\n## Testing\n\nThe framework comes with unit and integration testing support out of the box. You can check examples written in tests directory.\n\nTo run the test just run:\n\n```zsh\ngo test ./... -v\n```\n\n### For test coverage\n\n```zsh\ngo test ./... -v -coverprofile cover.txt -coverpkg=./...\ngo tool cover -html=cover.txt -o index.html\n```\n\n### Update Dependencies\nSee [UPDATING_DEPENDENCIES.md](./UPDATING_DEPENDENCIES.md) file for more information on how to update project dependencies.\n\n\n\n\n### Contribute 👩‍💻🧑‍💻\n\nWe are happy that you are looking to improve go clean architecture. Please check out the [contributing guide](contributing.md)\n\nEven if you are not able to make contributions via code, please don't hesitate to file bugs or feature requests that needs to be implemented to solve your use case.\n\n### Authors\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/wesionaryTEAM/go_clean_architecture/graphs/contributors\"\u003e\n        \u003cimg src=\"https://contrib.rocks/image?repo=wesionaryTEAM/go_clean_architecture\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesionaryteam%2Fgo_clean_architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwesionaryteam%2Fgo_clean_architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesionaryteam%2Fgo_clean_architecture/lists"}