diff --git a/GUIA-NGINX.md b/GUIA-NGINX.md new file mode 100644 index 00000000..882748a5 --- /dev/null +++ b/GUIA-NGINX.md @@ -0,0 +1,116 @@ +# Guia Rapido - Configurar Nginx (SPA React) + +## O Problema + +URLs como `avanzato.com.br/avaliacao` dao 404 quando acessadas diretamente. +Funcionam apenas quando clica no menu (navegacao interna do React). + +## A Solucao + +O Nginx precisa redirecionar todas as rotas para `index.html`. + +## Passo a Passo + +### 1. Copiar a config do projeto para o servidor + +No seu Mac, envie o arquivo `nginx.conf` do projeto para o servidor: + +```bash +# Enviar o arquivo nginx.conf do projeto para o servidor +scp /Users/avanzato/Projetos/Avanzato/avanzato-site/app/nginx.conf root@SEU_SERVIDOR:/etc/nginx/sites-available/avanzato +``` + +Ou, se ja estiver logado no servidor: + +```bash +# Logar no servidor +ssh root@SEU_SERVIDOR + +# Criar o arquivo de config +cat > /etc/nginx/sites-available/avanzato << 'EOF' +server { + listen 80; + server_name avanzato.com.br; + + root /var/www/avanzato; + index index.html; + + # ESSA LINHA E A CHAVE - redireciona tudo para index.html + location / { + try_files $uri $uri/ /index.html; + } + + # Cache para assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 6M; + add_header Cache-Control "public"; + } + + # Seguranca + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + + # Bloquear arquivos ocultos + location ~ /\. { + deny all; + } +} +EOF +``` + +### 2. Ativar o site + +```bash +# Criar link simbolico (ativa o site) +ln -s /etc/nginx/sites-available/avanzato /etc/nginx/sites-enabled/avanzato + +# Remover o default (se existir) +rm -f /etc/nginx/sites-enabled/default +``` + +### 3. Testar e aplicar + +```bash +# Testar a configuracao (mostra erros se houver) +nginx -t + +# Se der OK, recarregar o Nginx +systemctl reload nginx +``` + +### 4. Verificar se funcionou + +```bash +# Testar uma rota direta +curl -I https://avanzato.com.br/avaliacao + +# Deve retornar HTTP 200, nao 404 +``` + +--- + +## Comandos Uteis + +| Comando | O que faz | +|---------|-----------| +| `nginx -t` | Testa a configuracao (sem aplicar) | +| `systemctl reload nginx` | Recarrega config sem derrubar o site | +| `systemctl restart nginx` | Reinicia o Nginx | +| `systemctl status nginx` | Verifica se esta rodando | +| `tail -f /var/log/nginx/error.log` | Ver erros em tempo real | + +--- + +## Importante + +Se voce usa **Apache** em vez de Nginx, a config esta no arquivo `.htaccess` que ja vai no `dist/`: + +```apache +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} -f [OR] +RewriteCond %{REQUEST_FILENAME} -d +RewriteRule ^ - [L] +RewriteRule ^ index.html [L] +``` + +Basta garantir que o `.htaccess` esta na raiz do site e o `mod_rewrite` esta ativado. diff --git a/avanzato-dist.zip b/avanzato-dist.zip deleted file mode 100644 index d99b7684..00000000 Binary files a/avanzato-dist.zip and /dev/null differ diff --git a/avanzato-source.zip b/avanzato-source.zip deleted file mode 100644 index e9e2348f..00000000 Binary files a/avanzato-source.zip and /dev/null differ diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 00000000..1518b34a Binary files /dev/null and b/public/logo.png differ diff --git a/public/version.json b/public/version.json new file mode 100644 index 00000000..47ebfb96 --- /dev/null +++ b/public/version.json @@ -0,0 +1,5 @@ +{ + "version": "1.0.9", + "date": "2026-05-29", + "environment": "development" +} diff --git a/src/config/site.ts b/src/config/site.ts index cd312421..5070b201 100644 --- a/src/config/site.ts +++ b/src/config/site.ts @@ -14,14 +14,14 @@ export const LOGO = { // Opcao 1: SVG inline (deixe vazio se for usar imagem) svgInline: '', - // Opcao 2: URL da imagem (use quando o logo esta hospedado externamente) - // Exemplo: '/assets/logo.png' para arquivo local - // Exemplo: 'https://avanzato.com.br/logo.png' para imagem externa - imageUrl: 'https://avanzato.com.br/logo.png', + // Opcao 2: URL da imagem + // Use '/logo.png' para carregar da pasta public/ (funciona em qualquer ambiente) + // Use 'https://avanzato.com.br/logo.png' apenas se for carregar de servidor externo + imageUrl: '/logo.png', - // Texto ao lado do logo (deixe vazio se nao quiser texto) - text: 'avanzato', - textHighlight: '.', // O ponto verde apos o texto + // Texto ao lado do logo (deixe vazio se o logo ja tiver texto) + text: '', + textHighlight: '', // Link do logo (para onde vai quando clica) href: '/', diff --git a/src/sections/Footer.tsx b/src/sections/Footer.tsx index cae5b8e1..4356b313 100644 --- a/src/sections/Footer.tsx +++ b/src/sections/Footer.tsx @@ -1,3 +1,4 @@ +import { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { Facebook, Youtube, Linkedin, Instagram, ArrowUp, MapPin } from 'lucide-react'; import { LOGO, SOCIAL_LINKS, ADDRESSES, FOOTER_LINKS, COMPANY } from '../config/site'; @@ -11,6 +12,15 @@ const socialIcons: Record = { }; const Footer = () => { + const [version, setVersion] = useState(''); + + useEffect(() => { + fetch('/version.json') + .then(r => r.json()) + .then(data => setVersion(data.version)) + .catch(() => setVersion('')); + }, []); + const scrollToTop = () => { window.scrollTo({ top: 0, behavior: 'smooth' }); }; @@ -161,7 +171,7 @@ const Footer = () => {

© {new Date().getFullYear()} {COMPANY.name}. Todos os direitos reservados. - v1.0.4 + {version && v{version}}

diff --git a/src/sections/Navigation.tsx b/src/sections/Navigation.tsx index 45c4cdc9..f44e4703 100644 --- a/src/sections/Navigation.tsx +++ b/src/sections/Navigation.tsx @@ -46,14 +46,8 @@ const Navigation = () => {
{/* Logo - importado de config/site.ts */} - + {renderLogo()} - {LOGO.text && ( - - {LOGO.text} - {LOGO.textHighlight} - - )} {/* Desktop Navigation - importado de config/site.ts */}