Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikemajesty/go-microservice-boilerplate-api
Go(Golang) microservice boilerplate | Mongodb CRUD | Postgres CRUD
https://github.com/mikemajesty/go-microservice-boilerplate-api
boilerplate clean-architecture crud docker generic-repository go golang hexagonal-architecture mongo-crud postgres postgres-crud redis
Last synced: 15 days ago
JSON representation
Go(Golang) microservice boilerplate | Mongodb CRUD | Postgres CRUD
- Host: GitHub
- URL: https://github.com/mikemajesty/go-microservice-boilerplate-api
- Owner: mikemajesty
- Created: 2024-12-26T02:24:49.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2025-01-03T00:20:18.000Z (22 days ago)
- Last Synced: 2025-01-03T01:22:28.757Z (22 days ago)
- Topics: boilerplate, clean-architecture, crud, docker, generic-repository, go, golang, hexagonal-architecture, mongo-crud, postgres, postgres-crud, redis
- Language: Go
- Homepage:
- Size: 33 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang boilerplate Microservice API
##### In this Golang boilerplate I used the main concepts of DDD, Clean Architecture, Ports and Adapters (Hexagonal Architecture).
### Run
- infra
```
docker-compose up --build
```- run
```
CompileDaemon -command="./go-microservice-boilerplate-api"
```### Test
- run
```
$ go test ./core/dog/use-case/__tests__/ ./core/cat/use-case/__test__/
```#### CRUD features
- List
- mongo
- search
- pagination
- sort
- entity validation
- postgres
- search
- pagination
- sort
- entity validation
- Delete
- mongo
- Logical deletion
- entity validation
- postgres
- Logical deletion
- entity validation
- Update
- mongo
- Update Partial entity
- entity validation
- postgres
- Update Partial entity
- entity validation
- Create
- mongo
- entity validation
- Not allow creating duplicates
- postgres
- entity validation### Architecture diagram
## ![alt text](OnionGraph.jpg)
[Architecture documentation](https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/)
##### App Skeleton
```
.
├── core
│ ├── cat
│ │ ├── entity
│ │ │ └── cat.go
│ │ ├── repository
│ │ │ └── cat.go
│ │ └── use-case
│ │ ├── cat-create.go
│ │ ├── cat-delete.go
│ │ ├── cat-get-by-id.go
│ │ ├── cat-list.go
│ │ ├── cat-update.go
│ │ └── __test__
│ │ ├── cat-create_test.go
│ │ ├── cat-delete_test.go
│ │ ├── cat-get-by-id_test.go
│ │ ├── cat-list_test.go
│ │ └── cat-update_test.go
│ └── dog
│ ├── entity
│ │ └── dog.go
│ ├── repository
│ │ └── dog.go
│ └── use-case
│ ├── dog-create.go
│ ├── dog-delete.go
│ ├── dog-get-by-id.go
│ ├── dog-list.go
│ ├── dog-update.go
│ └── __tests__
│ ├── dog-create_test.go
│ ├── dog-delete_test.go
│ ├── dog-get-by-id_test.go
│ ├── dog-list_test.go
│ └── dog-update_test.go
├── docker-compose.yml
├── go.mod
├── go.sum
├── infra
│ ├── cache
│ │ ├── adapter.go
│ │ ├── memory
│ │ │ └── service.go
│ │ └── redis
│ │ └── service.go
│ ├── database
│ │ ├── adapter.go
│ │ ├── mongo
│ │ │ └── service.go
│ │ └── postgres
│ │ ├── migrations
│ │ │ └── create-cat-table.go
│ │ └── service.go
│ ├── logger
│ │ ├── adapter.go
│ │ └── service.go
│ ├── repository
│ │ ├── adapter.go
│ │ ├── mongo
│ │ │ └── repository.go
│ │ └── postgres
│ │ └── repository.go
│ └── secret
│ ├── adapter.go
│ └── service.go
├── main.go
├── modules
│ ├── cat
│ │ ├── adapter.go
│ │ ├── controller.go
│ │ ├── repository.go
│ │ ├── routes.go
│ │ └── validator.go
│ └── dog
│ ├── adapter.go
│ ├── controller.go
│ ├── repository.go
│ ├── routes.go
│ └── validator.go
├── observables
│ └── log-middlaware.go
├── README.md
├── textinho
└── utils
├── context.go
├── entity.go
├── exception.go
├── pagination.go
├── route.go
├── search.go
├── sort.go
├── type.go
└── validator.go
```---
The following is a list of all the people that have contributed Nestjs monorepo boilerplate. Thanks for your contributions!
[](https://github.com/mikemajesty)
## License
It is available under the MIT license.
[License](https://opensource.org/licenses/mit-license.php)