From 1cd5500b80f96c4e1e32cde3b57fe6105e94568a Mon Sep 17 00:00:00 2001 From: Bakery Admin Date: Sun, 25 Jan 2026 20:32:14 +0100 Subject: [PATCH] Fix some issues 2 --- frontend/Dockerfile.kubernetes | 1 + frontend/Dockerfile.kubernetes.debug | 2 +- frontend/nginx.conf | 10 ++++------ frontend/src/api/client/apiClient.ts | 1 + .../components/domain/auth/RegistrationContainer.tsx | 2 +- services/notification/app/api/public_contact.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/Dockerfile.kubernetes b/frontend/Dockerfile.kubernetes index 131464d0..1ac9f494 100644 --- a/frontend/Dockerfile.kubernetes +++ b/frontend/Dockerfile.kubernetes @@ -11,6 +11,7 @@ ENV NODE_ENV=production ENV VITE_API_URL=/api ENV VITE_APP_TITLE="BakeWise" ENV VITE_APP_VERSION="1.0.0" +ENV VITE_STRIPE_PUBLISHABLE_KEY="pk_test_51QuxKyIzCdnBmAVTGM8fvXYkItrBUILz6lHYwhAva6ZAH1HRi0e8zDRgZ4X3faN0zEABp5RHjCVBmMJL3aKXbaC200fFrSNnPl" RUN npm run build # Stage 2: Serve with nginx diff --git a/frontend/Dockerfile.kubernetes.debug b/frontend/Dockerfile.kubernetes.debug index 728815d5..22e5c402 100644 --- a/frontend/Dockerfile.kubernetes.debug +++ b/frontend/Dockerfile.kubernetes.debug @@ -33,7 +33,7 @@ ENV VITE_APP_VERSION="1.0.0-debug" ENV VITE_PILOT_MODE_ENABLED="false" ENV VITE_PILOT_COUPON_CODE="PILOT2025" ENV VITE_PILOT_TRIAL_MONTHS="3" -ENV VITE_STRIPE_PUBLISHABLE_KEY="pk_test_" +ENV VITE_STRIPE_PUBLISHABLE_KEY="pk_test_51QuxKyIzCdnBmAVTGM8fvXYkItrBUILz6lHYwhAva6ZAH1HRi0e8zDRgZ4X3faN0zEABp5RHjCVBmMJL3aKXbaC200fFrSNnPl" # Set Node.js memory limit for the build process ENV NODE_OPTIONS="--max-old-space-size=4096" diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 7cb35f9b..3bed1989 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -93,13 +93,11 @@ server { } # Main location block for SPA routing + # Note: JS/CSS files are handled by specific location blocks above with try_files $uri =404 + # This ensures missing assets return 404 instead of index.html (which causes MIME type errors) location / { - try_files $uri $uri/ @fallback; - } - - # Fallback for SPA routing - serve index.html - location @fallback { - rewrite ^.*$ /index.html last; + # Don't fallback to index.html for asset files - they should 404 if missing + try_files $uri $uri/ /index.html; } # Health check endpoint diff --git a/frontend/src/api/client/apiClient.ts b/frontend/src/api/client/apiClient.ts index d64bf4df..a47b040a 100644 --- a/frontend/src/api/client/apiClient.ts +++ b/frontend/src/api/client/apiClient.ts @@ -82,6 +82,7 @@ class ApiClient { '/public/contact', '/public/feedback', '/public/prelaunch-subscribe', + '/plans', // Subscription plans metadata - public for registration flow ]; // Endpoints that require authentication but not a tenant ID (user-level endpoints) diff --git a/frontend/src/components/domain/auth/RegistrationContainer.tsx b/frontend/src/components/domain/auth/RegistrationContainer.tsx index cbe4ac0b..2e4cf06f 100644 --- a/frontend/src/components/domain/auth/RegistrationContainer.tsx +++ b/frontend/src/components/domain/auth/RegistrationContainer.tsx @@ -26,7 +26,7 @@ const getStripeKey = (): string => { if (typeof window !== 'undefined' && window.__RUNTIME_CONFIG__?.VITE_STRIPE_PUBLISHABLE_KEY) { return window.__RUNTIME_CONFIG__.VITE_STRIPE_PUBLISHABLE_KEY; } - return import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY || 'pk_test_51234567890123456789012345678901234567890123456789012345678901234567890123456789012345'; + return import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY || 'pk_test_51QuxKyIzCdnBmAVTGM8fvXYkItrBUILz6lHYwhAva6ZAH1HRi0e8zDRgZ4X3faN0zEABp5RHjCVBmMJL3aKXbaC200fFrSNnPl'; }; // Force Stripe to use test environment by loading from test endpoint diff --git a/services/notification/app/api/public_contact.py b/services/notification/app/api/public_contact.py index 7f67aea7..68f3b2db 100644 --- a/services/notification/app/api/public_contact.py +++ b/services/notification/app/api/public_contact.py @@ -18,7 +18,7 @@ from app.core.config import settings logger = structlog.get_logger() -router = APIRouter(prefix="/api/v1/public", tags=["public-contact"]) +router = APIRouter(prefix="/public", tags=["public-contact"]) # ================================================================ # PYDANTIC MODELS