Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felipeagger/go-boilerplate
Golang service boilerplate using best practices
https://github.com/felipeagger/go-boilerplate
Last synced: 2 days ago
JSON representation
Golang service boilerplate using best practices
- Host: GitHub
- URL: https://github.com/felipeagger/go-boilerplate
- Owner: felipeagger
- License: bsd-2-clause
- Created: 2021-09-29T23:04:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-06T21:19:52.000Z (over 2 years ago)
- Last Synced: 2024-06-19T01:59:29.799Z (4 months ago)
- Language: Go
- Size: 604 KB
- Stars: 11
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## go-boilerplate
Golang API Service boilerplate using best practices of Clean Architecture.Responsibility: CRUD and Login Users with JWT.
# Dependencies
- Gin-Gonic
- Swaggo
- go-redis
- GORM (MySQL)
- Golang-Migrate
- Snowflake
- OpenTelemetry
- JWT-Go
- Crypto## Documentation & Routes
**Swagger**
http://localhost:8000/auth/swagger/index.html![Print of Swagger](/assets/swagger.png)
**Jaeger UI**
http://0.0.0.0:16686/search![Print of Jaeger](/assets/trace-redis.png)
_**On Error**_
![Print of Jaeger](/assets/trace-error.png)_**SQL**_
![Print of Jaeger](/assets/trace-sql.png)## Compose Stack
- API REST
- MySQL
- Redis
- Jaeger## Execution / Compilation
Set Env. variables of .env-sample:
Compile with:
```
make run
```Update Swagger Doc:
```
make doc
```## Tests
```
make test
```## Path's Organization
_**Clean Arch**_
![Clean Representation](/assets/clean-arch.png)- _**assets**_: static files
- _**cmd**_: binaries entrypoint
- _**internal**_: private packages
- _**configs**_: env. variables
- _**usecase**_: business logical/rules
- _**delivery**_: delivery layer -> http, grpc, messaging
- _**entity**_: entities / schemas
- _**repository**_: storage operations, database interface
- _**service**_: external services call's
- _**pkg**_: public packages
- _**docs**_: Swagger Documentation