Shared online financial management apps. The goal is to help reduce unnecessary expenses. I experimented a lot with this repository.
- Log with tracer-ID
- Mini web framework
- Open telemetry
- Idempotency
- Raw SQL x Query builder with squirrel
- Database transaction with clean architecture
- Unit testing
- Swagger
- Profiling
- expvar
- Circuit breaker
- Using ULID
Something different :
- Handler separated with business folder (because I think handler is non-reusable code)
Todo :
- Minimize duplicate codes for transaction helpers
- Use golang/pkg/error instead fmt.Errorf for better error trace on logger
Take a look at the Makefile, there are many ways to run this application.
- step 1 : run database migration (read at
migrations/README.md
) - step 2 : prepare configuration file. Copy file
.env.example
and rename to.env
. - step 3 : Run this service with
make run/api
ormake run/api-log
if you want a modified stdout for better readability.
Swagger doc : localhost:8081/swagger/
# example
mockgen -source=business/pocket/storer/pocket_storer.go -destination=business/pocket/mock_storer/pocket_storer.go
go get golang.org/x/tools/cmd/cover
go test -v -coverprofile cover.out ./...
go tool cover -html=cover.out -o cover.html
open cover.html