An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

# Backend Microservices

## Made with


golang logo
docker logo
rest logo
graphql logo
grpc logo
kafka logo

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)