How hexya-erp/hexya works
Project type and purpose
• Hexya is an open-source ERP and business-application development framework written in Go.
• It exposes both a command-line interface (in cmd/) and a reusable library (in src/) for building modular business applications.
File structure
• Top-level:
– cmd/ : CLI entrypoints (generate code, launch server, update DB, i18n, version, project scaffolding)
– main.go, go.mod/go.sum: module definition and root launcher
– doc/: user and developer documentation (install, tutorial, design, contribution)
• src/: framework core divided into:
– actions: declarative actions driving UI and workflows
– controllers: HTTP controllers and test harness
– i18n: locale file handling and translation generators
– menus: menu tree definitions
– models: full-featured type-safe ORM + query builder + security (Postgres backend)
– reports: report generation (text, formats)
– server: HTTP server, routing, module loading, context management
– templates: view rendering engines (Gin, Pongo2)
– views: XML view definitions and inheritance mechanisms
– tests/tools: integration and unit tests; assorted utility libraries
• tools/: CLI helper libraries (config, assets, logging, password, XML and PO file utilities, code generators)
Insights from README
• Core features: ORM, views, controllers, modular “iterative definition” (plugins extend models/actions/views in place).
• Architecture: MVC-style with an extension point per component—models, views, methods, menus, controllers.
• Deployment: server.go boots, loads registered modules, wires routes, exposes HTTP API, manages DB schema.