# Anatomy of a reusable module

Source: https://zotonic.com/docs/2921/anatomy-of-a-reusable-module

URI: https://zotonic.com/id/2921

Language: en

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:

```text
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](/id/1576) and [Application startup and per-site module activation](/id/2926).

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2921?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2921?language=en>)
