feat: initial commit — asaas-checkout template white-label

Template genérico de checkout com ASAAS, parametrizado via env vars.
Inclui fluxo completo: checkout → pedido → polling → webhook → admin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 06:40:41 +02:00
commit 038ce3f556
103 changed files with 20709 additions and 0 deletions

57
.specs/PROJECT.md Normal file
View File

@@ -0,0 +1,57 @@
# PROJECT.md — VixCert
## Visão Geral
Plataforma de venda de certificados digitais (e-CPF, e-CNPJ, SSL, NFe) com checkout próprio integrado ao ASAAS. VixCert é AR credenciada ICP-Brasil.
## Identidade
| Campo | Valor |
|-------|-------|
| Domínio | vixcert.oakia.com.br |
| Stack file | /root/vixcert.yaml |
| Código na VPS | /root/vixcert |
| Repo | github.com/felipesabores/vixcert-final |
| Branch | final |
| Imagem Docker | vixcert:latest (build local) |
| Referência visual | https://boneca.vixcert.com.br (repo vixcert sem -final — não modificar) |
## Stack Técnica
- Next.js 15 + TypeScript + Tailwind + shadcn/ui + Framer Motion
- Docker Swarm + Traefik
## Infraestrutura
| Recurso | Detalhe |
|---------|---------|
| Rede | network_public |
| Banco | Supabase cloud — exceção (ver abaixo) |
| TLS | Traefik + Let's Encrypt |
## Exceções às Convenções
| Convenção | Exceção | Justificativa |
|-----------|---------|---------------|
| Self-hosted / PostgreSQL local | Supabase cloud (projeto xqckfgwskenseorytcxq) | Projeto iniciado antes da convenção self-hosted. Migração desejável, não prioritária. |
| Self-hosted | ASAAS (gateway de pagamento) | Necessário para PIX/Boleto/Cartão |
| Self-hosted | Resend (email transacional) | Necessário para entrega de emails |
## Integrações Externas
| Serviço | Detalhe |
|---------|---------|
| Supabase | PostgreSQL + tabelas: produtos, clientes, pedidos, cupons, agendamentos |
| ASAAS | PIX, Boleto, Cartão — sandbox ativo |
| Resend | Email from: `VixCert <noreply@oakia.com.br>` |
| Evolution API v2 | WhatsApp self-hosted — `https://evolution2.oakia.com.br` — instância: `vixcert` |
## Automações n8n
| Workflow | ID | Webhook |
|---------|-----|---------|
| VixCert — Notificação de Pagamento | tfuwr2t0NEo0dH5g | POST /webhook/vixcert-pagamento |
| VixCert — PIX Gerado | lKrE9vTDnSaUAjMq | POST /webhook/vixcert-pix |
## Deploy
```bash
cd /root/vixcert && bash rebuild.sh
# OBRIGATÓRIO forçar restart (tag sempre latest):
docker service update --image vixcert:latest --force vixcert_vixcert
```
## Aviso Crítico — Edição de Workflows n8n
Sempre atualizar AMBAS as tabelas: `workflow_entity` E `workflow_history` + reiniciar serviço.