{"result":{"depiction_url":null,"edges":{"hasreference":{"objects":[{"created":"2026-10-07T11:13:46Z","object_id":{"id":2927,"is_a":["text","documentation","developerguide"],"name":"developer_runtime_storage","title":{"_type":"trans","tr":{"en":"Runtime data and uploaded files"}},"uri":"https:\/\/zotonic.com\/id\/2927"},"seq":1}],"predicate":{"id":2774,"is_a":["meta","predicate"],"name":"hasreference","title":{"_type":"trans","tr":{"en":"Documentation reference"}},"uri":"https:\/\/zotonic.com\/id\/hasreference"}},"references":{"objects":[{"created":"2020-05-30T10:07:10Z","object_id":{"id":1547,"is_a":["text","documentation","reference"],"name":"doc_reference_cli_index","title":{"_type":"trans","tr":{"en":"Command-line reference"}},"uri":"https:\/\/zotonic.com\/id\/1547"},"seq":1000000},{"created":"2020-05-30T10:07:10Z","object_id":{"id":1528,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_status_site","title":{"_type":"trans","tr":{"en":"Find the status site and your site&#39;s admin"}},"uri":"https:\/\/zotonic.com\/id\/1528"},"seq":1000000},{"created":"2020-05-30T10:07:10Z","object_id":{"id":1481,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_deployment_env","title":{"_type":"trans","tr":{"en":"Keep development and production settings distinct"}},"uri":"https:\/\/zotonic.com\/id\/1481"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-10-07T11:13:04Z","object_id":{"id":1284,"is_a":["text","documentation","reference","model"],"name":"doc_model_model_media","title":"media","uri":"https:\/\/zotonic.com\/id\/1284"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"relation":{"objects":[{"created":"2026-10-07T11:13:46Z","object_id":{"id":2927,"is_a":["text","documentation","developerguide"],"name":"developer_runtime_storage","title":{"_type":"trans","tr":{"en":"Runtime data and uploaded files"}},"uri":"https:\/\/zotonic.com\/id\/2927"},"seq":1},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2947,"is_a":["text","documentation","developerguide"],"name":"developer_asset_build","title":{"_type":"trans","tr":{"en":"Build and serve frontend assets"}},"uri":"https:\/\/zotonic.com\/id\/2947"},"seq":2},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2920,"is_a":["text","documentation","developerguide"],"name":"developer_site_anatomy","title":{"_type":"trans","tr":{"en":"Anatomy of a site application"}},"uri":"https:\/\/zotonic.com\/id\/2920"},"seq":3},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2919,"is_a":["text","documentation","developerguide"],"name":"developer_application_identities","title":{"_type":"trans","tr":{"en":"Erlang applications, Zotonic modules, and sites"}},"uri":"https:\/\/zotonic.com\/id\/2919"},"seq":4}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-10-07T11:13:46Z","object_id":{"id":2556,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_explanation","title":"Explanation","uri":"https:\/\/zotonic.com\/id\/2556"},"seq":1},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2613,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_development_and_debugging","title":"Development and debugging","uri":"https:\/\/zotonic.com\/id\/2613"},"seq":3},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2635,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_module","title":"Module","uri":"https:\/\/zotonic.com\/id\/2635"},"seq":4},{"created":"2026-10-07T11:13:46Z","object_id":{"id":2634,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_site","title":"Site","uri":"https:\/\/zotonic.com\/id\/2634"},"seq":5}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2176,"is_a":["text","documentation","developerguide"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2176"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_developerguide_directory_structure","page_url":{"en":"https:\/\/zotonic.com\/docs\/2176\/the-zotonic-workspace","x-default":"https:\/\/zotonic.com\/docs\/2176\/the-zotonic-workspace"},"preview_url":null,"resource":{"body":{"_type":"trans","tr":{"en":"<ul><li><code>apps\/<\/code> contains Zotonic&#39;s core applications and bundled modules.<\/li><li><code>apps_user\/<\/code> contains your sites and additional modules.<\/li><li><code>apps_user\/&lt;project&gt;\/apps\/<\/code> can contain applications in a nested project; this path is included in the current build configuration.<\/li><li><code>_build\/<\/code> contains build output and dependencies. Do not treat it as the authoritative source directory.<\/li><li><code>doc\/<\/code> contains versioned documentation and reference sources.<\/li><li><code>bin\/zotonic<\/code> is the command-line entry point.<\/li><\/ul>\n<p>A site or external module can be its own Git repository inside <code>apps_user<\/code>. Before changing files, check which repository owns them. Add dependencies in the appropriate <code>rebar.config<\/code>, then build from the umbrella root.<\/p>\n<h2>What belongs in src and priv<\/h2>\n<p>Use <code>src<\/code> for compiled Erlang code and <code>priv<\/code> for application resources.<\/p>\n<p>Put request handling in <code>controllers<\/code>, model APIs in <code>models<\/code>, template transformations in <code>filters<\/code>, rendered components in <code>scomps<\/code>, and supporting business logic in <code>support<\/code>. Directory names help readers; the Erlang module name and exported callbacks still determine behavior.<\/p>\n<p>Under <code>priv<\/code>, put routes in <code>dispatch<\/code>, templates in <code>templates<\/code>, browser-ready files in <code>lib<\/code>, and their editable build sources in <code>lib-src<\/code>. Translation catalogs belong in <code>translations<\/code>.<\/p>\n<p>Do not put uploaded files, caches, or local secrets in a deployable assets directory. Use the site&#39;s configured storage and configuration mechanisms. Do not edit generated CSS when its source and build command are available.<\/p>\n<h2>Runtime data and uploaded files<\/h2>\n<p>Keep runtime data separate from the application&#39;s source and static assets.<\/p>\n<p>Site media, generated previews, backups, logs, and caches can live outside the checkout. Their locations depend on the running installation&#39;s configuration. Use Zotonic&#39;s storage and path APIs rather than assuming a relative directory beside a template.<\/p>\n<p>For media, work through <a href=\"\/id\/1284\" class=\"doc-reference doc-reference-model\"><code>model#media<\/code><\/a> and related storage facilities so metadata, preview generation, access checks, and storage backends remain coordinated. Never replace a file behind the model&#39;s back as a normal upload workflow.<\/p>\n<p>When deploying, preserve the site&#39;s durable files as well as its database. Rebuilding <code>_build<\/code> is not a backup or migration strategy for uploaded content.<\/p>"}},"category_id":{"id":317,"is_a":["meta","category"],"name":"developerguide","title":"Developer guide","uri":"https:\/\/zotonic.com\/id\/developerguide"},"content_group_id":{"id":339,"is_a":["meta","content_group"],"name":"default_content_group","title":{"_type":"trans","tr":{"en":"Default Content Group"}},"uri":"https:\/\/zotonic.com\/id\/default_content_group"},"created":"2020-05-30T10:07:03Z","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"doc_editorial_bundle":true,"doc_editorial_edges":{"hasreference":[2927],"relation":[2919,2920,2927,2947],"subject":[2556,2564,2613,2634,2635]},"github_url":"https:\/\/github.com\/zotonic\/zotonic\/tree\/master\/doc\/developer-guide\/directory-structure.rst","is_authoritative":true,"is_dependent":false,"is_featured":false,"is_protected":false,"is_published":true,"is_unfindable":false,"language":["en"],"modified":"2026-10-07T20:45:38Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"name":"doc_developerguide_directory_structure","pivot_geocode":null,"pivot_location_lat":null,"pivot_location_lng":null,"privacy":0,"publication_end":"9999-06-01T00:00:00Z","publication_start":"2022-02-15T10:01:31Z","slug":"the-zotonic-workspace","summary":{"_type":"trans","tr":{"en":"The checkout is an Erlang umbrella project: one build contains many applications."}},"title":{"_type":"trans","tr":{"en":"The Zotonic workspace"}},"title_slug":{"_type":"trans","tr":{"en":"the-zotonic-workspace"}},"tz":"UTC","uri":null,"version":43,"visible_for":0},"uri":"https:\/\/zotonic.com\/id\/2176","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2176"}},"status":"ok"}