- Add Facturapi REST service (invoices, customers, orgs, cancel, downloads) - Add JSON payload builder for ingreso/egreso/pago/global invoices - Replace XML queue with Facturapi JSON queue (payload_unsigned, external_id) - Update invoicing blueprint with Facturapi config and download endpoints - Update global invoice service to use Facturapi payloads - Add migration v4.3_facturapi.sql and tenant rollout script - Update invoicing UI: payload preview, PDF/XML downloads, PAC status panel - Add FACTURAPI_USER_KEY to .env.example
72 lines
6.3 KiB
Plaintext
72 lines
6.3 KiB
Plaintext
# Nexus Autoparts — Environment Variables
|
|
# Copy this file to .env and fill in your values.
|
|
# NEVER commit .env to git.
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# DATABASE (REQUIRED)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
DATABASE_URL=postgresql://nexus:YOUR_DB_PASSWORD@localhost/nexus_autoparts
|
|
MASTER_DB_URL=postgresql://nexus:YOUR_DB_PASSWORD@localhost/nexus_autoparts
|
|
TENANT_DB_URL_TEMPLATE=postgresql://nexus:YOUR_DB_PASSWORD@localhost/{db_name}
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# SECURITY (REQUIRED)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# Generate with: python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
JWT_SECRET=change-me-to-a-random-64-char-hex-string
|
|
POS_JWT_SECRET=change-me-to-a-different-random-64-char-hex-string
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# AI / OpenRouter (OPTIONAL — enables chatbot)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
OPENROUTER_API_KEY=sk-or-v1-your-openrouter-key
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# WHATSAPP BRIDGE (OPTIONAL — enables WhatsApp integration)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
WHATSAPP_BRIDGE_URL=http://localhost:21465
|
|
WHATSAPP_BRIDGE_KEY=your-whatsapp-bridge-secret
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# SMTP (OPTIONAL — enables email quotations)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
SMTP_HOST=smtp.gmail.com
|
|
SMTP_PORT=587
|
|
SMTP_USER=your-email@gmail.com
|
|
SMTP_PASS=your-app-password
|
|
SMTP_FROM=noreply@yourdomain.com
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# REDIS CACHE (OPTIONAL — enables sub-millisecond stock lookups)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
REDIS_URL=redis://localhost:6379/0
|
|
REDIS_ENABLED=true
|
|
REDIS_STOCK_TTL=300
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# MEILISEARCH (OPTIONAL — enables sub-100ms catalog search)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
MEILI_URL=http://localhost:7700
|
|
MEILI_API_KEY=nexus-master-key-change-me
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# METABASE KPIs (OPTIONAL — Business Intelligence dashboards)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
METABASE_URL=http://localhost:3000
|
|
METABASE_ADMIN_EMAIL=admin@nexus.local
|
|
METABASE_ADMIN_PASS=change-me-to-a-strong-password
|
|
METABASE_DB_PASS=metabase_secret
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# FACTURAPI (OPTIONAL — auto-organization mode for new tenants)
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# If set, new tenants can create Facturapi organizations automatically.
|
|
# Otherwise each tenant must store its secret key in tenant_config.cfdi_facturapi_key.
|
|
FACTURAPI_USER_KEY=sk_user_xxxxxxxxxxxxxxxx
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
# CURRENCY
|
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
DEFAULT_CURRENCY=MXN
|
|
EXCHANGE_RATE_USD_MXN=17.5
|