https://github.com/yinebebt/hexagonal-architecture
Hexagonal architecture through a Go-based project demonstration
https://github.com/yinebebt/hexagonal-architecture
adapters go gorm graphql grpc handler hexagonal-architecture mongodb port postgres repository rest-api websocket
Last synced: 27 days ago
JSON representation
Hexagonal architecture through a Go-based project demonstration
- Host: GitHub
- URL: https://github.com/yinebebt/hexagonal-architecture
- Owner: yinebebt
- License: mit
- Created: 2024-03-06T00:20:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-25T08:41:29.000Z (about 1 year ago)
- Last Synced: 2025-06-21T10:51:27.907Z (8 months ago)
- Topics: adapters, go, gorm, graphql, grpc, handler, hexagonal-architecture, mongodb, port, postgres, repository, rest-api, websocket
- Language: Go
- Homepage:
- Size: 7.21 MB
- Stars: 17
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Hexagonal-architecture

Hexagonal architecture is a design pattern suitable for building scalable and complex projects.
This repository serves as a demonstration of the principles of Hexagonal Architecture in a Go project.
The goal of this project is to provide a straightforward example that developers can use to understand and apply
Hexagonal Architecture in their own projects. By following the structure and patterns demonstrated here, developers
can build scalable and maintainable systems with ease.
In this demo, the core business functionality revolves around managing user and video entities.
Administrators have the capability to manage videos, while users are provided with access to view the available videos.
Explore the concept of Hexagonal Architecture further
in [Hexagonal-architecture](https://medium.com/@yinebeb-tariku/hexagonal-architecture-93a946776242).
## Adapters
### Handler
- [x] REST API - GIN
- [ ] gRPC
- [ ] GraphQL
- [ ] WebSocket
### Repository
- [x] Sqlite
- [ ] Mongodb
- [x] Postgres
## Project structure
```
/app
|-- /cmd
| |-- main.go
|-- /docs
|-- /internal
| |-- /adapter
| | |-- /handler
| | | |-- /rest
| | | |-- /gRPC
| | |-- /reository
| | | |-- /sqlite
| | | |-- /postgres
| | | |-- /mongo
| | |-- /glue
| | | |-- /route
| | | |-- route.go
| | |-- /dto
| | |-- /templates
| |-- /core
| | |-- /entity
| | |-- /port
| | |-- /service
| | | |-- /test
| | |-- /util
```
## Installation
Install **godog** binary:
```bash
go install github.com/cucumber/godog/cmd/godog@latest
```
Use `go test` command to run feature tests since godog's cli is deprecated.