MISTER HR
🔒 Nexus Backoffice · Docs
01 · Infraestructura

Overview del Sistema

El ecosistema MisterHR corre en un VPS Ubuntu con 1.9 GiB RAM, 24 GB disco. Servicios orquestados con Docker Compose, reverse proxy nginx, SSL Let's Encrypt y tunnel Cloudflared.

✓ Estado actual: 8 servicios online · 52% disco usado · n8n v2.9.4 activo · DeepSeek saldo OK
# Stack tecnológico
OS:      Ubuntu (kernel 6.8.0)
RAM:     1.9 GiB total / 817 MiB disponible
Disco:   24 GB / 52% usado (12 GB libres)
Swap:    2 GB (264 MiB en uso)

# Servicios Docker
n8n:         n8nio/n8n:latest    port 5678
elyon_api:   misterrh-elyon_api  port 5001
postgres:    postgres:16-alpine  port 5432
pocketbase:  binary              port 8090
syrus_api:   node (syrus api)    port 3031

# Nginx → Servicios
syrus.misterhr.pro   → /var/www/syrus + proxy :3031/api/
elyon.misterhr.pro   → /var/www/misterhr/elyon
synergy.misterhr.pro → /var/www/misterhr/synergy + proxy :8090
nexus.misterhr.pro   → /var/www/misterhr/nexus
n8n.misterhr.pro     → proxy :5678
01.2 · Dominios

Dominios y SSL

Todos los subdominios con SSL Certbot (Let's Encrypt). Redirect HTTP→HTTPS forzado en nginx. Cloudflared como túnel de seguridad adicional.

DominioSirveAuthSSL
syrus.misterhr.proDiagnóstico SYRUS + API backendPúblico✓ Certbot
elyon.misterhr.proBatería psicosocial ELYONAdmin → htpasswd✓ Certbot
synergy.misterhr.proCapital colectivo + PocketBase adminPocketBase auth✓ Certbot
nexus.misterhr.proDashboard ejecutivoSupabase JWT✓ Certbot
n8n.misterhr.pron8n workflow editorn8n credentials✓ Certbot
misterhr.proLanding page principalPúblico✓ Certbot
01.3 · Docker

Stack Docker

Ubicación del proyecto: /root/misterrh/docker-compose.yml

# Comandos de operación
cd /root/misterrh

# Estado
docker ps

# Reiniciar todo el stack
docker compose restart

# Logs n8n
docker compose logs -f n8n --tail=50

# Logs Elyon API
docker compose logs -f elyon_api --tail=50

# Reiniciar SYRUS API
pm2 restart syrus
02 · Flujos n8n

Workflow · SYRUS

Se activa cuando el usuario completa el formulario en syrus.misterhr.pro y envía a /api/lead.

Archivo: /root/misterrh/workflow_syrus_v2.json · 7 nodos
🎯
SYRUS · Diagnóstico Forense
workflow_syrus_v2.json · 7 nodos
Activo
1SYRUS · Entradawebhook
2SYRUS · Payload Enginecode
3SYRUS · Cerebro ForensehttpRequest → DeepSeek
4SYRUS · HTML Terminalcode
5SYRUS · Generar PDFhttpRequest
6SYRUS · Vault Registerpostgres
7SYRUS · Entregar PDFrespondToWebhook
02.2 · Flujos n8n

Workflow · ELYON

Recibe el JSON de evaluación, lo persiste en PostgreSQL, genera análisis IA y entrega el reporte PDF al cliente.

Archivo: /root/misterrh/workflow_elyon.json · Nombre: ELYON — Batería Psicosocial
🧠
ELYON — Batería Psicosocial
workflow_elyon.json · 6 nodos
Activo
1Webhook Bateriawebhook
2Insertar en BDpostgres
3Cerebro IAhttpRequest → DeepSeek
4Guardar Recomendacion IApostgres
5Generar PDFhttpRequest
6Entregar PDFrespondToWebhook
02.3 · Flujos n8n

Workflow · Synergy Deploy

Motor de IA estratégica del Nexus dashboard. Devuelve análisis estructurado en JSON.

Archivo: /root/misterrh/backend/synergy_deploy_workflow.json · ID: synergy-deploy-wf-001
Synergy Deploy
synergy_deploy_workflow.json · 3 nodos
Activo
1Synergy · Entradawebhook
2Synergy · DeepSeek AIhttpRequest → deepseek-chat
3Synergy · RespuestarespondToWebhook → JSON
03 · API Reference

Elyon API

Python Flask / Gunicorn. Acceso interno en http://127.0.0.1:5001. Requiere JWT token para todos los endpoints excepto /api/health.

⚠ El endpoint /api/metrics (usado por Nexus) no existe aún en app.py. El dashboard hace fallback a Supabase directo.
MétodoRutaAuthDescripción
POST/api/login/api/loginNoAutenticación. Devuelve JWT token.
GET/api/records/api/recordsJWTLista evaluaciones psicosociales con filtros.
GET/api/stats/api/statsJWTEstadísticas agregadas: total, por nivel_riesgo, score promedio.
GET/api/export/csv/api/export/csvJWTExportar todas las evaluaciones en CSV.
GET/api/export/excel/api/export/excelJWTExportar en formato Excel (.xlsx).
POST/api/pdf/informe/api/pdf/informeJWTGenerar PDF de informe individual.
GET/api/health/api/healthNoHealth check. Devuelve {"db":"connected","status":"ok"}
03.2 · API Reference

SYRUS API

Node.js / Express. Puerto 3031. Proxied por nginx en syrus.misterhr.pro/api/.

MétodoRutaDescripción
POST/api/lead/api/leadCaptura lead SYRUS. Envía email al lead + notificación interna. Reenvío fire-and-forget a n8n webhook.
GET/api/health/api/healthHealth check. Devuelve {"ok":true,"ts":"..."}
# Payload POST /api/lead
{
  "fuente": "syrus.misterhr.pro",
  "contacto": {
    "nombre": "Juan García",
    "cargo":  "Director RH",
    "empresa":"Acme Corp",
    "email":  "juan@acme.com",
    "tamano_empresa": "51-200"
  },
  "diagnostico": {
    "puntuacion_total": 18,
    "porcentaje_exposicion": 60,
    "nivel_riesgo": "RIESGO ELEVADO",
    "respuestas": [...]
  }
}
04 · Configuración

Variables de Entorno

Archivos .env en cada servicio. Nunca commitear al repositorio.

# /var/www/syrus/api/.env
PORT=3031
RESEND_API_KEY=re_xxxx
FROM_NAME=Mister HR
FROM_EMAIL=diagnostico@misterhr.pro
INTERNAL_NOTIFY=mister@misterhr.pro
CALENDLY_URL=https://calendly.com/...

# /root/misterrh/.env (Docker Compose)
DEEPSEEK_API_KEY=sk-xxxx
POSTGRES_DB=elyon
POSTGRES_USER=postgres
POSTGRES_PASSWORD=xxxx

# Nexus Dashboard (synergy.js)
SUPABASE_URL=https://xxxx.supabase.co
SUPABASE_ANON_KEY=eyJxxxx
NEXUS_API_URL=https://elyon.misterhr.pro