How dedeez14/goforge works
goforge is a Clean-Architecture Go API blueprint. Its principal workflow is an HTTP request entering the Fiber server, reaching a routed handler and transport-agnostic use case, then using domain repository interfaces backed by PostgreSQL; the handler returns a common response envelope. The application composition root wires these layers and the platform feature packs. The README documents additional opt-in capabilities. Some are represented at package level because their integration details were not sampled; those relationships are shown only where the excerpts or README support them.
Main entry points: app.go Composition root · handler HTTP handlers · sse.go SSE bridge · server.go Fiber server
Components 26
HTTP entry
- API entrypoint
cmd/api/main.go - Fiber server
internal/infrastructure/server/server.go - Route registration
internal/infrastructure/server/router.go - HTTP handlers
internal/adapter/http/handler - HTTP middleware
internal/adapter/http/middleware
API core
- Business use cases
internal/usecase - Authentication flow
internal/usecase/auth.go - Session management
internal/usecase/session.go - Domain models
internal/domain
Infrastructure
- Postgres repositories
internal/adapter/repository/postgres - Session repository
internal/adapter/repository/postgres/session.go - PostgreSQL
- Security services
internal/infrastructure/security - Composition root
internal/app/app.go
Platform features
- Module system
pkg/module - Idempotency
pkg/idempotency - Transactional outbox
pkg/outbox/outbox.go - Event bus
pkg/events/bus.go - SSE bridge
pkg/realtime/sse.go - OpenAPI and docs
pkg/openapi/openapi.go - Bundled admin UI
pkg/adminui
Operations
- Metrics and tracing
pkg/observability - Tenant primitives
pkg/tenant - Feature flags
pkg/flags - Forge CLI
cmd/forge
Other components
- API client
Connections 25
- API client → Fiber server: sends requests
README.md - API entrypoint → Composition root: starts
cmd/api/main.go - Composition root → Fiber server: configures
internal/app/app.go - Composition root → Route registration: registers routes
internal/app/app.go - Fiber server → HTTP middleware: installs
internal/infrastructure/server/server.go - Route registration → HTTP handlers: routes to
internal/infrastructure/server/router.go - HTTP handlers → Business use cases: calls
internal/adapter/http/handler/auth.go - HTTP handlers → HTTP middleware: reads identity
internal/adapter/http/handler/auth.go - Business use cases → Domain models: uses interfaces
README.md - Session management → Session repository: calls repository
internal/usecase/session.go - Session repository → PostgreSQL: reads and writes
internal/adapter/repository/postgres/session.go - Composition root → Postgres repositories: wires repositories
internal/app/app.go - Composition root → Security services: wires services
internal/app/app.go - Composition root → Module system: builds platform
internal/app/app.go - Composition root → Idempotency: builds platform
- Composition root → Transactional outbox: builds platform
- Composition root → SSE bridge: builds platform
- Composition root → OpenAPI and docs: registers spec
internal/app/app.go - Composition root → Bundled admin UI: mounts UI
- Composition root → Metrics and tracing: configures metrics
internal/app/app.go - SSE bridge → Event bus: streams events
pkg/realtime/sse.go - Transactional outbox → Event bus: publishes events
pkg/outbox/outbox.go - SSE bridge → Tenant primitives: scopes streams
pkg/realtime/sse.go - API client → Forge CLI: invokes commands
README.md - API client → Feature flags: configures features
README.md