icamarillo ceea67eb2b feat: Version 1.11.0 - Mejoras en auditoría, SLA, frontend y correcciones de sincronización
- Refactorización de endpoints de auditoría y helpers
- Mejoras en esquemas de auditoría (audit.py)
- Correcciones en endpoint SLA
- Actualizaciones en múltiples rutas del frontend interno:
  layout, tickets, usuarios, tenants, categorías, sistemas,
  SLA (at-risk, violations), auditoría (main + security), login, perfil
- Actualización de tailwind.config.js
- Eliminación de docs de versiones anteriores (CAMBIOS_v1.10.0, v1.8.0, OPTIMIZACIONES)
- Nuevos scripts de prueba: generate_security_test_data.py, generate_sla_test_data.py
- Script de prueba de sincronización crítica (test_critical_sync.ps1)
- README actualizado en scripts/
2026-02-20 10:53:53 -07:00
2026-01-12 08:17:17 -07:00
2026-02-12 14:00:04 -07:00

ServiceManagerWeb - Mesa de Ayuda B2B

Sistema multi-tenant de Mesa de Ayuda/Soporte Técnico empresarial para Aduanasoft.

Arquitectura

  • Frontend: SvelteKit + TypeScript (portal clientes + panel interno)
  • Backend: Python FastAPI + Pydantic v2
  • Workers: Celery + Redis (notificaciones, SLAs, jobs)
  • BD: PostgreSQL + Alembic migrations
  • Auth: JWT + Refresh tokens + 2FA opcional (TOTP)
  • Infra: Docker Compose local, preparado para producción

Estructura del Monorepo

ServiceManagerWeb/
├── backend/               # FastAPI app
├── frontend-client/       # SvelteKit app para clientes
├── frontend-internal/     # SvelteKit app para staff interno
├── workers/              # Celery tasks
├── db/                   # Migrations y esquemas
├── docker/               # Dockerfiles específicos
├── docs/                 # Documentación adicional
├── scripts/              # Scripts de desarrollo/despliegue
├── docker-compose.yml    # Orquestación completa
└── .env.example          # Variables de entorno

Stack Tecnológico

Backend (Python)

  • FastAPI (async)
  • Pydantic v2
  • SQLAlchemy 2.0 (async)
  • Alembic (migrations)
  • Argon2 (hashing passwords)
  • PyJWT
  • Celery + Redis

Frontend (JavaScript/TypeScript)

  • SvelteKit
  • TypeScript
  • TailwindCSS
  • shadcn/ui o similar
  • Zod (validación)

Infraestructura

  • PostgreSQL 15+
  • Redis 7+
  • Docker & Docker Compose
  • Nginx (reverse proxy)

Dominios del Sistema

  1. Auth: Usuarios, roles, permisos, 2FA
  2. Tenants: Multi-tenancy, organizaciones
  3. Tickets: Gestión de tickets, estados, SLAs
  4. Notifications: Email, plantillas, logs
  5. Audit: Bitácora de acciones

Roles de Usuario

Internos (Staff)

  • ADMIN: Control total del sistema
  • SUPPORT_MANAGER: Gestión de equipos y SLAs
  • AGENT: Atención de tickets
  • AUDITOR: Solo lectura para auditoría

Clientes

  • CLIENT_ADMIN: Gestión de organización cliente
  • CLIENT_USER: Creación y seguimiento de tickets

Quick Start

# Clonar y configurar
git clone <repo>
cd ServiceManagerWeb
cp .env.example .env

# Levantar servicios
docker-compose up -d

# Verificar estado
docker-compose ps

URLs por Defecto

Scripts de Desarrollo

# Backend
cd backend
python -m uvicorn app.main:app --reload --port 8000

# Frontend Cliente
cd frontend-client
npm run dev -- --port 3000

# Frontend Interno  
cd frontend-internal
npm run dev -- --port 3001

# Workers
cd workers
celery -A app.worker worker --loglevel=info
celery -A app.worker beat --loglevel=info

Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend-client
npm test
cd ../frontend-internal
npm test

Troubleshooting

Error 500 en Login / Proxy Error

Síntoma: Error 500 al intentar hacer login, o error de proxy de Vite "connect ECONNREFUSED".

Causa: Configuración incorrecta de la comunicación entre servicios de Docker.

Solución:

  1. En desarrollo con Docker, los servicios usan nombres de servicio (no localhost)
  2. Verificar vite.config.js: el proxy debe apuntar a http://backend:8000
  3. Verificar docker-compose.yml: PUBLIC_API_URL debe ser http://backend:8000
  4. Después de cambios, reiniciar contenedor: docker-compose restart frontend-internal

Nota: Para desarrollo local sin Docker, cambiar el proxy a http://localhost:8000.

Tenant Slug Incorrecto

Síntoma: Error de autenticación incluso con credenciales correctas.

Causa: El tenant_slug en el login no coincide con los tenants en la BD.

Solución:

  1. Verificar tenants existentes: docker exec servicemanager-backend python check_tenants.py
  2. Actualizar el tenant_slug en el código de login
  3. Tenants por defecto: aduanasoft-demo, test-tenant

Credenciales de Prueba

Email: admin@aduanasoft.com
Password: admin123
Tenant: aduanasoft-demo
Role: ADMIN

Contribución

  1. Fork del proyecto
  2. Crear feature branch (git checkout -b feature/nueva-funcionalidad)
  3. Commit cambios (git commit -am 'Agregar nueva funcionalidad')
  4. Push a branch (git push origin feature/nueva-funcionalidad)
  5. Crear Pull Request

Licencia

Propietario - Aduanasoft © 2026

Description
sistema interno de gestion de tickets
https://servicemanager.aduanasoft.com
Readme 2.4 MiB
Languages
Python 53.1%
Svelte 38.3%
TypeScript 3.4%
PowerShell 1.7%
PLpgSQL 1.2%
Other 2.3%