Files
pulse-docs/obsidian-vault/Projetos/pulse-dev.md
T

100 lines
4.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Dev Environment Full-Stack Pulse"
created: 2026-05-20
tags: [dev, swarm, agents, taskboard, hot-reload]
projeto: pulse-dev
---
# 🚀 Dev Environment Full-Stack Pulse
## Stack Swarm `dev` — arquitetura
```
┌─────────────────────────────────────────────────────────────────┐
│ DEV ORCHESTRATOR │
│ (taskboard + Redis queue + log stream) │
├─────────────────────────────────────────────────────────────────┤
│ FRONTEND 5173 │ BACKEND 3001 │ WORKERS (FEBE_DEV_OPS) │
│ Vite HMR │ tsx HMR │ │
│ [1 réplica] │ [1 réplica] │ [2 FE] [2 BE] [1 DevOps] │
├─────────────────────────────────────────────────────────────────┤
│ Redis 6379 — fila `dev-tasks` + canal `dev-logs` │
└─────────────────────────────────────────────────────────────────┘
```
## Serviços ativos
| Serviço | Imagem | Porta | DOMÍNIO |
|---------|--------|-------|---------|
| redis | redis:8-alpine | 6379 | interno |
| taskboard | nginx:alpine | 80 | `board.octal.tec.br` |
| dev-frontend | node:24-alpine | 5173 | `frontend.octal.tec.br` |
| dev-backend | node:24-alpine | 3001 | `api.octal.tec.br` |
| agent-frontend ×2 | node:24-alpine | — | workers |
| agent-backend ×2 | node:24-alpine | — | workers |
| agent-devops ×1 | node:24-alpine | — | workers |
## API Backend (porta 3001)
| Rota | Método | Descrição |
|------|--------|-----------|
| `/health` | GET | Health check |
| `/tasks` | GET | Listar todas as tarefas |
| `/tasks` | POST | Criar tarefa (adiciona na fila `dev-tasks`) |
| `/tasks/:id` | PUT | Atualizar tarefa |
| `/agents` | GET | Listar agentes conectados |
## Task Protocol (Redis)
```json
{
"id": "uuid",
"type": "feature|bug|refactor|test|devops",
"priority": "low|medium|high|critical",
"domain": "frontend|backend|devops|fullstack",
"title": "...",
"description": "...",
"files_affected": ["src/..."],
"acceptance_criteria": ["..."],
"created_at": "2026-05-20T19:00:00Z",
"status": "pending|in_progress|done|blocked",
"assignee": null | "agent-frontend" | "agent-backend" | "agent-devops"
}
```
## Agentes (worker loop)
- `agent-frontend` ×2 — React/Vite specialist, BLPOP domínio=frontend|fullstack
- `agent-backend` ×2 — Node/Express specialist, BLPOP domínio=backend|fullstack
- `agent-devops` ×1 — Docker Swarm specialist, BLPOP domínio=devops
Ciclo: `claimTask → log(AGENT) → process (2-6s) → done → redis.publish`
## Hot Reload
| Serviço | Comando | Sistema |
|---------|---------|---------|
| Frontend | `npx vite --host 0.0.0.0 --port 5173` | Vite HMR (WS connect) |
| Backend | `npx tsx watch --dir ./src server.ts` | tsx HMR (restart em mudança) |
Código montado via volume bind mount (`:cached`) — qualquer alteração arquivo → hot reload instantâneo.
## Vault Obsidian
- Caminho: `/root/Obsidian-Pulse/`
- Estrutura: Inbox / Projetos / Docker / Dev / Codex / Logs / Memorias / Templates
- Skill: obsidian-vault-linker instalada e pronta
## Hotlinks
- `[[Swarm-Stacks-Reference]]` — todas as 11 stacks
- `[[Task-Protocol]]` — protocolo de tasks entre agentes
- `[[MEMORY]]` — memória curada do Pulse
- `[[DEV-STACK-YML]]` — compose da stack `dev`
## Referências
- runbook: `pulse-docs/runbooks/dev-stack.yml`
- guia: `pulse-docs/runbooks/dev-environment.md`
- MEMORY.md → `{{project: pulse-memory → MEMORY.md}}`