refactor: rename public routes and templates to platform

Complete the public -> platform naming migration across the codebase.
This aligns with the naming convention where "platform" refers to
the marketing/public-facing pages of the platform itself.

Changes:
- Update all imports from public to platform modules
- Update template references from public/ to platform/
- Update route registrations to use platform prefix
- Update documentation to reflect new naming
- Update test files for platform API endpoints

Files affected:
- app/api/main.py - router imports
- app/modules/*/routes/*/platform.py - route definitions
- app/modules/*/templates/*/platform/ - template files
- app/modules/routes.py - route discovery
- docs/* - documentation updates
- tests/integration/api/v1/platform/ - test files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 18:49:39 +01:00
parent 967f08e4ba
commit fb8cb14506
44 changed files with 980 additions and 327 deletions

View File

@@ -1,8 +1,8 @@
# app/modules/cms/routes/pages/public.py
# app/modules/cms/routes/pages/platform.py
"""
CMS Public Page Routes (HTML rendering).
CMS Platform Page Routes (HTML rendering).
Public (unauthenticated) pages for platform content:
Platform (unauthenticated) pages for platform content:
- Homepage
- Generic content pages (/{slug} catch-all)
"""
@@ -16,7 +16,7 @@ from sqlalchemy.orm import Session
from app.core.database import get_db
from app.modules.billing.models import TIER_LIMITS, TierCode
from app.modules.cms.services import content_page_service
from app.modules.core.utils.page_context import get_public_context
from app.modules.core.utils.page_context import get_platform_context
from app.templates_config import templates
logger = logging.getLogger(__name__)
@@ -147,19 +147,19 @@ async def homepage(
if cms_homepage:
# Use CMS-based homepage with template selection
context = get_public_context(request, db)
context = get_platform_context(request, db)
context["page"] = cms_homepage
context["tiers"] = _get_tiers_data()
template_name = cms_homepage.template or "default"
template_path = f"cms/public/homepage-{template_name}.html"
template_path = f"cms/platform/homepage-{template_name}.html"
logger.info(f"[HOMEPAGE] Rendering CMS homepage with template: {template_path}")
return templates.TemplateResponse(template_path, context)
# Fallback: Default wizamart homepage (no CMS content)
logger.info("[HOMEPAGE] No CMS homepage found, using default wizamart template")
context = get_public_context(request, db)
context = get_platform_context(request, db)
context["tiers"] = _get_tiers_data()
# Add-ons (hardcoded for now, will come from DB)
@@ -196,7 +196,7 @@ async def homepage(
]
return templates.TemplateResponse(
"cms/public/homepage-wizamart.html",
"cms/platform/homepage-wizamart.html",
context,
)
@@ -231,11 +231,11 @@ async def content_page(
if not page:
raise HTTPException(status_code=404, detail=f"Page not found: {slug}")
context = get_public_context(request, db)
context = get_platform_context(request, db)
context["page"] = page
context["page_title"] = page.title
return templates.TemplateResponse(
"cms/public/content-page.html",
"cms/platform/content-page.html",
context,
)