{"id":29040399,"url":"https://github.com/hoyirul/go-starter-kit","last_synced_at":"2026-04-11T13:02:28.484Z","repository":{"id":296719653,"uuid":"993835056","full_name":"hoyirul/go-starter-kit","owner":"hoyirul","description":"This repository provides a basic structure and setup for creating RESTful APIs in Go, utilizing the Gin web framework and Gorm ORM for database interactions.","archived":false,"fork":false,"pushed_at":"2025-06-02T03:12:42.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-23T10:53:32.732Z","etag":null,"topics":["gin","gin-gonic","golang","gorm","jwt","mssql","mysql","postgres","sql"],"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/hoyirul.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,"zenodo":null}},"created_at":"2025-05-31T16:15:42.000Z","updated_at":"2025-06-02T03:14:23.000Z","dependencies_parsed_at":"2025-06-02T00:53:53.564Z","dependency_job_id":"b16bcfda-f81f-40ac-8804-ce321a0f05e6","html_url":"https://github.com/hoyirul/go-starter-kit","commit_stats":null,"previous_names":["hoyirul/go-starter-kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hoyirul/go-starter-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoyirul%2Fgo-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoyirul%2Fgo-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoyirul%2Fgo-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoyirul%2Fgo-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoyirul","download_url":"https://codeload.github.com/hoyirul/go-starter-kit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoyirul%2Fgo-starter-kit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262081080,"owners_count":23255660,"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":["gin","gin-gonic","golang","gorm","jwt","mssql","mysql","postgres","sql"],"created_at":"2025-06-26T14:05:11.415Z","updated_at":"2025-12-30T22:23:32.342Z","avatar_url":"https://github.com/hoyirul.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Starter Kit - Restful API with Gin and Gorm\n\u003e A starter kit for building RESTful APIs in Golang using Gin and Gorm.\nThis repository provides a basic structure and setup for creating RESTful APIs in Go, utilizing the Gin web framework and Gorm ORM for database interactions.\n- **Gin**: A web framework written in Go that is known for its speed and small memory footprint.\n- **Gorm**: An ORM library for Go that provides a simple and powerful way to interact with databases.\n\n## Features\n- RESTful API structure\n- Middleware support\n- Database migrations\n- Error handling\n- Logging\n- Environment configuration\n- Dependency injection\n\n## Getting Started\n### Prerequisites\n- Go 1.18 or later\n- PostgreSQL or any other supported database\n- Docker (optional, for running the database in a container)\n\n### Installation\n1. Clone the repository:\n   ```bash\n   git clone repository_url\n   cd repository_name\n   ```\n2. Install dependencies:\n   ```bash\n   go mod tidy\n   ```\n3. Set up your environment variables. You can create a `.env` file in the root directory with the following content:\n   ```env\n   DB_HOST=localhost\n   DB_PORT=5432\n   DB_USER=your_db_user\n   DB_PASSWORD=your_db_password\n   DB_NAME=your_db_name\n   PORT=8080\n   ```\n4. Run the application:\n   ```bash\n   go run main.go\n   ```\n\n### Running with Docker\nIf you prefer to run the application with Docker, you can use the provided `docker-compose.yml` file. Make sure you have Docker and Docker Compose installed.\n1. Build and run the containers:\n   ```bash\n   docker-compose up --build\n   ```\n2. Access the application at `http://localhost:8080`.\n\n### Make a Tests with Gomock\nTo ensure the application works as expected, you can run the provided tests. The tests are located in the `tests` directory and cover various aspects of the API functionality.\n1. Make mocks for the tests e.g:\n   ```bash\n   mockgen -source=internal/repository/auth.repository.go -destination=mocks/services/auth.repository.mock.go -package=mocks\n   ```\n2. Then make tests file for example:\n   ```go\n   package tests\n\n   import (\n       \"testing\"\n       \"github.com/stretchr/testify/assert\"\n       \"github.com/yourusername/yourproject/internal/repository/mocks\"\n       \"github.com/golang/mock/gomock\"\n   )\n\n   func TestExample(t *testing.T) {\n       ctrl := gomock.NewController(t)\n       defer ctrl.Finish()\n\n       mockRepo := mocks.NewMockAuthRepository(ctrl)\n       // Set expectations and call methods on mockRepo\n       assert.NotNil(t, mockRepo)\n   }\n   ```\n\n### Running Tests\nTo run the tests, you can use the following command:\n```bash\ngo test ./...\n```\n\n### Contributing\nContributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.\n\n### License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoyirul%2Fgo-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoyirul%2Fgo-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoyirul%2Fgo-starter-kit/lists"}