How samverrall/microservice-example works
Project type and purpose
• This is a Go-based microservice demonstrating Domain-Driven Design (DDD) and Hexagonal Architecture (ports & adapters).
• It exposes a gRPC interface for other services to interact with user accounts and includes health‐check endpoints.
• It persists data in PostgreSQL and provides migration and test‐database utilities.
File structure
• cmd/main.go: application entry point (wires everything up).
• internal/app: core application (use‐cases/services) implementing DDD.
• user: account creation, email, password rules, repository interface.
• internal/grpc: transport layer (adapters)
• server.go: gRPC server bootstrap
• handler packages: user & health RPC handlers
• internal/postgres & internal/repository: persistence adapters implementing repository interfaces.
• pkg/config: configuration loader
• pkg/postgresutil: migration runner and test‐database helper
• pkg/proto: compiled protobuf messages & gRPC stubs
• Dockerfile, Makefile, run.sh: build, run, and generate proto scripts
README for additional insights
• Confirms Hexagonal / ports-and-adapters structure.
• Emphasizes the “internal/app” core.
• Mentions gRPC transport and proto generation targets.