{"id":21066202,"url":"https://github.com/syahidfrd/go-boilerplate","last_synced_at":"2025-08-24T19:44:24.636Z","repository":{"id":57633161,"uuid":"412941047","full_name":"syahidfrd/go-boilerplate","owner":"syahidfrd","description":"REST API boilerplate built with Go - Echo Framework","archived":false,"fork":false,"pushed_at":"2023-03-03T00:29:41.000Z","size":97,"stargazers_count":35,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T03:19:50.883Z","etag":null,"topics":["boilerplate","echo-framework","go","golang","jwt","migration","mockery","postgres","postgresql","redis","rest-api","swagger","testify","unit-test","zerolog"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/syahidfrd/go-boilerplate","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/syahidfrd.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":"2021-10-03T00:28:23.000Z","updated_at":"2024-10-03T23:38:49.000Z","dependencies_parsed_at":"2024-06-20T05:59:45.141Z","dependency_job_id":null,"html_url":"https://github.com/syahidfrd/go-boilerplate","commit_stats":null,"previous_names":[],"tags_count":10,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syahidfrd%2Fgo-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syahidfrd%2Fgo-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syahidfrd%2Fgo-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syahidfrd%2Fgo-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syahidfrd","download_url":"https://codeload.github.com/syahidfrd/go-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225402386,"owners_count":17468831,"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":["boilerplate","echo-framework","go","golang","jwt","migration","mockery","postgres","postgresql","redis","rest-api","swagger","testify","unit-test","zerolog"],"created_at":"2024-11-19T17:58:37.373Z","updated_at":"2024-11-19T17:58:38.032Z","avatar_url":"https://github.com/syahidfrd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GO Boilerplate\n[![Go Reference](https://pkg.go.dev/badge/github.com/andhikayuana/qiscus-unofficial-go.svg)](https://pkg.go.dev/github.com/syahidfrd/go-boilerplate)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Go Report Card](https://goreportcard.com/badge/github.com/andhikayuana/qiscus-unofficial-go)](https://goreportcard.com/report/github.com/syahidfrd/go-boilerplate)\n\n### Directory Structure\n```\n├── cmd\n│   └── api             // Main applications for this project\n├── config              // Configuration app\n├── delivery            // Delivery usefull to encode raw body, query params, make a response to client\n│   ├── http\n│   └── middleware\n├── docs                // Design and user documents (in addition to your godoc generated documentation)\n├── domain              // Domains is a struct to store any objects from database, example you have a products in your tables.\n├── infrastructure\n│   └── datastore       // Database configuration\n├── migration           // Database migrations.\n├── mocks               // Mock code, generated by mockery\n├── repository          // Represents the behavior of the data store. It can be implemented using PostgreSQL, MongoDB, etc\n│   ├── pgsql\n│   └── redis\n├── transport           // Request and response model\n│   └── request\n├── usecase             // Usecase contains all of business logic\n└── utils               // Additional services\n    ├── crypto\n    ├── jwt\n```\n\n### Prerequisite and full list what has been used\n* [PostgreSQL](https://www.postgresql.org) - PostgreSQL Database\n* [Redis](https://redis.com) - Redis\n* [golang-migrate](https://github.com/golang-migrate/migrate) - Database migrations. CLI and Golang library\n* [echo](https://github.com/labstack/echo) - Web framework\n* [go-redis](https://github.com/go-redis/redis) - Type-safe Redis client for Golang\n* [zerolog](https://github.com/rs/zerolog) - Logger\n* [ozzo-validation](https://github.com/go-ozzo/ozzo-validation) - Go Struct and Field validation\n* [mockery](https://github.com/vektra/mockery) - A mock code autogenerator for Golang\n* [swag](https://github.com/swaggo/swag) - Generator RESTful API documentation with Swagger\n* [echo-swagger](https://github.com/swaggo/echo-swagger) - Echo middleware for Swagger\n* [testify](https://github.com/stretchr/testify) - A toolkit with common assertions and mocks\n* [godotenv](https://github.com/joho/godotenv) - Environment variables loader\n\nApp requires 2 database (PostgreSQL and Redis server), run from your local machine or run it using docker with the following command\n```\n# run postgreSQL\ndocker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=go_boilerplate postgres\n\n# run redis\ndocker run -d -p 6379:6379 redis\n``` \n\n### Migration\nRun below command to run migration\n```\nmigrate -path migration -database \"${DATABASE_URL}\" up\n```\n\nTo create a new migration file\n```\nmigrate create -ext sql -dir migration -seq name\n```\n\n### Test\nRun below command to run test, and make sure that all tests are passing\n```\ngo test -v ./...\n```\n\n### Running\nRun below command to run app\n```\ngo run ./cmd/api/main.go\n```\n\nSwagger URL\n```\n${BASE_URL}/swagger/index.html\n```\n\nYou can find usefull commands in `Makefile`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyahidfrd%2Fgo-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyahidfrd%2Fgo-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyahidfrd%2Fgo-boilerplate/lists"}