https://github.com/pedrofurtado/golang-clean-arch-hexagonal-arch-example-app
Example app with Clean Architecture and Hexagonal Architecture. Made in golang.
https://github.com/pedrofurtado/golang-clean-arch-hexagonal-arch-example-app
Last synced: about 1 month ago
JSON representation
Example app with Clean Architecture and Hexagonal Architecture. Made in golang.
- Host: GitHub
- URL: https://github.com/pedrofurtado/golang-clean-arch-hexagonal-arch-example-app
- Owner: pedrofurtado
- Created: 2024-04-09T21:59:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-18T14:11:32.000Z (about 1 year ago)
- Last Synced: 2024-10-29T15:09:36.623Z (6 months ago)
- Language: Go
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# golang-clean-arch-hexagonal-arch-example-app
Example app with Clean Architecture and Hexagonal Architecture. Made in golang.
First setup at all
```bash
docker container run -w /app -v $(pwd):/app --rm -it golang:1.22.2 go mod init my-app
```Localhost run
```bash
docker-compose up --build -d
```Execute migrations
```bash
# Create a new SQL migration
docker-compose exec app goose create my_migration_name_here sql# Check SQL file migrations status
docker-compose exec app goose status# Check last SQL migration executed
docker-compose exec app goose version# Run SQL migrations (with fix related to out-of-order migration)
docker-compose exec app goose -allow-missing up
```Install new dependency
```bash
docker-compose exec app go get mysite.com/mypkg
or
docker container run -w /app -v $(pwd):/app --rm -it golang:1.22.2 go get mysite.com/mypkg
```