{"id":23649990,"url":"https://github.com/atopx/goapi","last_synced_at":"2026-05-01T06:33:55.415Z","repository":{"id":269538655,"uuid":"804761029","full_name":"atopx/goapi","owner":"atopx","description":"gin api template","archived":false,"fork":false,"pushed_at":"2025-12-17T07:22:21.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-20T20:54:20.393Z","etag":null,"topics":["gin","gorm","rest-api","swagger","template","zap"],"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/atopx.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}},"created_at":"2024-05-23T08:07:24.000Z","updated_at":"2025-12-17T07:22:24.000Z","dependencies_parsed_at":"2024-12-24T09:34:36.685Z","dependency_job_id":"7143df90-d2a1-4d2e-b6a0-edff66829e5e","html_url":"https://github.com/atopx/goapi","commit_stats":null,"previous_names":["atopx/goapi"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/atopx/goapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Fgoapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Fgoapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Fgoapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Fgoapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atopx","download_url":"https://codeload.github.com/atopx/goapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atopx%2Fgoapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32487551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["gin","gorm","rest-api","swagger","template","zap"],"created_at":"2024-12-28T15:50:14.800Z","updated_at":"2026-05-01T06:33:55.410Z","avatar_url":"https://github.com/atopx.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goapi\n\n\u003e go1.22+\n\nThis is a template for creating a REST API using Golang, Gin, Gorm, Zap, and Swagger.\n\n\n## Features\n\n- Support databases: MySQL, PostgreSQL, and SQLite databases\n- Support docker\n- Performance optimization\n- Redoc and openapi documentation\n- Full chain trace of logs (use uber-zap)\n- Lightweight and fast\n- Licensed under the MIT License\n\n## Installation\n1. Clone the repository:\n\n  ```bash\n  git clone https://github.com/atopx/goapi.git\n  ```\n\n2. Init your app\n  \n  ```bash\n  cd goapi\n  ./control init $NEW_NAME # example: ./control init newapp\n  ```\n\n3. Change the configuration file:\n\n  ```bash\n  cp conf/config.example.toml config.toml\n  ```\n\n4. Run the application:\n\n  ```bash\n  go mod tidy\n  go run main.go\n  ```\n\n5. Control script\n\n  ```bash\n  ./control { init $NEW_NAME | build | docker | docs | clean }\n  ```\n\n## Codes Layout\n\n```bash\ngoapi\n├── common # common package\n│   ├── handle # global handlers\n│   │   └── db.go\n│   ├── logger # global logger\n│   │   ├── gorm.go\n│   │   └── logger.go\n│   ├── middleware # router middleware\n│   │   ├── context.go\n│   │   └── recover.go\n│   ├── system # api response\n│   │   ├── consts.go\n│   │   └── response.go\n│   └── utils # frequently used functions\n│       ├── sql.go\n│       └── trace.go\n├── conf # configuration file\n│   ├── config.example.yaml\n│   ├── config.go\n│   └── config.yaml\n├── docs # redoc and openapi documentation\n├── internal # internal logic\n│   ├── api # define api\n│   │   ├── server.go\n│   │   └── user.go\n│   ├── biz # business logic\n│   │   └── user\n│   │       └── list\n│   │           ├── action.go\n│   │           └── schema.go\n│   ├── control # api controller interface\n│   │   └── control.go\n│   ├── model # db model\n│   │   └── user.go\n│   ├── server # api server\n│   │   ├── router.go\n│   │   └── server.go\n│   └── worker # async workers\n│       ├── health\n│       │   └── task.go\n│       └── worker.go\n├── pkg # third-party packages\n│   ├── db.go\n│   └── redis.go\n└── tests # tests\n    └── config_test.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatopx%2Fgoapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatopx%2Fgoapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatopx%2Fgoapi/lists"}