## Phase 3: DeepSeek AI Integration ### AI Services (apps/api/src/services/ai/) - DeepSeek API client with streaming, rate limiting, retries - AI service for financial analysis, executive summaries, recommendations - Optimized prompts for Mexican CFO digital assistant - Redis caching for AI responses ### Report Generation (apps/api/src/services/reports/) - ReportGenerator: monthly, quarterly, annual, custom reports - PDF generator with corporate branding (PDFKit) - Report templates for PYME, Startup, Enterprise - Spanish prompts for financial narratives - MinIO storage for generated PDFs ### AI & Reports API Routes - POST /api/ai/analyze - Financial metrics analysis - POST /api/ai/chat - CFO digital chat with streaming - POST /api/reports/generate - Async report generation - GET /api/reports/:id/download - PDF download - BullMQ jobs for background processing ### Frontend Pages - /reportes - Report listing with filters - /reportes/nuevo - 3-step wizard for report generation - /reportes/[id] - Full report viewer with charts - /asistente - CFO Digital chat interface - Components: ChatInterface, ReportCard, AIInsightCard ## Phase 4: ERP Integrations ### CONTPAQi Connector (SQL Server) - Contabilidad: catalog, polizas, balanza, estado de resultados - Comercial: clientes, proveedores, facturas, inventario - Nominas: empleados, nominas, percepciones/deducciones ### Aspel Connector (Firebird/SQL Server) - COI: accounting, polizas, balanza, auxiliares - SAE: sales, purchases, inventory, A/R, A/P - NOI: payroll, employees, receipts - BANCO: bank accounts, movements, reconciliation - Latin1 to UTF-8 encoding handling ### Odoo Connector (XML-RPC) - Accounting: chart of accounts, journal entries, reports - Invoicing: customer/vendor invoices, payments - Partners: customers, vendors, statements - Inventory: products, stock levels, valuations - Multi-company and version 14-17 support ### Alegra Connector (REST API) - Invoices, credit/debit notes with CFDI support - Contacts with Mexican fiscal fields (RFC, regimen) - Payments and bank reconciliation - Financial reports: trial balance, P&L, balance sheet - Webhook support for real-time sync ### SAP Business One Connector (OData/Service Layer) - Session management with auto-refresh - Financials: chart of accounts, journal entries, reports - Sales: invoices, credit notes, delivery notes, orders - Purchasing: bills, POs, goods receipts - Inventory: items, stock, transfers, valuation - Banking: accounts, payments, cash flow ### Integration Manager - Unified interface for all connectors - BullMQ scheduler for automated sync - Webhook handling for real-time updates - Migration 003_integrations.sql with sync tables - Frontend page /integraciones for configuration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
64 lines
1.5 KiB
Plaintext
64 lines
1.5 KiB
Plaintext
# ============================================================================
|
|
# Horux Strategy API - Environment Variables
|
|
# ============================================================================
|
|
# Copy this file to .env and fill in the values
|
|
|
|
# Server Configuration
|
|
NODE_ENV=development
|
|
PORT=4000
|
|
HOST=0.0.0.0
|
|
API_VERSION=v1
|
|
|
|
# Database (PostgreSQL)
|
|
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/horux_strategy
|
|
DATABASE_POOL_MIN=2
|
|
DATABASE_POOL_MAX=10
|
|
|
|
# Redis
|
|
REDIS_URL=redis://localhost:6379
|
|
|
|
# JWT Secrets (minimum 32 characters each)
|
|
# IMPORTANT: Generate secure random strings for production!
|
|
JWT_ACCESS_SECRET=your-access-secret-at-least-32-characters
|
|
JWT_REFRESH_SECRET=your-refresh-secret-at-least-32-characters
|
|
JWT_ACCESS_EXPIRES_IN=15m
|
|
JWT_REFRESH_EXPIRES_IN=7d
|
|
|
|
# Password Reset
|
|
PASSWORD_RESET_SECRET=your-reset-secret-at-least-32-characters!
|
|
PASSWORD_RESET_EXPIRES_IN=1h
|
|
|
|
# Security
|
|
BCRYPT_ROUNDS=12
|
|
CORS_ORIGINS=http://localhost:3000,http://localhost:5173
|
|
RATE_LIMIT_WINDOW_MS=60000
|
|
RATE_LIMIT_MAX_REQUESTS=100
|
|
|
|
# MinIO / S3 Object Storage
|
|
MINIO_ENDPOINT=localhost
|
|
MINIO_PORT=9000
|
|
MINIO_ACCESS_KEY=minioadmin
|
|
MINIO_SECRET_KEY=minioadmin
|
|
MINIO_BUCKET=horux-strategy
|
|
MINIO_USE_SSL=false
|
|
|
|
# Email (SMTP)
|
|
SMTP_HOST=
|
|
SMTP_PORT=587
|
|
SMTP_USER=
|
|
SMTP_PASS=
|
|
EMAIL_FROM=noreply@horuxstrategy.com
|
|
|
|
# Logging
|
|
LOG_LEVEL=info
|
|
LOG_FORMAT=simple
|
|
|
|
# Feature Flags
|
|
ENABLE_SWAGGER=true
|
|
ENABLE_METRICS=true
|
|
|
|
# DeepSeek AI
|
|
DEEPSEEK_API_KEY=your-deepseek-api-key
|
|
DEEPSEEK_BASE_URL=https://api.deepseek.com
|
|
DEEPSEEK_MODEL=deepseek-chat
|