Frontend completo (Etapas 11-18) e extensões de backend (Etapas 13 e 18)
Adiciona o frontend Next.js em frontend/ (setup, design system, autenticação/tema, layout/navegação, área master, área tenant completa: clientes, produtos, vendas, recebimentos, whatsapp, e-mail, alertas, equipe e perfil). Estende o backend de forma aditiva e autorizada: cookie httpOnly para refresh token (Etapa 13) e CRUD de equipe + edição de perfil do tenant (Etapa 18, módulo src/modules/equipe/ novo e PUT /tenant/perfil). Detalhes completos em Etapas/V2/*. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import path from 'path';
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
// `logo_url` do tenant (Etapa 8/18) é servido pelo backend numa origem
|
||||
// diferente da do frontend (`NEXT_PUBLIC_API_URL`, ex: :3000 vs :3001) —
|
||||
// `next/image` recusa otimizar imagens de origem não configurada, então
|
||||
// precisa entrar em `remotePatterns` (ver `lib/api/asset-url.ts`, que monta
|
||||
// a URL absoluta consumida por `TenantBrand`/`/app/perfil`).
|
||||
const apiUrl = new URL(process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:3000');
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Repo tem dois lockfiles (backend na raiz, frontend aqui) — fixa a raiz
|
||||
// do workspace para o Turbopack não tentar inferir a errada.
|
||||
turbopack: {
|
||||
root: path.join(__dirname),
|
||||
},
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{
|
||||
protocol: apiUrl.protocol.replace(':', '') as 'http' | 'https',
|
||||
hostname: apiUrl.hostname,
|
||||
...(apiUrl.port ? { port: apiUrl.port } : {}),
|
||||
pathname: '/uploads/**',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
Reference in New Issue
Block a user