feat: complete modular platform architecture (Phases 1-5)

Phase 1 - Vendor Router Integration:
- Wire up vendor module routers in app/api/v1/vendor/__init__.py
- Use lazy imports via __getattr__ to avoid circular dependencies

Phase 2 - Extract Remaining Modules:
- Create 6 new module directories: customers, cms, analytics, messaging,
  dev_tools, monitoring
- Each module has definition.py and route wrappers
- Update registry to import from extracted modules

Phase 3 - Database Table Migration:
- Add PlatformModule junction table for auditable module tracking
- Add migration zc2m3n4o5p6q7_add_platform_modules_table.py
- Add modules relationship to Platform model
- Update ModuleService with JSON-to-junction-table migration

Phase 4 - Module-Specific Configuration UI:
- Add /api/v1/admin/module-config/* endpoints
- Add module-config.html template and JS

Phase 5 - Integration Tests:
- Add tests/fixtures/module_fixtures.py
- Add tests/integration/api/v1/admin/test_modules.py
- Add tests/integration/api/v1/modules/test_module_access.py

Architecture fixes:
- Fix JS-003 errors: use ...data() directly in Alpine components
- Fix JS-005 warnings: add init() guards to prevent duplicate init
- Fix API-001 errors: add MenuActionResponse Pydantic model
- Add FE-008 noqa for dynamic number input in template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-26 18:19:00 +01:00
parent f29f1113cd
commit c419090531
55 changed files with 4059 additions and 206 deletions

View File

@@ -0,0 +1,21 @@
# app/modules/dev_tools/__init__.py
"""
Dev-Tools Module - Developer tools and utilities.
This module provides:
- Component library browser
- Icon browser
- Development utilities
Routes:
- Admin: (page routes only, minimal API)
- Vendor: None
Menu Items:
- Admin: components, icons
- Vendor: None
"""
from app.modules.dev_tools.definition import dev_tools_module
__all__ = ["dev_tools_module"]

View File

@@ -0,0 +1,35 @@
# app/modules/dev_tools/definition.py
"""
Dev-Tools module definition.
Defines the dev-tools module including its features, menu items,
and route configurations.
Note: This module primarily provides page routes, not API routes.
"""
from app.modules.base import ModuleDefinition
from models.database.admin_menu_config import FrontendType
# Dev-Tools module definition
dev_tools_module = ModuleDefinition(
code="dev-tools",
name="Developer Tools",
description="Component library and icon browser for development.",
features=[
"component_library", # UI component browser
"icon_browser", # Icon library browser
],
menu_items={
FrontendType.ADMIN: [
"components", # Component library page
"icons", # Icon browser page
],
FrontendType.VENDOR: [], # No vendor menu items
},
is_core=False,
)
__all__ = ["dev_tools_module"]

View File

@@ -0,0 +1,15 @@
# app/modules/dev_tools/routes/__init__.py
"""
Dev-Tools module route registration.
This module provides functions to register dev-tools routes
with module-based access control.
Note: Dev-Tools module has primarily page routes, not API routes.
The page routes are defined in admin/vendor page handlers.
"""
# Dev-tools has minimal API routes - primarily page routes
# No auto-imports needed
__all__ = []