The herd directory
A map of models, contracts, views, generation, fixtures and project recipes.
herd/ holds the source declarations of a Goat application. Entity, view, contract and build changes start in this layer. Project-owned implementations live in child/. The generator rebuilds goatapp/ from the model, modules and templates.
Models, views and generation
| Path in GoatCMS | Contents and dependencies |
|---|---|
herd/_modules.goat | pull declarations with an alias, source and revision. Goat materializes modules under .goat/modules/<alias>/. @goatcms/herd/... addresses a shared recipe. |
herd/_model.goat | The root app declaration, Go prefix, output directory, languages, roles and explicit include:model entries. |
herd/_model/*.model.goat | Included type, entity, relation, entity module and field access declarations, grouped into areas such as users, content and shop. |
herd/models/*.model.goat | This repository also uses these files for portable type and value catalogues, including form types. The include declaration determines how each file is loaded. |
herd/services/ and herd/repositories/ | Domain contracts and repositories. The view catalogue connects declarations via contracts:include. |
herd/views/ | Views, requirements, navigation destinations, runtime catalogues, view translations and foundation manager selection. |
herd/shared/ | Shared view definitions such as project navigation and common error handling. A screen can import one with definitions:import and an alias. |
herd/gen.goat and herd/gen/ | Generator extensions, templates, Angular generation and generator translation declarations. |
app --go-prefix declares the generated foundation’s import path. This project uses code.pozoga.eu/spozoga/goatcms.com/goatapp. Edit source models or templates to change generation output. Use the full Go package prefix and available extension points in child/. When reviewing changes, look for derived files such as generated bindings within child/.
This excerpt from herd/_model.goat connects the application configuration to its constituent model files.
app --name goatcms \
--go-prefix code.pozoga.eu/spozoga/goatcms.com/goatapp \
--terminal-prefix APP \
--default-language=en \
--supported-languages=pl,en,de,zh \
--path="goatapp"
include:model --path="_model/**/*.model.goat"Among other steps, herd/gen.goat uses gen:views:load to generate Go contracts and Angular code. The module’s development recipe combines generation, backend, database and frontends. Changes to persistent structures also require reviewing migrations. Update an existing database through a new migration and preserve the applied files.
Data, environments and recipes
| Path | Contents and use |
|---|---|
herd/project.json | Development, frontend, preview, build and translation settings, test suites and CI-facing project scripts. |
herd/dev/frontends.json | The frontend list selected by the project’s development settings. |
herd/fixture.goat and herd/fixtures/ | Bootstrap and import data. The main recipe combines users, blog, docs, pages and shop. herd/fixtures/environment.goat selects a section. |
herd/fixtures/doc/0.1/{pl,en,de,zh}/ | Public Markdown documentation. herd/fixtures/doc/fixture.goat maps files to languages, slugs and translation keys. |
herd/ci/ and herd/stage/ | Test, build, preview, environment validation and deployment recipes. Application-level testing also has recipes in child/ci/. |
herd/deploy.json, herd/deploy/, herd/runtime/, herd/worker/ | Deployment, runtime and worker configuration. Live local configuration lives in env/. Track example files only. |
herd/dist.json and herd/dist/ | CLI distribution settings and templates. The root version file supplies the release version. |
herd/specifications/ and herd/maintenance/ | Technical specifications and project maintenance procedures. |
A .goat recipe composes reusable commands and can call other recipes using run:script. herd/project.json selects the steps and parameters available in the project. Run external tools through approved isolation such as run:docker. Use the relevant subterminal in a heredoc for nested declarations. Fixtures, example values and project settings can use JSON where their format calls for it.
Where to make a change
- Entity field. Start with the active
_model/*.model.goatfile. Check read and write permissions, migration needs and whether to expose the field in a DTO. - Screen or route. Edit
views/or the manager selection inviews/foundation.goat. Types and methods may belong to a separate domain catalogue. - Business rule. Implement it in
child/app/. Define input, output and publication in a contract when a view or client must call it. - Public content. Prepare four language files, registry entries and navigation links. The content appears in an environment after importing the relevant fixture section.
- Shared workflow. Read the
@goatcmsmodule recipe and the project settings. Check thegoatcms-childstarter documentation if the change applies to new projects. The starter may have a smallerherd/tree that grows with the application.
goat re
goat run:script --path=@goatcms/herd/build/project.goat -- --mode=developmentgoat re refreshes modules and generation. The build recipe prepares the application in isolation. Choose the relevant Go, panel, documentation or full-project check. Every production-changing operation, including fixture imports, requires separate explicit confirmation immediately before execution.