{"id":28164781,"url":"https://github.com/archit-p/microservicetemplate","last_synced_at":"2025-10-15T10:37:47.095Z","repository":{"id":57545081,"uuid":"287529816","full_name":"archit-p/MicroserviceTemplate","owner":"archit-p","description":"Template for microservices built with Go.","archived":false,"fork":false,"pushed_at":"2020-08-16T10:48:01.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T12:09:56.649Z","etag":null,"topics":["crud","go","golang","microservices","mongodb","rest-api"],"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/archit-p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-14T12:39:26.000Z","updated_at":"2020-08-16T10:48:03.000Z","dependencies_parsed_at":"2022-08-27T05:21:41.002Z","dependency_job_id":null,"html_url":"https://github.com/archit-p/MicroserviceTemplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/archit-p/MicroserviceTemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archit-p%2FMicroserviceTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archit-p%2FMicroserviceTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archit-p%2FMicroserviceTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archit-p%2FMicroserviceTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archit-p","download_url":"https://codeload.github.com/archit-p/MicroserviceTemplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archit-p%2FMicroserviceTemplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279073810,"owners_count":26097462,"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-10-15T02:00:07.814Z","response_time":56,"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":["crud","go","golang","microservices","mongodb","rest-api"],"created_at":"2025-05-15T12:09:55.956Z","updated_at":"2025-10-15T10:37:47.054Z","avatar_url":"https://github.com/archit-p.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/travis/archit-p/MicroserviceTemplate)](https://travis-ci.org/archit-p/MicroserviceTemplate)\n[![Go Report Card](https://goreportcard.com/badge/github.com/archit-p/MicroserviceTemplate)](https://goreportcard.com/report/github.com/archit-p/MicroserviceTemplate)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6ab701e403dd4aa39544b6b72be52506)](https://www.codacy.com/manual/archit-p/MicroserviceTemplate?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=archit-p/MicroserviceTemplate\u0026amp;utm_campaign=Badge_Grade)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=MicroserviceTemplate\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=MicroserviceTemplate)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=MicroserviceTemplate\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=MicroserviceTemplate)  \nGo Microservice built using best practices, ideal for use as a starter template. It features an extensible model - Sample - with support for CRUD and Search operations for MongoDB.\n\n## References\nThis project is inspired by multiple blogs and guides on best practices while writing Go code. I'm sharing links to these below.\n### Project Structure\n1.  [How to Write Go Code](https://golang.org/doc/code.html)\n2.  [golang-standards/project-layout](https://github.com/golang-standards/project-layout)\n3.  [Organizing Database Access](https://www.alexedwards.net/blog/organising-database-access)\n### Documentation\n1.  [Documenting APIs with Swagger](https://swagger.io/resources/articles/documenting-apis-with-swagger/)\n2.  [Documenting Go Code](https://blog.golang.org/godoc)\n### Containerization\n1.  [Docker: Multi-Stage Builds](https://docs.docker.com/develop/develop-images/multistage-build/)\n2.  [Why You Should Use Microservices and Containers](https://developer.ibm.com/technologies/microservices/articles/why-should-we-use-microservices-and-containers/)\n### Testing\n1.  [Structuring Tests in Go](https://medium.com/@benbjohnson/structuring-tests-in-go-46ddee7a25c)\n2.  [Testing Web-Apps in Go](https://markjberger.com/testing-web-apps-in-golang/)\n## Getting Started\n### Clone the Repo\n```sh\n$ git clone https://github.com/archit-p/MicroserviceTemplate\n```\n### Build and Run\n```sh\n$ make help\nRun make \u003ctarget\u003e where target is\n\thelp: print out this message\n\tbuild: build the executables\n\trun: start a clean build, and run executable\n\ttest: run go tests\n\tdocs: build documentation\n\tclean: clean executables and docs\n$ make run\n```\n## Project Layout\n```text\ncmd             (contains code for our apps)\n|-+ web         (server router and controllers)\npkg             (contains reusable code)\n|-+ dto         (data-transfer objects)\n|-+ models      (database models)\n    |-+ mongodb (models for mongo-db)\n|-+ docs        (swagger documentation)\n```\n## Docs\nOnce the service is running, accompanying Swagger docs can be found at `http://localhost:8080/swagger/index.html`.\n\n## Contributing\nFeel free to fork the project for use as a base template for your next microservice or REST API!\n\n## Built Using\n[![Golang](https://www.vectorlogo.zone/logos/golang/golang-ar21.svg)](https://golang.org)\n[![MongoDB](https://www.vectorlogo.zone/logos/mongodb/mongodb-ar21.svg)](https://www.mongodb.com/)\n[![Docker](https://www.vectorlogo.zone/logos/docker/docker-icon.svg)](https://www.docker.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchit-p%2Fmicroservicetemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchit-p%2Fmicroservicetemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchit-p%2Fmicroservicetemplate/lists"}