Summary
This is a major refactor that introduces graft as a dependency injection framework, restructuring the server into composable, dependency-aware nodes. The v1 pattern remains available via the v1 branch/tag for users who prefer a simpler, non-DI approach.
Changes
Architecture
- New
pkg/nodes/package - Modular node-based architecture replacing the monolithicpkg/server/:config/- Environment configuration as a cacheable graft noderouter/- Echo router setup with middleware and route registrationserver/- HTTP server with explicit dependencies on config and router nodes
- Deleted
pkg/server/- Replaced by the nodes architecture
Bootstrap
- Simplified
cmd/main.gousinggraft.ExecuteFor[server.Output]()to bootstrap the entire dependency graph - Cleaner signal handling and graceful shutdown
Auth & Error Handling
- New
web/pages/authfail/- Dedicated unauthorized page template - Enhanced error handler renders the authfail page for 401 responses
- Auth middleware demonstrates rejection flow with
?username=reject
Dependencies
- Added
github.com/grindlemire/graftfor dependency injection
Breaking Changes
The internal structure is significantly different from v1. If you've built on top of v1:
pkg/server/no longer exists - migrate topkg/nodes/pattern- Server bootstrap now uses graft's node execution model
Migration
For users who prefer the simpler v1 pattern without DI:
git clone --branch v1 https://github.com/grindlemire/gothem-stack.git