https://github.com/agungdwiprasetyo/backend-microservices
Monorepo for backend microservices golang
https://github.com/agungdwiprasetyo/backend-microservices
abstract-factory-pattern backend backend-microservices clean-architecture codebase continuous-integration cronjob-scheduler golang graphql grpc kafka-consumer monorepo redis-pubsub rest-api task-queue
Last synced: about 1 month ago
JSON representation
Monorepo for backend microservices golang
- Host: GitHub
- URL: https://github.com/agungdwiprasetyo/backend-microservices
- Owner: agungdwiprasetyo
- Created: 2020-01-20T03:06:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T03:17:33.000Z (about 2 years ago)
- Last Synced: 2025-04-14T16:16:58.960Z (about 1 month ago)
- Topics: abstract-factory-pattern, backend, backend-microservices, clean-architecture, codebase, continuous-integration, cronjob-scheduler, golang, graphql, grpc, kafka-consumer, monorepo, redis-pubsub, rest-api, task-queue
- Language: Go
- Homepage: https://api.agungdp.dev/{{service_name}}}}
- Size: 849 KB
- Stars: 69
- Watchers: 2
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backend Microservices
## Made with
![]()
![]()
![]()
![]()
![]()
![]()
This repository explain implementation of Go for building multiple microservices using a single codebase. Using [Standard Golang Project Layout](https://github.com/golang-standards/project-layout) and [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
## Create new service (for new project)
Please install **latest** [**candi**](https://pkg.agungdp.dev/candi) CLI first, and then:
```
$ candi -init
```
If include GRPC handler, run this command (must install `protoc` compiler min version `libprotoc 3.14.0`):```
$ make proto service={{service_name}}
```If using SQL database, run this command for migration:
```
$ make migration service={{service_name}} dbconn="{{YOUR DATABASE URL CONNECTION}}"
```## Run all services
```
$ candi -run
```## Run specific service or multiple services
```
$ candi -run -service {{service_a}},{{service_b}}
```## Add module(s) in specific service (project)
```
$ candi -add-module -service {{service_name}}
```## Run unit test and calculate code coverage
* **Generate mocks first (using [mockery](https://github.com/vektra/mockery)):**
```
$ make mocks service={{service_name}}
```
* **Run test:**
```
$ make test service={{service_name}}
```## Run sonar scanner
```
$ make sonar level={{level}} service={{service_name}}
```
`{{level}}` is service environment, example: `dev`, `staging`, or `prod`## Create docker image a service
```
$ make docker service={{service_name}}
```## Services
* [**Auth Service**](https://github.com/agungdwiprasetyo/backend-microservices/tree/master/services/auth-service)
* [**Line Chatbot**](https://github.com/agungdwiprasetyo/backend-microservices/tree/master/services/line-chatbot#line-chatbot-service)
* [**Notification Service**](https://github.com/agungdwiprasetyo/backend-microservices/tree/master/services/notification-service)
* [**Storage Service**](https://github.com/agungdwiprasetyo/backend-microservices/tree/master/services/storage-service)
* [**User Service**](https://github.com/agungdwiprasetyo/backend-microservices/tree/master/services/user-service)
* [**Master Service**](https://github.com/agungdwiprasetyo/backend-microservices/tree/master/services/master-service)