256ff0814e
Build & Deploy / Build & Push Docker Image (push) Failing after 44s
Build & Deploy / Deploy to VPS (push) Has been skipped
Test / API Unit Tests (push) Failing after 5m0s
Test / Marketplace Unit Tests (push) Failing after 4m51s
Test / Admin Unit Tests (push) Successful in 9m31s
Test / Dashboard Unit Tests (push) Successful in 9m37s
Test / API Integration Tests (push) Successful in 9m54s
- Remove apps/marketplace entirely - Create apps/homepage (port 3000): landing/marketing pages (home, features, pricing, platform-ops, review, legal) - Create apps/storefront (port 3004): vehicle browsing (explore) and renter account (dashboard, profile, notifications) - Duplicate shared components/libs into each app - Update homepage header nav: Home, Features, Pricing instead of Home, Explore - Fix all /explore cross-references in homepage to point to /features - Update docker-compose.dev.yml: new homepage and storefront services, remove marketplace - Update docker-compose.production.yml: split into homepage (main domain) and storefront (path-based routes) - Update Dockerfiles: EXPOSE 3004 instead of 3003 - Update root package.json scripts: homepage/storefront profiles, tests, prod scripts - Add docker-prod-up-homepage.sh and docker-prod-up-storefront.sh, remove marketplace script
75 lines
2.0 KiB
JavaScript
75 lines
2.0 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
|
|
const { buildSecurityHeaders, normalizeAssetPrefix } = require('../../config/nextSecurityHeaders')
|
|
|
|
// The marketplace proxies /dashboard and /admin to their own Next dev servers.
|
|
// Allow those asset-prefix origins so proxied pages can load chunks and HMR.
|
|
const dashboardAssetSource = normalizeAssetPrefix(
|
|
process.env.DASHBOARD_ASSET_PREFIX ?? (process.env.NODE_ENV !== 'production' ? 'http://localhost:3001' : undefined),
|
|
'/dashboard',
|
|
)
|
|
const securityHeaders = buildSecurityHeaders({
|
|
assetSources: [dashboardAssetSource, process.env.ADMIN_ASSET_PREFIX],
|
|
})
|
|
const nextConfig = {
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'res.cloudinary.com',
|
|
},
|
|
],
|
|
},
|
|
transpilePackages: ['@rentaldrivego/types'],
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/:path*',
|
|
headers: securityHeaders,
|
|
},
|
|
]
|
|
},
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/dashboard/dashboard',
|
|
destination: '/dashboard',
|
|
permanent: false,
|
|
},
|
|
{
|
|
source: '/dashboard/dashboard/:path*',
|
|
destination: '/dashboard/:path*',
|
|
permanent: false,
|
|
},
|
|
]
|
|
},
|
|
async rewrites() {
|
|
const dashboardOrigin = process.env.DASHBOARD_INTERNAL_URL ?? 'http://dashboard:3001'
|
|
const adminOrigin = process.env.ADMIN_INTERNAL_URL ?? 'http://admin:3002'
|
|
|
|
return [
|
|
// Dashboard has basePath '/dashboard'. The proxy preserves the prefix
|
|
// so the dashboard can strip it and route internally.
|
|
{
|
|
source: '/dashboard',
|
|
destination: `${dashboardOrigin}/dashboard`,
|
|
},
|
|
{
|
|
source: '/dashboard/:path*',
|
|
destination: `${dashboardOrigin}/dashboard/:path*`,
|
|
},
|
|
// Admin routes (also uses basePath)
|
|
{
|
|
source: '/admin',
|
|
destination: `${adminOrigin}/admin`,
|
|
},
|
|
{
|
|
source: '/admin/:path*',
|
|
destination: `${adminOrigin}/admin/:path*`,
|
|
},
|
|
]
|
|
},
|
|
}
|
|
|
|
module.exports = nextConfig
|