saveinmed/frontend
2026-02-28 08:38:11 -06:00
..
docs Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
e2e Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
public Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
src Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
.env.example Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
.gitignore Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
COMO_ADICIONAR_ENTREGADOR_APPWRITE.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
CONFIGURACAO_COLLECTION_EMPRESAS_DADOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
CONFIGURACAO_COLLECTION_USUARIOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
CONFIGURACAO_COLLECTION_USUARIOS_DATA.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
CONFIGURACAO_COLLECTIONS_APPWRITE.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
CORRECAO_FORMULARIO_EDICAO_PRODUTOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
CORRECAO_MODAL_DETALHES_PRODUTO.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
deno.lock Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
DIAGNOSTICO_ERROS_COLLECTIONS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
Dockerfile Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
eslint.config.mjs Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
IMPLEMENTACAO_COMPLETA_MAPEAMENTO.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
IMPLEMENTACAO_DASHBOARD_DADOS_REAIS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
IMPLEMENTACAO_MERCADOPAGO_CHECKOUT.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
IMPLEMENTACAO_MODAL_EDICAO_PRODUTOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
IMPLEMENTACAO_PAGAMENTOS_CHECKOUT.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
index.html Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
INTEGRACAO_PAGAMENTO_SUCESSO_MERCADOPAGO.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
MARKETPLACE.md Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
MELHORIAS_AUTENTICACAO_AUTH_APPWRITE.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
MELHORIAS_GESTAO_CATALOGO_PRODUTOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
MELHORIAS_MODAL_EDICAO_PRODUTOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
next.config.ts Configure Dockerfile and standalone output for frontend (GHJ pattern) 2026-02-28 08:32:59 -06:00
OTIMIZACOES_PERFORMANCE_DASHBOARD.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
package-lock.json Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
package.json Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
PERMISSOES_COLLECTION_USUARIOS.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
playwright.config.ts Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
pnpm-lock.yaml Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
postcss.config.cjs Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
postcss.config.mjs Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
PRODUTOS_CATALOGO_IMPLEMENTACAO.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
README.md Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
route.ts Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
SOLUCAO_ERROS_REGISTRO.md Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
tailwind.config.ts Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
test-carrinho.js Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
test-completar-registro.js Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
test-pedido.js Update frontend with Next.js version (gohorsejobs pattern) 2026-02-28 08:31:43 -06:00
tsconfig.json Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
tsconfig.node.json Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
vite.config.ts Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00
vitest.config.ts Restore original Vite-based frontend in the monorepo 2026-02-28 08:38:11 -06:00

Frontend — SaveInMed Marketplace

React + Vite + TypeScript + Tailwind CSS

Estrutura de src/

src/
├── assets/         → Logo, imagens estáticas
├── components/     → Componentes reutilizáveis
├── context/        → React Context (auth, tema) — estado global estável
├── hooks/          → Custom hooks
├── layouts/        → Layouts de página (Shell, DashboardLayout)
├── pages/          → Páginas organizadas por contexto e perfil
│     ├── auth/           → Login
│     ├── marketplace/    → Search, Cart, Checkout, Orders, OrderDetails
│     └── dashboard/
│           ├── admin/    → Painel administrativo (role admin)
│           ├── seller/   → Inventário, Produtos, Carteira, Equipe
│           ├── employee/ → Dashboard do colaborador
│           ├── delivery/ → Dashboard do entregador
│           ├── Company.tsx
│           └── MyProfile.tsx
├── services/       → Clientes HTTP por domínio
├── stores/         → Zustand (carrinho, filtros, UI global)
├── types/          → Tipos TypeScript compartilhados
└── utils/          → format, jwt, logger

Importações absolutas

Utilize o alias @/ (aponta para src/):

// ✅ Correto
import { useAuth } from '@/context/AuthContext'

// ❌ Evitar (quebra ao mover o arquivo)
import { useAuth } from '../../context/AuthContext'

Gerenciamento de estado

Estado Estratégia
Auth (JWT, user) Context API (AuthContext)
Tema claro/escuro Context API (ThemeContext)
Carrinho Zustand (cartStore)
Filtros de busca Zustand / usePersistentFilters
Estado UI local useState no componente

Regra: Context apenas para auth e tema. Tudo mais vai para Zustand.

Scripts

pnpm dev      # Dev server (proxy → :8214)
pnpm build    # Build produção
pnpm test     # Testes (Vitest)
pnpm lint     # ESLint