Standardize API base resolution and runtime config to prevent mismatches between demo, local, and production requests, especially for profile and marketplace flows.
- Affected files: app/frontend/src/lib/api.ts, app/frontend/src/app/page.tsx, app/frontend/src/app/[username]/page.tsx, app/frontend/src/hooks/providers/productionMarketplaceProvider.ts, app/frontend/src/hooks/providers/productionRealtimeProvider.ts, app/frontend/src/hooks/marketplaceApi.ts, app/frontend/src/hooks/analyticsApi.ts, app/frontend/src/app/layout.tsx, app/frontend/src/app/pay/page.tsx
- Acceptance criteria:
- A single source of truth resolves backend and wallet endpoints consistently across environments.
- Runtime requests fail with a clear error and safe fallback when the API base is misconfigured.
- Browser and SSR code paths avoid mismatched fetch behavior and stale env assumptions.
Standardize API base resolution and runtime config to prevent mismatches between demo, local, and production requests, especially for profile and marketplace flows.