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:
@@ -24,6 +24,12 @@ from app.modules.billing.definition import billing_module
|
||||
from app.modules.inventory.definition import inventory_module
|
||||
from app.modules.marketplace.definition import marketplace_module
|
||||
from app.modules.orders.definition import orders_module
|
||||
from app.modules.customers.definition import customers_module
|
||||
from app.modules.cms.definition import cms_module
|
||||
from app.modules.analytics.definition import analytics_module
|
||||
from app.modules.messaging.definition import messaging_module
|
||||
from app.modules.dev_tools.definition import dev_tools_module
|
||||
from app.modules.monitoring.definition import monitoring_module
|
||||
|
||||
|
||||
# =============================================================================
|
||||
@@ -93,127 +99,18 @@ MODULES: dict[str, ModuleDefinition] = {
|
||||
"orders": orders_module,
|
||||
# Marketplace module - imported from app/modules/marketplace/
|
||||
"marketplace": marketplace_module,
|
||||
"customers": ModuleDefinition(
|
||||
code="customers",
|
||||
name="Customer Management",
|
||||
description="Customer database, profiles, and segmentation.",
|
||||
features=[
|
||||
"customer_view",
|
||||
"customer_export",
|
||||
"customer_profiles",
|
||||
"customer_segmentation",
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
"customers",
|
||||
],
|
||||
FrontendType.VENDOR: [
|
||||
"customers",
|
||||
],
|
||||
},
|
||||
),
|
||||
"cms": ModuleDefinition(
|
||||
code="cms",
|
||||
name="Content Management",
|
||||
description="Content pages, media library, and vendor themes.",
|
||||
features=[
|
||||
"cms_basic",
|
||||
"cms_custom_pages",
|
||||
"cms_unlimited_pages",
|
||||
"cms_templates",
|
||||
"cms_seo",
|
||||
"media_library",
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
"content-pages",
|
||||
"vendor-themes",
|
||||
],
|
||||
FrontendType.VENDOR: [
|
||||
"content-pages",
|
||||
"media",
|
||||
],
|
||||
},
|
||||
),
|
||||
"analytics": ModuleDefinition(
|
||||
code="analytics",
|
||||
name="Analytics & Reporting",
|
||||
description="Dashboard analytics, custom reports, and data exports.",
|
||||
features=[
|
||||
"basic_reports",
|
||||
"analytics_dashboard",
|
||||
"custom_reports",
|
||||
"export_reports",
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
# Analytics appears in dashboard for admin
|
||||
],
|
||||
FrontendType.VENDOR: [
|
||||
"analytics",
|
||||
],
|
||||
},
|
||||
),
|
||||
"messaging": ModuleDefinition(
|
||||
code="messaging",
|
||||
name="Messaging & Notifications",
|
||||
description="Internal messages, customer communication, and notifications.",
|
||||
features=[
|
||||
"customer_messaging",
|
||||
"internal_messages",
|
||||
"notification_center",
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
"messages",
|
||||
"notifications",
|
||||
],
|
||||
FrontendType.VENDOR: [
|
||||
"messages",
|
||||
"notifications",
|
||||
],
|
||||
},
|
||||
),
|
||||
"dev-tools": ModuleDefinition(
|
||||
code="dev-tools",
|
||||
name="Developer Tools",
|
||||
description="Component library and icon browser for development.",
|
||||
features=[
|
||||
"component_library",
|
||||
"icon_browser",
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
"components",
|
||||
"icons",
|
||||
],
|
||||
FrontendType.VENDOR: [],
|
||||
},
|
||||
),
|
||||
"monitoring": ModuleDefinition(
|
||||
code="monitoring",
|
||||
name="Platform Monitoring",
|
||||
description="Logs, background tasks, imports, and system health.",
|
||||
features=[
|
||||
"application_logs",
|
||||
"background_tasks",
|
||||
"import_jobs",
|
||||
"capacity_monitoring",
|
||||
"testing_hub",
|
||||
"code_quality",
|
||||
],
|
||||
menu_items={
|
||||
FrontendType.ADMIN: [
|
||||
"imports",
|
||||
"background-tasks",
|
||||
"logs",
|
||||
"platform-health",
|
||||
"testing",
|
||||
"code-quality",
|
||||
],
|
||||
FrontendType.VENDOR: [],
|
||||
},
|
||||
),
|
||||
# Customers module - imported from app/modules/customers/
|
||||
"customers": customers_module,
|
||||
# CMS module - imported from app/modules/cms/
|
||||
"cms": cms_module,
|
||||
# Analytics module - imported from app/modules/analytics/
|
||||
"analytics": analytics_module,
|
||||
# Messaging module - imported from app/modules/messaging/
|
||||
"messaging": messaging_module,
|
||||
# Dev-Tools module - imported from app/modules/dev_tools/
|
||||
"dev-tools": dev_tools_module,
|
||||
# Monitoring module - imported from app/modules/monitoring/
|
||||
"monitoring": monitoring_module,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user