The main.go file has grown to 1171 lines with 22 initialization helper functions. This makes the codebase difficult to understand for new contributors and violates the single responsibility principle. The file mixes CLI argument parsing, configuration validation, infrastructure setup, service initialization, HTTP routing, and graceful shutdown logic.
This refactoring will:
- Extract initialization logic into a new
internal/bootstrap/package - Reduce
main.goto ~100 lines (CLI handling only)