Component names now reflect filesystem location using / as path separator and : as namespace separator for shared components: ~sx-header → ~layouts/header ~layout-app-body → ~shared:layout/app-body ~blog-admin-dashboard → ~admin/dashboard 209 files, 4,941 replacements across all services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
4.1 KiB
Plaintext
50 lines
4.1 KiB
Plaintext
;; ---------------------------------------------------------------------------
|
|
;; Glue Decoupling
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
(defcomp ~plans/glue-decoupling/plan-glue-decoupling-content ()
|
|
(~docs/page :title "Cross-App Decoupling via Glue Services"
|
|
|
|
(~docs/section :title "Context" :id "context"
|
|
(p "All cross-domain FK constraints have been dropped (with pragmatic exceptions for OrderItem.product_id and CartItem). Cross-domain writes go through internal HTTP and activity bus. However, " (strong "25+ cross-app model imports remain") " — apps still import from each other's models/ directories. This means every app needs every other app's code on disk to start.")
|
|
(p "The goal: eliminate all cross-app model imports. Every app only imports from its own models/, from shared/, and from a new glue/ service layer."))
|
|
|
|
(~docs/section :title "Current state" :id "current"
|
|
(p "Apps are partially decoupled via HTTP interfaces (fetch_data, call_action, send_internal_activity) and DTOs. The Cart microservice split (relations, likes, orders) is complete. But direct model imports persist in:")
|
|
(ul :class "list-disc pl-5 text-stone-700 space-y-1"
|
|
(li (strong "Cart") " — 9 files importing from market, events, blog")
|
|
(li (strong "Blog") " — 8 files importing from cart, events, market")
|
|
(li (strong "Events") " — 5 files importing from blog, market, cart")
|
|
(li (strong "Market") " — 1 file importing from blog")))
|
|
|
|
(~docs/section :title "What remains" :id "remains"
|
|
(div :class "space-y-3"
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "1. glue/services/pages.py")
|
|
(p :class "text-sm text-stone-600" "Dict-based Post access for non-blog apps: get_page_by_slug, get_page_by_id, get_pages_by_ids, page_exists, search_posts."))
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "2. glue/services/page_config.py")
|
|
(p :class "text-sm text-stone-600" "PageConfig CRUD: get_page_config, get_or_create_page_config, get_page_configs_by_ids."))
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "3. glue/services/calendars.py")
|
|
(p :class "text-sm text-stone-600" "Calendar queries + entry associations (from blog): get_calendars_for_page, toggle_entry_association, get_associated_entries."))
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "4. glue/services/marketplaces.py")
|
|
(p :class "text-sm text-stone-600" "MarketPlace CRUD (from blog+events): get_marketplaces_for_page, create_marketplace, soft_delete_marketplace."))
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "5. glue/services/cart_items.py")
|
|
(p :class "text-sm text-stone-600" "CartItem/CalendarEntry queries for cart: get_cart_items, find_or_create_cart_item, clear_cart_for_order."))
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "6. glue/services/products.py")
|
|
(p :class "text-sm text-stone-600" "Minimal Product access for cart orders: get_product."))
|
|
(div :class "rounded border border-stone-200 p-3"
|
|
(h4 :class "font-semibold text-stone-700" "7. Model registration + cleanup")
|
|
(p :class "text-sm text-stone-600" "register_models() in glue/setup.py, update all app.py files, delete moved service files."))))
|
|
|
|
(~docs/section :title "Docker consideration" :id "docker"
|
|
(p :class "text-stone-600" "For glue services to work in Docker (single app per container), model files from other apps must be importable. Recommended: try/except at import time — glue services that can't import a model raise ImportError at call time, which only happens if called from the wrong app."))))
|
|
|
|
;; ---------------------------------------------------------------------------
|
|
;; Social Sharing
|
|
;; ---------------------------------------------------------------------------
|