bb scaffold generate
The scaffolder generates a complete FC/IS module quickly.
bb scaffold generate
The wizard walks you through:
Module name (e.g. product)
Entity name (e.g. Product)
Fields with types and constraints
Shows a summary and the equivalent raw command
Runs the generator
bb scaffold generate \
--module-name product \
--entity Product \
--field name:string:required \
--field sku:string:required:unique \
--field price:decimal:required \
--field description:string
# Preview without writing
bb scaffold generate --dry-run \
--module-name product \
--entity Product \
--field name:string:required
# Interactive confirm
bb scaffold ai "product module with name, price, and stock quantity"
# Non-interactive
bb scaffold ai "product module with name, price, and stock quantity" --yes
For a product module, the scaffolder creates:
9 source files: schema, ports, core (product, ui), shell (service, persistence,
http, web_handlers, module_wiring)
3 test files: core unit, repository, service
An up and a down migration
A commented seed example in resources/seeds/dev.edn
--no-http and --no-web leave out the API routes or the web UI.
After scaffolding:
# 1. Write :wagoe/product into every resources/conf/<profile>/config.edn
bb scaffold integrate product
# 2. Apply the migration
clojure -M:migrate up
# 3. Reload the system
# In REPL: (reset)
The config key is the whole registration: the module’s routes come from its
module_wiring.clj.
bb scaffold field # Interactive: choose module, field name/type
This writes an ALTER TABLE migration and adds the field to schema.clj.
bb scaffold entity # Add an entity to an existing module
bb scaffold endpoint # Add an endpoint to an existing module
bb scaffold adapter # Generate a new adapter implementation
bb scaffold subscriber # Add an event subscriber to a module
bb scaffold # Show all commands and help
To create a new project (rather than a module inside this one), use the Wagoe
CLI: wagoe new my-app.
See Scaffolder library for the full reference.
Can you improve this documentation? These fine people already did:
Thijs Creemers & thijscreemersEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |