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.
# 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
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.
| Dominio | Sirve | Auth | SSL |
|---|---|---|---|
| syrus.misterhr.pro | Diagnóstico SYRUS + API backend | Público | ✓ Certbot |
| elyon.misterhr.pro | Batería psicosocial ELYON | Admin → htpasswd | ✓ Certbot |
| synergy.misterhr.pro | Capital colectivo + PocketBase admin | PocketBase auth | ✓ Certbot |
| nexus.misterhr.pro | Dashboard ejecutivo | Supabase JWT | ✓ Certbot |
| n8n.misterhr.pro | n8n workflow editor | n8n credentials | ✓ Certbot |
| misterhr.pro | Landing page principal | Público | ✓ Certbot |
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
Workflow · SYRUS
Se activa cuando el usuario completa el formulario en syrus.misterhr.pro y envía a /api/lead.
/root/misterrh/workflow_syrus_v2.json · 7 nodosWorkflow · ELYON
Recibe el JSON de evaluación, lo persiste en PostgreSQL, genera análisis IA y entrega el reporte PDF al cliente.
/root/misterrh/workflow_elyon.json · Nombre: ELYON — Batería PsicosocialWorkflow · Synergy Deploy
Motor de IA estratégica del Nexus dashboard. Devuelve análisis estructurado en JSON.
/root/misterrh/backend/synergy_deploy_workflow.json · ID: synergy-deploy-wf-001Elyon API
Python Flask / Gunicorn. Acceso interno en http://127.0.0.1:5001. Requiere JWT token para todos los endpoints excepto /api/health.
/api/metrics (usado por Nexus) no existe aún en app.py. El dashboard hace fallback a Supabase directo.| Método | Ruta | Auth | Descripción |
|---|---|---|---|
POST/api/login | /api/login | No | Autenticación. Devuelve JWT token. |
GET/api/records | /api/records | JWT | Lista evaluaciones psicosociales con filtros. |
GET/api/stats | /api/stats | JWT | Estadísticas agregadas: total, por nivel_riesgo, score promedio. |
GET/api/export/csv | /api/export/csv | JWT | Exportar todas las evaluaciones en CSV. |
GET/api/export/excel | /api/export/excel | JWT | Exportar en formato Excel (.xlsx). |
POST/api/pdf/informe | /api/pdf/informe | JWT | Generar PDF de informe individual. |
GET/api/health | /api/health | No | Health check. Devuelve {"db":"connected","status":"ok"} |
SYRUS API
Node.js / Express. Puerto 3031. Proxied por nginx en syrus.misterhr.pro/api/.
| Método | Ruta | Descripción |
|---|---|---|
POST/api/lead | /api/lead | Captura lead SYRUS. Envía email al lead + notificación interna. Reenvío fire-and-forget a n8n webhook. |
GET/api/health | /api/health | Health 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": [...] } }
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