Anatomy of a reusable module
A reusable module normally lives in apps_user/zotonic_mod_garden and contains:
A reusable module normally lives in apps_user/zotonic_mod_garden and contains:
zotonic_mod_garden/
├── rebar.config
├── src/
│ ├── zotonic_mod_garden.app.src
│ ├── mod_garden.erl
│ └── models/m_garden.erl
└── priv/
└── templates/
The package name is zotonic_mod_garden; the module activated on a site is mod_garden. Use a .app.src whose application name matches the package.
Add controllers, dispatch rules, translations, and assets only when the feature requires them. A template-only feature does not need a custom process. A background service needs an explicit lifecycle and supervision design.
Build the package, make it discoverable, then activate it for the intended site. See Create a reusable module and Application startup and per-site module activation.