{"id":28766303,"url":"https://github.com/mingpv/clean-go-template","last_synced_at":"2025-08-20T02:13:15.793Z","repository":{"id":294685256,"uuid":"987760056","full_name":"MingPV/clean-go-template","owner":"MingPV","description":"GO Clean Architecture Template ","archived":false,"fork":false,"pushed_at":"2025-08-17T08:20:52.000Z","size":96,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T09:17:24.336Z","etag":null,"topics":["api","clean-architecture","docker","fiber","go","golang","gorm","gotemplate","grpc","rest-api","restful","template"],"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/MingPV.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-21T14:43:26.000Z","updated_at":"2025-08-17T08:19:13.000Z","dependencies_parsed_at":"2025-05-21T15:51:07.357Z","dependency_job_id":"81feaa7d-0801-40f6-b464-1aea879de86e","html_url":"https://github.com/MingPV/clean-go-template","commit_stats":null,"previous_names":["mingpv/clean-go-template"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MingPV/clean-go-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingPV%2Fclean-go-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingPV%2Fclean-go-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingPV%2Fclean-go-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingPV%2Fclean-go-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MingPV","download_url":"https://codeload.github.com/MingPV/clean-go-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingPV%2Fclean-go-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271252993,"owners_count":24726918,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","clean-architecture","docker","fiber","go","golang","gorm","gotemplate","grpc","rest-api","restful","template"],"created_at":"2025-06-17T12:00:49.077Z","updated_at":"2025-08-20T02:13:15.782Z","avatar_url":"https://github.com/MingPV.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clean-go-template\n\u003cdiv\u003e\u003cimg width=\"600\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5ff920c7-eccf-4fa2-8198-3cf2ec2dae6e\" /\u003e\u003c/div\u003e\n\n**go-clean-template** is a clean and scalable starter template for building backend applications in Go, following Clean Architecture principles. This template uses:\n\n- **Fiber v2** as a fast and lightweight web framework for building RESTful APIs \n- **GORM** as the ORM for PostgreSQL database access\n- **Redis** for caching to improve performance and reduce database load\n- **gRPC** for high-performance RPC communication \n- **Docker Compose** for easy setup of PostgreSQL and Redis services\n\n## Features\n\n- Clear separation of concerns with Clean Architecture  \n- High-performance HTTP handling with Fiber v2  \n- Robust database integration using GORM with PostgreSQL  \n- Caching support via Redis\n- REST and gRPC APIs supported \n- Data Transfer Objects (DTO) to manage data structure transformations between layers  \n- Swagger API documentation with automatic generation \n- Ready-to-use Docker Compose setup for dependencies  \n\n## Getting Started\n\nFollow the steps below to set up and run the project:\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/MingPV/clean-go-template.git\n    cd clean-go-template\n    ```\n\n2. Install Go module dependencies:\n\n    ```bash\n    go mod tidy\n    ```\n\n3. Rename the environment file and configure it:\n\n    ```bash\n    cp .env.example .env\n    ```\n\n    Open the `.env` file and fill in all required configuration values such as PostgreSQL credentials, Redis connection details, and any other environment-specific settings.\n\n4. Start PostgreSQL and Redis services using Docker Compose:\n\n    ```bash\n    docker-compose up -d\n    ```\n\n5. Run the application:\n\n    ```bash\n    go run ./cmd/app\n    ```\n\n6. Test:\n\n    ```bash\n    go test ./pkg/routes\n    ```\n\nSwagger UI for the API documentation is available at: localhost:8080/api/v1/docs\n\n\u003cimg width=\"0\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e38ff0e8-8fd1-4d39-baca-af30b85b353a\" /\u003e\n\u003cimg width=\"700\" alt=\"image\" src=\"https://github.com/user-attachments/assets/840f8d43-e07c-44a8-9b7d-3f4d62d912ce\" /\u003e\n\n\n## Project structure\n\n\n```bash\n/clean-go-template\n├── cmd/\n│   └── app/\n│       └── main.go               \n├── docs/\n│   └── v1/                 \n├── internal/               \n│   ├── app/            \n│   ├── entities/\n│   ├── order/\n│   │   ├── handler/\n│   │   │   ├── grpc/\n│   │   │   └── rest/\n│   │   ├── usecase/\n│   │   ├── repository/\n│   │   └── dto/ \n│   └── user/               \n├── pkg/\n│   ├── config/\n│   ├── database/\n│   ├── middleware/\n│   ├── redisclient/\n│   ├── responses/\n│   └── routes/\n├── proto/\n│   └── order/\n├── utils/                \n├── .env.example             \n├── .gitignore               \n├── LICENSE                  \n├── README.md             \n├── docker-compose.yaml      \n└── go.mod\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingpv%2Fclean-go-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingpv%2Fclean-go-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingpv%2Fclean-go-template/lists"}