The cost is in shell/http.clj,
shell/module_wiring.clj, and above all in what the platform assembles around
them.
-
Authentication. Routes carry :interceptors, two def`s naming
`wagoe.user.shell.http-interceptors/require-authenticated and
require-web-authenticated. Wagoe’s router turns that key into Ring
middleware. Plain reitit.ring ignores it: the routes keep answering and stop
checking who asks. Replace the two def`s with `:middleware from your own
auth.
-
Authorization. Requiring sign-in unless a route says :public true, and
:enforce answering 403 to a route with no rule
(Authorization), are platform behaviour, not
route data. They go with it.
-
Errors. Handlers throw ex-info with :type :validation-error or
:not-found, and the platform picks the status
(Conventions lists them all). Reitit’s exception middleware
dispatches on the same :type:
(exception/create-exception-middleware
(merge exception/default-handlers
{:validation-error (fn [e _] {:status 400 :body (ex-data e)})
:not-found (fn [_ _] {:status 404 :body {:error "not found"}})
:conflict (fn [e _] {:status 409 :body (ex-data e)})}))
-
Mounting. product-routes returns {:api […] :web […] :static []},
which the platform mounts under /api/v1 and /web. Mount them yourself:
[["/api/v1" (api-routes svc)] ["/web" (web-routes svc config)]].
-
OpenAPI. The :openapi route data is what reitit.openapi reads. It stays.
In shell/module_wiring.clj, Integrant stays. Rename the three :wagoe/product-*
keys, hand the repository {:datasource ds} where it took :ctx, and drop the
:wagoe/product key (Wagoe’s module discovery) and the authorization map
(Wagoe’s permission registry).
Once per application, not per module: src/shop/system_config.clj builds its
Integrant config with wagoe.platform.shell.system.config/system-config. That
call is where Jetty, the Reitit router, the middleware stack (params, Muuntaja,
sessions, CSRF, error pages), the HikariCP pool, Aero config loading and the
migration runner come from. You write that system yourself.
Our estimate, not a measurement: an hour per module shaped like product, and
days for the application system, which is the part Wagoe exists to write.