From 975557e10cfc39b2f5c48cbfcd42edd31816239e Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Sat, 17 Jan 2026 20:28:10 -0600 Subject: [PATCH] docs(nc1): update inventory, architecture and deployment guide --- vps/nc1/architecture.md | 31 +++++++++++++++++++++++++++++++ vps/nc1/deployment_guide.md | 18 ++++++++++++++++++ vps/nc1/nc1.md | 28 ++++++++++++++++++++++++++++ vps/nc1/services_inventory.md | 7 ++++++- 4 files changed, 83 insertions(+), 1 deletion(-) diff --git a/vps/nc1/architecture.md b/vps/nc1/architecture.md index 7da6611..235035b 100644 --- a/vps/nc1/architecture.md +++ b/vps/nc1/architecture.md @@ -60,6 +60,20 @@ flowchart LR INVFE[Frontend App] end + %% Virtual Fashion Ecosystem + subgraph VFashion ["Virtual Fashion"] + VFBE[Backend API] + VFFE[Frontend Web] + VFMIN[MinIO Storage] + end + + %% Invoice Ninja Ecosystem + subgraph InvoiceNinja ["Invoice Ninja"] + INAPP[App FPM] + INWEB[Web Nginx] + INDB[(MariaDB)] + end + %% Rotas do Traefik T --> VW T --> FG @@ -77,7 +91,12 @@ flowchart LR T --> Q1ABE T --> Q1AFE T --> SXBE + T --> SXBE T --> SXFE + T --> VFBE + T --> VFFE + T --> VFMIN + T --> INWEB %% Conexões de Banco de Dados (Link Styles) linkStyle default stroke-width:2px,fill:none,stroke:gray; @@ -92,7 +111,10 @@ flowchart LR Q1ABE -.-> PG SXBE -.-> PG SIMB === PG + SIMB === PG SIMB === RD + VFBE -.-> PG + INAPP === INDB ``` ## Descrição dos Componentes @@ -120,6 +142,15 @@ Plataformas de e-commerce. Backend em Go, Frontend em Node.js/React. ### 💰 Invent Finance Sistema financeiro com separação clara entre Backend e Frontend. +### 👗 Virtual Fashion +Plataforma de moda virtual. +- **Backend/Frontend**: Node.js/Next.js. +- **Armazenamento**: MinIO para assets 3D/Imagens. + +### 🧾 Invoice Ninja +Sistema de faturamento e gestão. +- **Stack**: PHP (App), Nginx (Web), MariaDB (Banco Dedicado). + ## Infraestrutura de Dados - **PostgreSQL**: Instância única compartilhada entre todos os serviços (exceto Vaultwarden que pode ter seu próprio banco ou schema). diff --git a/vps/nc1/deployment_guide.md b/vps/nc1/deployment_guide.md index f8beda0..3f0a4d7 100644 --- a/vps/nc1/deployment_guide.md +++ b/vps/nc1/deployment_guide.md @@ -111,6 +111,24 @@ journalctl -u meu-app -n 100 --- +## e 💡 Boas Práticas (Patterns) + +### Resiliência (Restart Policy) +Para garantir que o serviço suba automaticamente após falhas ou reboots: +```ini +[Service] +Restart=always +``` + +### Timeouts para Imagens Grandes +Se a imagem for grande (ex: Invoice Ninja, AI Models) e a rede lenta, aumente o timeout de inicialização para evitar que o systemd mate o processo durante o pull: +```ini +[Service] +TimeoutStartSec=900 +``` + +--- + ## 📂 Estrutura de Diretórios Recomendada Mantenha os volumes organizados em `/mnt/data/`: diff --git a/vps/nc1/nc1.md b/vps/nc1/nc1.md index 96f322f..6b3f78e 100644 --- a/vps/nc1/nc1.md +++ b/vps/nc1/nc1.md @@ -56,6 +56,18 @@ flowchart LR SXBE[Backend] SXFE[Frontend] end + + subgraph VirtualFashion + VFBE[Backend] + VFFE[Frontend] + VFMIN[MinIO] + end + + subgraph InvoiceNinja + INWEB[Web] + INAPP[App] + INDB[(MariaDB)] + end T --> VW T --> FG @@ -74,6 +86,10 @@ flowchart LR T --> Q1AFE T --> SXBE T --> SXFE + T --> VFBE + T --> VFFE + T --> VFMIN + T --> INWEB CIG --> PG CPP --> PG @@ -85,6 +101,8 @@ flowchart LR SXBE --> PG SIMB --> PG SIMB --> RD + VFBE --> PG + INAPP --> INDB ``` > **Nota:** O cluster **Redis** é utilizado principalmente pelo **SaveInMed Backend** e outros serviços que requerem cache. Todos compartilham a mesma instância do **PostgreSQL**. @@ -109,6 +127,10 @@ flowchart LR | **Q1 Agenda Frontend**| `dev.q1agenda.com.br` | 3000 | | **Sextando API** | `api-dev.sextando.com.br` | 8080 | | **Sextando Web** | `dev.sextando.com.br` | 3001 | +| **Virtual Fashion API** | `api.virtualfashion.com.br` | 8000 | +| **Virtual Fashion Web** | `virtualfashion.com.br` | 3000 | +| **Virtual Fashion MinIO**| `minio.virtualfashion.com.br` | 9000 | +| **Invoice Ninja** | `invoiceninja.nc1.rede5.com.br` | 80 | | **Vaultwarden** | `vault.rede5.com.br` | 80 | --- @@ -137,6 +159,12 @@ flowchart LR | `q1-total-dashboard-dev` | Q1 Total Dashboard (HML) | | `q1agenda-backend-dev` | Q1 Agenda Backend (HML) | | `q1agenda-frontend-dev` | Q1 Agenda Frontend (HML) | +| `virtual-fashion-backend`| Virtual Fashion Backend | +| `virtual-fashion-frontend`| Virtual Fashion Frontend | +| `virtual-fashion-minio` | Virtual Fashion Object Storage | +| `invoiceninja-app` | Invoice Ninja App (PHP) | +| `invoiceninja-web` | Invoice Ninja Web (Nginx) | +| `invoiceninja-db` | Invoice Ninja Database (MariaDB) | | `pgadmin` | Administração PostgreSQL | | `glances` | Monitoramento de sistema | diff --git a/vps/nc1/services_inventory.md b/vps/nc1/services_inventory.md index 52700ba..f42fb7b 100644 --- a/vps/nc1/services_inventory.md +++ b/vps/nc1/services_inventory.md @@ -20,6 +20,10 @@ | **Sextando FE** | `dev.sextando.com.br` | 3001 | - | Node.js/React | | **Invent BE** | `invent-api-dev.rede5.com.br` | 4763 | Postgres | Node.js | | **Invent FE** | `invent-dev.rede5.com.br` | 3785 | - | Node.js/Next | +| **Virtual Fashion BE** | `api.virtualfashion.com.br` | 8000 | Postgres | Node.js | +| **Virtual Fashion FE** | `virtualfashion.com.br` | 3000 | - | Node.js/Next | +| **Virtual Fashion MinIO** | `minio.virtualfashion.com.br` | 9000 | - | MinIO | +| **Invoice Ninja Web** | `invoiceninja.nc1.rede5.com.br` | 80 | MariaDB | PHP/Nginx | > (*) Verificar se este domínio está correto ou compartilhado. @@ -28,8 +32,9 @@ ### PostgreSQL - **Container**: `postgres-main` - **Versão**: 15 (aprox) -- **Porta**: 5432 (Rede Interna) +- **Porta**: 5432 (Rede Interna) / 443 (Externo via Traefik TCP) - **Volumes**: `/mnt/data/postgres:/var/lib/postgresql/data` +- **Acesso Externo**: `db.nc1.rede5.com.br` (SSL/TLS) ### Redis - **Container**: `redis-saveinmed`