How joaofnds/go-template works
Project type and purpose
• This is a Go-based backend service (“monolith” with clear modular boundaries) exposing HTTP APIs, running background workers, managing migrations, and integrating a variety of infrastructure and third-party services.
• It uses Uber’s Fx for dependency injection, Viper for config, Zap for logging, Prometheus for metrics, OpenTelemetry for tracing, Fiber for HTTP, Asynq for background tasks, Watermill for events, and supports multiple storage backends (Postgres via GORM, MongoDB, Redis), plus external authn/authz providers (Casdoor, Casbin), feature flags, etc.
File structure
• Top-level entry points:
• cmd/app – HTTP server
• cmd/worker – Asynq worker
• cmd/migrate – database migrations
• “adapter/” – implementations for external systems (HTTP, logger, metrics, tracing, queue, storages, authn/authz, feature flags, validation, etc.)
• Feature modules at root: authn/, authz/, kv/, user/, each with “_http” controllers, “_module” wiring, service, providers, queues, etc.
• “internal/” – shared utilities: context, clock, ID generator, events, helpers
• config/, etc/ – configuration files and default manifests
• test/ – end-to-end and harness code
README for additional insights
• Confirms tech stack and architectural patterns (hexagonal: domain modules + adapters)
• Lists integrations: DI, config, logging, metrics, tracing, health checks, feature flags, validation, authn/authz, HTTP, CQRS via Watermill, background tasks via Asynq, migrations via Goose
Detail
• Adapter and module is represented or collapsed under its category
• Do not shy away from showing multiple storages—Postgres, Mongo, Redis—and how each module chooses its store
• Where feature flags, validation, authn/authz intercept the request flow