This service has been built following several architecture paradigms:
- Hexagonal
- Domain-Driven Design (DDD)
- Command and Query Separation (CQS)
- SOLID principles
- Go >= 1.20
- Docker >= 24.0.5
Install dependencies by running:
$ make deps
Install golangci-lint locally for Go linting (https://golangci-lint.run/)
To install
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
golangci-lint --version
$ make test
- Build Docker image
$ make docker-build
- Run the container
docker run -v ./data:/data geo-port aup -f /data/ports.json
-
Feature test to verify e2e workflow, inserting ports data through CLI and verify data is correctly stored.
-
Integration test at the component level to test infrastructure store adapter and database together to verify that port store methods store data correctly.
-
Unit tests:
- service layer tests should cover unhappy paths
-
Proper logging system in a shared infrastructure.
-
Engineering / Product effort to figure if service could be used by concurrent users and what would be the impact on service (especially at application level workflow).