├── .air.toml ├── .codecov.yml ├── .env.example ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── feature_request.md │ └── general_issue.md ├── pull_request_template.md └── workflows │ └── ci.yml ├── .gitignore ├── .golangci.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── api ├── docs │ └── .gitkeep └── postman_collection.json ├── cmd ├── migrate │ └── main.go └── server │ ├── main.go │ └── main_test.go ├── configs ├── config.development.yaml ├── config.production.yaml ├── config.staging.yaml └── config.yaml ├── docker-compose.prod.yml ├── docker-compose.yml ├── go.mod ├── go.sum ├── internal ├── auth │ ├── dto.go │ ├── middleware.go │ ├── middleware_test.go │ ├── refresh_token.go │ ├── refresh_token_test.go │ ├── service.go │ ├── service_refresh_test.go │ └── service_test.go ├── config │ ├── config.go │ ├── config_test.go │ ├── testing.go │ └── validator.go ├── contextutil │ ├── context.go │ └── context_test.go ├── db │ ├── db.go │ └── db_test.go ├── errors │ ├── codes.go │ ├── errors.go │ ├── errors_test.go │ ├── middleware.go │ ├── middleware_test.go │ ├── response.go │ └── response_test.go ├── health │ ├── checker.go │ ├── database_checker.go │ ├── database_checker_test.go │ ├── handler.go │ ├── handler_test.go │ ├── model.go │ ├── service.go │ └── service_test.go ├── middleware │ ├── logger.go │ ├── logger_test.go │ ├── rate_limit.go │ └── rate_limit_test.go ├── migrate │ ├── migrate.go │ └── migrate_test.go ├── server │ ├── router.go │ └── router_test.go └── user │ ├── dto.go │ ├── handler.go │ ├── handler_refresh_test.go │ ├── handler_test.go │ ├── mocks_test.go │ ├── model.go │ ├── model_test.go │ ├── repository.go │ ├── repository_test.go │ ├── service.go │ └── service_test.go ├── migrations ├── 20251025225126_create_users_table.down.sql ├── 20251025225126_create_users_table.up.sql ├── 20251028000000_create_refresh_tokens_table.down.sql └── 20251028000000_create_refresh_tokens_table.up.sql ├── scripts ├── app_entrypoint.sh └── quick-start.sh └── tests ├── README.md ├── context_test.go └── handler_test.go /.air.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.air.toml -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.codecov.yml -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.env.example -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.github/ISSUE_TEMPLATE/bug_report.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.github/ISSUE_TEMPLATE/config.yml -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.github/ISSUE_TEMPLATE/feature_request.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general_issue.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.github/ISSUE_TEMPLATE/general_issue.md -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.github/pull_request_template.md -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.gitignore -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/.golangci.yml -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/CONTRIBUTING.md -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/Dockerfile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/LICENSE -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/README.md -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/SECURITY.md -------------------------------------------------------------------------------- /api/docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/api/docs/.gitkeep -------------------------------------------------------------------------------- /api/postman_collection.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/api/postman_collection.json -------------------------------------------------------------------------------- /cmd/migrate/main.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/cmd/migrate/main.go -------------------------------------------------------------------------------- /cmd/server/main.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/cmd/server/main.go -------------------------------------------------------------------------------- /cmd/server/main_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/cmd/server/main_test.go -------------------------------------------------------------------------------- /configs/config.development.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/configs/config.development.yaml -------------------------------------------------------------------------------- /configs/config.production.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/configs/config.production.yaml -------------------------------------------------------------------------------- /configs/config.staging.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/configs/config.staging.yaml -------------------------------------------------------------------------------- /configs/config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/configs/config.yaml -------------------------------------------------------------------------------- /docker-compose.prod.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/docker-compose.prod.yml -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/docker-compose.yml -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/go.mod -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/go.sum -------------------------------------------------------------------------------- /internal/auth/dto.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/dto.go -------------------------------------------------------------------------------- /internal/auth/middleware.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/middleware.go -------------------------------------------------------------------------------- /internal/auth/middleware_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/middleware_test.go -------------------------------------------------------------------------------- /internal/auth/refresh_token.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/refresh_token.go -------------------------------------------------------------------------------- /internal/auth/refresh_token_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/refresh_token_test.go -------------------------------------------------------------------------------- /internal/auth/service.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/service.go -------------------------------------------------------------------------------- /internal/auth/service_refresh_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/service_refresh_test.go -------------------------------------------------------------------------------- /internal/auth/service_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/auth/service_test.go -------------------------------------------------------------------------------- /internal/config/config.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/config/config.go -------------------------------------------------------------------------------- /internal/config/config_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/config/config_test.go -------------------------------------------------------------------------------- /internal/config/testing.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/config/testing.go -------------------------------------------------------------------------------- /internal/config/validator.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/config/validator.go -------------------------------------------------------------------------------- /internal/contextutil/context.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/contextutil/context.go -------------------------------------------------------------------------------- /internal/contextutil/context_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/contextutil/context_test.go -------------------------------------------------------------------------------- /internal/db/db.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/db/db.go -------------------------------------------------------------------------------- /internal/db/db_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/db/db_test.go -------------------------------------------------------------------------------- /internal/errors/codes.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/codes.go -------------------------------------------------------------------------------- /internal/errors/errors.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/errors.go -------------------------------------------------------------------------------- /internal/errors/errors_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/errors_test.go -------------------------------------------------------------------------------- /internal/errors/middleware.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/middleware.go -------------------------------------------------------------------------------- /internal/errors/middleware_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/middleware_test.go -------------------------------------------------------------------------------- /internal/errors/response.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/response.go -------------------------------------------------------------------------------- /internal/errors/response_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/errors/response_test.go -------------------------------------------------------------------------------- /internal/health/checker.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/checker.go -------------------------------------------------------------------------------- /internal/health/database_checker.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/database_checker.go -------------------------------------------------------------------------------- /internal/health/database_checker_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/database_checker_test.go -------------------------------------------------------------------------------- /internal/health/handler.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/handler.go -------------------------------------------------------------------------------- /internal/health/handler_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/handler_test.go -------------------------------------------------------------------------------- /internal/health/model.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/model.go -------------------------------------------------------------------------------- /internal/health/service.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/service.go -------------------------------------------------------------------------------- /internal/health/service_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/health/service_test.go -------------------------------------------------------------------------------- /internal/middleware/logger.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/middleware/logger.go -------------------------------------------------------------------------------- /internal/middleware/logger_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/middleware/logger_test.go -------------------------------------------------------------------------------- /internal/middleware/rate_limit.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/middleware/rate_limit.go -------------------------------------------------------------------------------- /internal/middleware/rate_limit_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/middleware/rate_limit_test.go -------------------------------------------------------------------------------- /internal/migrate/migrate.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/migrate/migrate.go -------------------------------------------------------------------------------- /internal/migrate/migrate_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/migrate/migrate_test.go -------------------------------------------------------------------------------- /internal/server/router.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/server/router.go -------------------------------------------------------------------------------- /internal/server/router_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/server/router_test.go -------------------------------------------------------------------------------- /internal/user/dto.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/dto.go -------------------------------------------------------------------------------- /internal/user/handler.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/handler.go -------------------------------------------------------------------------------- /internal/user/handler_refresh_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/handler_refresh_test.go -------------------------------------------------------------------------------- /internal/user/handler_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/handler_test.go -------------------------------------------------------------------------------- /internal/user/mocks_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/mocks_test.go -------------------------------------------------------------------------------- /internal/user/model.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/model.go -------------------------------------------------------------------------------- /internal/user/model_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/model_test.go -------------------------------------------------------------------------------- /internal/user/repository.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/repository.go -------------------------------------------------------------------------------- /internal/user/repository_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/repository_test.go -------------------------------------------------------------------------------- /internal/user/service.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/service.go -------------------------------------------------------------------------------- /internal/user/service_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/internal/user/service_test.go -------------------------------------------------------------------------------- /migrations/20251025225126_create_users_table.down.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/migrations/20251025225126_create_users_table.down.sql -------------------------------------------------------------------------------- /migrations/20251025225126_create_users_table.up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/migrations/20251025225126_create_users_table.up.sql -------------------------------------------------------------------------------- /migrations/20251028000000_create_refresh_tokens_table.down.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/migrations/20251028000000_create_refresh_tokens_table.down.sql -------------------------------------------------------------------------------- /migrations/20251028000000_create_refresh_tokens_table.up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/migrations/20251028000000_create_refresh_tokens_table.up.sql -------------------------------------------------------------------------------- /scripts/app_entrypoint.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/scripts/app_entrypoint.sh -------------------------------------------------------------------------------- /scripts/quick-start.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/scripts/quick-start.sh -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/tests/README.md -------------------------------------------------------------------------------- /tests/context_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/tests/context_test.go -------------------------------------------------------------------------------- /tests/handler_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vahiiiid/go-rest-api-boilerplate/HEAD/tests/handler_test.go --------------------------------------------------------------------------------