fix production API and storefront routing
Build & Deploy / Build & Push Docker Image (push) Successful in 2m52s
Test / Type Check (all packages) (push) Successful in 57s
Build & Deploy / Deploy to VPS (push) Successful in 3s
Test / API Unit Tests (push) Successful in 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Successful in 45s
Test / Admin Unit Tests (push) Successful in 47s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 59s

Normalize dashboard API base URLs so bare API origins still call /api/v1 endpoints. Reuse the shared dashboard API base on email verification.

Update production storefront URL examples to use the root domain and route footer, policy, and workspace storefront paths through Traefik.
This commit is contained in:
root
2026-07-02 02:02:31 -04:00
parent 8ef61d7005
commit 0dcbe18c54
7 changed files with 9 additions and 7 deletions
+3 -2
View File
@@ -49,10 +49,11 @@ NEXT_PUBLIC_API_URL=https://api.rentaldrivego.ma/api/v1
# Required for production builds. Must be an absolute https:// URL with no trailing slash.
SITE_ORIGIN=https://rentaldrivego.ma
# Marketplace sits at the domain root (Traefik routes /dashboard and /admin to their apps)
# Marketplace/storefront public routes sit at the domain root.
# Traefik routes /explore, /renter, /sign-in, /footer, and app policy pages to the storefront app.
NEXT_PUBLIC_MARKETING_URL=https://rentaldrivego.ma
NEXT_PUBLIC_MARKETPLACE_URL=https://rentaldrivego.ma
NEXT_PUBLIC_STOREFRONT_URL=https://rentaldrivego.ma/storefront
NEXT_PUBLIC_STOREFRONT_URL=https://rentaldrivego.ma
NEXT_PUBLIC_DASHBOARD_URL=https://rentaldrivego.ma/dashboard
NEXT_PUBLIC_ADMIN_URL=https://rentaldrivego.ma/admin
NEXT_PUBLIC_HOMEPAGE_URL=https://rentaldrivego.ma
+1 -1
View File
@@ -33,7 +33,7 @@ NEXT_PUBLIC_API_URL=https://api.example.com/api/v1
NEXT_PUBLIC_MARKETING_URL=https://example.com
NEXT_PUBLIC_MARKETPLACE_URL=https://example.com
NEXT_PUBLIC_HOMEPAGE_URL=https://example.com
NEXT_PUBLIC_STOREFRONT_URL=https://example.com/storefront
NEXT_PUBLIC_STOREFRONT_URL=https://example.com
NEXT_PUBLIC_DASHBOARD_URL=https://example.com/dashboard
NEXT_PUBLIC_ADMIN_URL=https://example.com/admin
NEXT_PUBLIC_PUBLIC_SITE_DOMAIN=example.com
+1 -1
View File
@@ -5,6 +5,7 @@ import { useSearchParams } from 'next/navigation'
import Image from 'next/image'
import PublicShell from '@/components/layout/PublicShell'
import { useDashboardI18n } from '@/components/I18nProvider'
import { API_BASE } from '@/lib/api'
export default function VerifyEmailPage() {
const { language } = useDashboardI18n()
@@ -44,7 +45,6 @@ export default function VerifyEmailPage() {
async function verify() {
try {
const API_BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000/api/v1'
const url = `${API_BASE}/auth/employee/verify-email`
const res = await fetch(url, {
method: 'POST',
+1 -1
View File
@@ -215,7 +215,7 @@ services:
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.storefront.rule=(Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)) && PathPrefix(`/explore`, `/renter`, `/sign-in`)
- traefik.http.routers.storefront.rule=(Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)) && PathPrefix(`/explore`, `/renter`, `/sign-in`, `/footer`, `/app-privacy`, `/app-tc`, `/company-workspace`)
- traefik.http.routers.storefront.entrypoints=websecure
- traefik.http.routers.storefront.tls=true
- traefik.http.routers.storefront.tls.certresolver=letsencrypt
+1
View File
@@ -196,6 +196,7 @@ For production image builds, also define these GitLab CI/CD variables with their
```text
NEXT_PUBLIC_API_URL=https://api.rentaldrivego.ma/api/v1
NEXT_PUBLIC_MARKETPLACE_URL=https://rentaldrivego.ma
NEXT_PUBLIC_STOREFRONT_URL=https://rentaldrivego.ma
NEXT_PUBLIC_DASHBOARD_URL=https://rentaldrivego.ma/dashboard
NEXT_PUBLIC_ADMIN_URL=https://rentaldrivego.ma/admin
```
+1 -1
View File
@@ -49,7 +49,7 @@ SITE_ORIGIN=https://rentaldrivego.ma
NEXT_PUBLIC_MARKETING_URL=https://rentaldrivego.ma
NEXT_PUBLIC_MARKETPLACE_URL=https://rentaldrivego.ma
NEXT_PUBLIC_HOMEPAGE_URL=https://rentaldrivego.ma
NEXT_PUBLIC_STOREFRONT_URL=https://rentaldrivego.ma/storefront
NEXT_PUBLIC_STOREFRONT_URL=https://rentaldrivego.ma
NEXT_PUBLIC_DASHBOARD_URL=https://rentaldrivego.ma/dashboard
NEXT_PUBLIC_ADMIN_URL=https://rentaldrivego.ma/admin
NEXT_PUBLIC_PUBLIC_SITE_DOMAIN=rentaldrivego.ma
+1 -1
View File
@@ -215,7 +215,7 @@ services:
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.storefront.rule=(Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)) && (PathPrefix(`/explore`) || PathPrefix(`/renter`) || PathPrefix(`/sign-in`))
- traefik.http.routers.storefront.rule=(Host(`${PUBLIC_SITE_DOMAIN}`) || Host(`www.${PUBLIC_SITE_DOMAIN}`)) && (PathPrefix(`/explore`) || PathPrefix(`/renter`) || PathPrefix(`/sign-in`) || PathPrefix(`/footer`) || PathPrefix(`/app-privacy`) || PathPrefix(`/app-tc`) || PathPrefix(`/company-workspace`))
- traefik.http.routers.storefront.entrypoints=websecure
- traefik.http.routers.storefront.tls=true
- traefik.http.routers.storefront.tls.certresolver=letsencrypt