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,11 +1,11 @@
# app/modules/billing/routes/api/public.py
# app/modules/billing/routes/api/platform.py
"""
Public pricing API endpoints.
Platform pricing API endpoints.
Provides subscription tier and add-on product information
for the marketing homepage and signup flow.
All endpoints are public (no authentication required).
All endpoints are unauthenticated (no authentication required).
"""
from fastapi import APIRouter, Depends

View File

@@ -1,8 +1,8 @@
# app/modules/billing/routes/pages/public.py
# app/modules/billing/routes/pages/platform.py
"""
Billing Public Page Routes (HTML rendering).
Billing Platform Page Routes (HTML rendering).
Public (unauthenticated) pages for pricing and signup:
Platform (unauthenticated) pages for pricing and signup:
- Pricing page
- Signup wizard
- Signup success
@@ -14,7 +14,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.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
router = APIRouter()
@@ -57,12 +57,12 @@ async def pricing_page(
"""
Standalone pricing page with detailed tier comparison.
"""
context = get_public_context(request, db)
context = get_platform_context(request, db)
context["tiers"] = _get_tiers_data()
context["page_title"] = "Pricing"
return templates.TemplateResponse(
"billing/public/pricing.html",
"billing/platform/pricing.html",
context,
)
@@ -86,14 +86,14 @@ async def signup_page(
- tier: Pre-selected tier code
- annual: Pre-select annual billing
"""
context = get_public_context(request, db)
context = get_platform_context(request, db)
context["page_title"] = "Start Your Free Trial"
context["selected_tier"] = tier
context["is_annual"] = annual
context["tiers"] = _get_tiers_data()
return templates.TemplateResponse(
"billing/public/signup.html",
"billing/platform/signup.html",
context,
)
@@ -111,11 +111,11 @@ async def signup_success_page(
Shown after successful account creation.
"""
context = get_public_context(request, db)
context = get_platform_context(request, db)
context["page_title"] = "Welcome to Wizamart!"
context["vendor_code"] = vendor_code
return templates.TemplateResponse(
"billing/public/signup-success.html",
"billing/platform/signup-success.html",
context,
)

View File

@@ -1,6 +1,6 @@
{# app/templates/platform/pricing.html #}
{# Standalone Pricing Page #}
{% extends "public/base.html" %}
{% extends "platform/base.html" %}
{% block title %}{{ _("cms.platform.pricing.title") }} - Wizamart{% endblock %}

View File

@@ -1,6 +1,6 @@
{# app/templates/platform/signup-success.html #}
{# Signup Success Page #}
{% extends "public/base.html" %}
{% extends "platform/base.html" %}
{% block title %}{{ _("cms.platform.success.title") }}{% endblock %}

View File

@@ -1,6 +1,6 @@
{# app/templates/platform/signup.html #}
{# Multi-step Signup Wizard #}
{% extends "public/base.html" %}
{% extends "platform/base.html" %}
{% block title %}Start Your Free Trial - Wizamart{% endblock %}
@@ -321,7 +321,7 @@ function signupWizard() {
async startSignup() {
this.loading = true;
try {
const response = await fetch('/api/v1/public/signup/start', {
const response = await fetch('/api/v1/platform/signup/start', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -352,7 +352,7 @@ function signupWizard() {
try {
// First lookup the vendor
const lookupResponse = await fetch('/api/v1/public/letzshop-vendors/lookup', {
const lookupResponse = await fetch('/api/v1/platform/letzshop-vendors/lookup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: this.letzshopUrl })
@@ -364,7 +364,7 @@ function signupWizard() {
this.letzshopVendor = lookupData.vendor;
// Claim the vendor
const claimResponse = await fetch('/api/v1/public/signup/claim-vendor', {
const claimResponse = await fetch('/api/v1/platform/signup/claim-vendor', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -411,7 +411,7 @@ function signupWizard() {
this.accountError = null;
try {
const response = await fetch('/api/v1/public/signup/create-account', {
const response = await fetch('/api/v1/platform/signup/create-account', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -461,7 +461,7 @@ function signupWizard() {
// Get SetupIntent
try {
const response = await fetch('/api/v1/public/signup/setup-payment', {
const response = await fetch('/api/v1/platform/signup/setup-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ session_id: this.sessionId })
@@ -500,7 +500,7 @@ function signupWizard() {
}
// Complete signup
const response = await fetch('/api/v1/public/signup/complete', {
const response = await fetch('/api/v1/platform/signup/complete', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({