Create a Module
The scaffolder generates a complete FC/IS module quickly.
Interactive wizard (recommended)
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
Non-interactive
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
AI-assisted scaffolding
# 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
What gets generated
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.
Integration steps
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.
Adding fields after the fact
bb scaffold field # Interactive: choose module, field name/type
This writes an ALTER TABLE migration and adds the field to schema.clj.
Other scaffold commands
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.