Understanding Zotonic applications

Know where files belong and how sites and modules fit together.

Choose the task that matches what you need to do. The pages explain the relevant workflow and link to related guides and reference material. Examples use the local site garden; use your own site name and check the command’s scope before running it.

In this section

  1. 1The Zotonic workspaceThe checkout is an Erlang umbrella project: one build contains many applications.
  2. 2Erlang applications, Zotonic modules, and sitesThese terms describe different parts of the system.
  3. 3Anatomy of a site applicationA typical site contains the following directories. Create only the extension directories you actually need.
  4. 4Anatomy of a reusable moduleA reusable module normally lives in apps_user/zotonic_mod_garden and contains:
  5. 5Application and module namesUse distinct, consistent names so code and assets can be found without ambiguity.
  6. 6Site configuration and enabled modulesA site is identified by its application and priv/zotonic_site configuration. Supported formats include Erlang .config, JSON, and YAML; follow the format already used by the project.
  7. 7Dependencies, capabilities, and module priorityThe main site or module can declare:
  8. 8How Zotonic finds templates, dispatch rules, and assetsZotonic indexes resources from the site's active modules. A file existing on disk is not enough: its application must be discoverable, and its module must participate in that site.
  9. 9Application startup and per-site module activationOTP application startup concerns the application and its processes. Zotonic module activation concerns the feature within an individual site.
  10. 10Runtime data and uploaded filesKeep runtime data separate from the application's source and static assets.