How pujexx/go-boilerplate works
This is a Go REST API boilerplate whose main product workflow is a CLI-driven CRUD generator: it inspects a MySQL schema and emits domain, repository, service, and HTTP-handler code, with a command to wire generated handlers into the application. It also starts a small HTTP server with a ping endpoint and supplies reusable response, routing, pagination, and validation helpers. The graph reflects sampled source and README claims; unsampled generator details and generated runtime call chains are not inferred.
Main entry points: generator.go Generator CLI · main.go Application entry · ping_handler.go Ping endpoint · domain_generator.go Domain generation
Components 22
HTTP application
- Application entry
main.go - Ping endpoint
infrastructure/ping_handler.go
CRUD generation
- Generator CLI
lib/gen/generator.go - Schema inspection
lib/gen/generator.go - Domain generation
lib/gen/domain_generator.go - Repository generation
lib/gen/generator.go - Service generation
lib/gen/generator.go - Handler generation
lib/gen/generator.go - Parameter generation
lib/gen/params_response_generator.go - Implementation wiring
lib/gen/generator.go
Shared library
- JSON responses
lib/base_response.go - Router wrapper
lib/base_router.go - CRUD interface
lib/base_handler.go - Pagination
lib/base_pagination.go - Validation
lib/base_validation.go - Date utilities
lib/base_date.go - Domain base
lib/base_domain.go
Documented extras
- Postman export
lib/gen/postman_generator.go - Swagger annotations
main.go
Other components
- CLI user
- HTTP client
- MySQL database
Connections 23
- CLI user → Application entry: starts
README.md - Application entry → MySQL database: opens connection
main.go - Application entry → Ping endpoint: registers route
main.go - HTTP client → Ping endpoint: requests endpoint
- Ping endpoint → JSON responses: formats response
infrastructure/ping_handler.go - Application entry → Generator CLI: starts CLI
main.go - CLI user → Generator CLI: selects command
README.md - Generator CLI → Schema inspection: reads schema
lib/gen/generator.go - Schema inspection → MySQL database: queries tables
lib/gen/generator.go - Generator CLI → Domain generation: dispatches domain
lib/gen/generator.go - Domain generation → Schema inspection: reads columns
lib/gen/domain_generator.go - Generator CLI → Repository generation: dispatches repository
lib/gen/generator.go - Repository generation → Schema inspection: enumerates tables
lib/gen/generator.go - Generator CLI → Service generation: dispatches service
lib/gen/generator.go - Service generation → Schema inspection: enumerates tables
lib/gen/generator.go - Generator CLI → Handler generation: dispatches handlers
lib/gen/generator.go - Handler generation → Parameter generation: generates parameters
lib/gen/generator.go - Handler generation → Schema inspection: enumerates tables
lib/gen/generator.go - Generator CLI → Implementation wiring: dispatches wiring
lib/gen/generator.go - Generator CLI → Postman export: offers export
- Application entry → Swagger annotations: declares API metadata
main.go - Application entry → Router wrapper: uses routing
- Pagination → MySQL database: queries records
lib/base_pagination.go