Commit Graph

31 Commits

Author SHA1 Message Date
f78d4c9b44 docs: sync FASES_IMPLEMENTADAS.md with actual project status
- Moved completed items from this session to 'Completados recientemente'
- Cleared critical debt section (PostgreSQL restart done)
- Marked stubs as 'creado' with file references
- Added new polish items: Grafana dashboards, Alertmanager, SW improvements
- Updated infrastructure table with Prometheus/Grafana
2026-04-29 06:44:27 +00:00
ca239a458b docs: update API, architecture, installation guides and README
- API-POS.md: added sections 11-15 (BNPL, ERP, WhatsApp Cloud,
  Supplier Portal, Dashboard Stats)
- ARCHITECTURE.md: added infra/monitoring section with systemd,
  Prometheus/Grafana, PWA, and integration stubs
- INSTALACION.md: added systemd setup, monitoring docker compose,
  PWA install notes, and Playwright test commands
- README.md: updated endpoint count, tech stack, infrastructure table
2026-04-29 06:34:40 +00:00
bd2cf307f7 docs: update FASES_IMPLEMENTADAS.md with completed items and current roadmap
- Added 'Completados recientemente' section (partitioning, Quart,
  minify fix, voice AI, chat.js fix, PostgreSQL tuning)
- Reordered and renumbered remaining roadmap items
- Updated infrastructure table: Quart now shows production status
2026-04-29 06:31:18 +00:00
c766571b7d docs(infra): add PostgreSQL tuning and systemd service documentation
- POSTGRESQL_TUNING.md: documents applied config (8GB shared_buffers,
  64MB work_mem, 8GB max_wal_size, SSD params)
- SYSTEMD_SERVICES.md: lists all production systemd services
- systemd/: versioned copies of all .service and .timer files
- .gitignore: ignore package-lock.json and backups/
2026-04-29 06:30:22 +00:00
c75e2a75c9 docs: actualiza FASES_IMPLEMENTADAS.md con estado post-voz y roadmap pendiente 2026-04-28 05:17:31 +00:00
042acd6207 OPCIÓN C + A1: Consolidación técnica + orjson
C1: Materialized view part_vehicle_preview (creación en progreso)
- Migración v3.3_materialized_view.sql
- catalog_service.py y dashboard/server.py ahora usan la MV
- Script refresh_part_vehicle_preview.py + warm_vehicle_cache.py actualizado

C2: Fix cache warming script (autónomo)
- Auto-re-ejecuta con sudo -u postgres si peer auth falla
- Args CLI: --dsn, --batch-size, --ttl, --dry-run

C3: CSS dinámico residual extraído
- sidebar.js → sidebar.css (nuevo)
- pos-utils.js → common.css (nuevo)
- Links agregados a 14 templates POS

C4: Script de load testing básico
- scripts/load_test.py: métricas p50/p95/p99, throughput, errores

C5: Documentación actualizada
- FASES_IMPLEMENTADAS.md: test count real, FASE 7 completa
- performance_audit_2026.md: anexo post-FASE 7, métricas actualizadas

A1: Serialización orjson
- pos/json_provider.py: DefaultJSONProvider con orjson.dumps/loads
- Aplicado a POS app y Dashboard server
- Fix indentation error en pos_bp.py

Tests: 73/73 pasando
2026-04-27 09:36:03 +00:00
175dda6212 FASE 7: Quick Wins de Performance — Optimización Fase 1
Cambios implementados:

1. Nginx:
   - gzip on (compresión JS/CSS/JSON)
   - Cache headers para assets estáticos (6M)
   - Proxy buffer tuning (10s connect, 30s read)

2. Frontend catalog.js:
   - Reemplazados 8x innerHTML += en loops por map+join
   - Event delegation en breadcrumb y cart (elimina memory leak)
   - AbortController en apiFetch (evita race conditions)
   - sessionStorage cache para years-all y brands por modo

3. Frontend templates HTML:
   - defer en todos los scripts POS (mejora First Paint)

4. Dashboard JS:
   - innerHTML += fix en dashboard.js y cuentas.js

5. Base de datos:
   - Índice parcial idx_wi_part_stock_positive en warehouse_inventory

6. Documentación:
   - docs/performance_audit_2026.md con análisis completo y roadmap

Tests: 73/73 pasando (compat + fase3 + fase5 + fase6)
2026-04-27 07:19:37 +00:00
Nexus Dev
9ff3dc4c8b FASE 4-5-6: Infraestructura, CRM, Service Orders, Notificaciones, Ahorro, Logistica, API Publica
FASE 4:
- Redis cache de stock con fallback graceful
- Multi-moneda (MXN/USD) con contabilidad en MXN
- Proveedores y ordenes de compra completo
- Meilisearch 1.5M+ partes indexadas
- Metabase KPIs con dashboard auto-generado

FASE 5:
- CRM mejorado: activities, tags, loyalty program, analytics
- Imagenes de partes: upload, resize, thumbnails WebP
- Ordenes de servicio Kanban: received->diagnosis->repair->ready->delivered
- Garantias/RMA, alertas de reorden, multi-sucursal
- Stubs BNPL (APLAZO) y ERP Sync (Aspel/Contpaqi)

FASE 6:
- Notificaciones automaticas: push/WhatsApp/email/in-app
- Reportes de ahorro vs retail_price
- Logistica + tracking: DHL, FedEx, Estafeta, 99min, Uber
- API Publica: API keys, rate limiting, catalog search

Migraciones: v1.9-v3.0
Tests: 93/93 pasando
Backup: nexus_backup_20260427_045859.tar.gz
2026-04-27 05:23:30 +00:00
b70cb3042b docs(whatsapp): actualizar setup a Baileys bridge con systemd
La doc previa describía Evolution API, pero el stack real desde abril
es Baileys directo en /opt/whatsapp-bridge/. Se documenta el systemd
unit que ahora supervisa el proceso y se agrega troubleshooting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 06:23:10 +00:00
e5f2ba356a docs: agregar documentos para inversionistas
Segmento de mercado, comparativa de competencia y script de ventas
para fase inicial BCN (Tijuana, Rosarito, Tecate, Ensenada).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 05:36:52 +00:00
5f92fe83ba feat(pos): replace Meta Cloud API WhatsApp with Evolution API (self-hosted)
Switch from Meta Business Cloud API to Evolution API for WhatsApp integration.
Evolution API is self-hosted, free, and connects via WhatsApp Web QR code scan.

- Add docker-compose for Evolution API deployment
- Rewrite whatsapp_service.py for Evolution API endpoints
- Add instance management (create, QR, status, logout) to blueprint
- Add QR code scanning UI with connection status indicator
- Add duplicate message prevention in webhook handler
- Update config.py with EVOLUTION_API_URL/KEY (remove old Meta vars)
- Add setup documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 03:15:52 +00:00
e00dce7d5a feat(pos): add gunicorn, marketplace B2B, and subscription billing (#7, #8, #12)
- Gunicorn production server with auto-scaled workers, run.sh, updated systemd service
- Marketplace B2B: cross-tenant inventory search, ordering, seller management with full UI
- Subscription billing: plan limits enforced on products/employees/branches, billing API + upgrade flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:17:33 +00:00
6676e5cb4c docs: design specs for WhatsApp, images, fleet, voice AI, mobile app
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 02:25:24 +00:00
fa7015e642 docs: documentacion completa — README, guia de uso, instalacion, API POS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 03:38:10 +00:00
4e08e12826 docs: add catalog vehicle navigation implementation plan
5-task plan: catalog_service.py, catalog_bp.py rewrite (9 endpoints),
catalog.html + catalog.js rewrite with hierarchical vehicle navigation,
integration test. Performance-optimized for 14B+ vehicle_parts table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:37:13 +00:00
2ac9b90afc docs: add catalog vehicle navigation design spec
Catalog redesign: TecDoc hierarchical navigation
(Brand→Model→Year→Engine→Category→Parts) with local stock +
bodega availability + aftermarket alternatives. Offline fallback
to local inventory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:22:55 +00:00
Lucy
ccd3962458 feat(design): add 16 new components + update 5 pages (ronda 2)
Bloqueantes POS: modal-pago, ticket-termico, banner-cliente, fkeys-footer, columnas-costo-margen
Componentes nuevos: calculadora-cambio, panel-deslizante, badge-cfdi, arbol-colapsable, tarjeta-metrica, grafica-barras, selector-periodo, etiqueta-codigo-barras
Estados: estado-vacio, banner-offline, modal-confirmacion
Páginas actualizadas: facturación, contabilidad, dashboard, configuración, reportes
2026-04-01 07:06:34 +00:00
Lucy
46360b6827 feat: agregar design system completo con 2 temas (Industrial + Moderno)
- Tokens CSS con variables para ambos temas (dark/light)
- 21 componentes reutilizables (buttons, cards, tables, modals, etc.)
- 10 pantallas POS (login, catálogo, POS, inventario, clientes, facturación, contabilidad, dashboard, configuración, reportes)
- Preview interactivo con selector de tema
- Generado por el equipo de Hugo (Milo-UX, Iris-UI, Zara-Frontend)
2026-04-01 01:41:04 +00:00
5fc47473b6 docs: add POS screen design guide for design team
10 screens, 20 reusable components, 6 states/variants,
CSS theme system. Complete wireframes and specifications
for each page, modal, and component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:18:14 +00:00
aeac4387df docs: add CFDI + Accounting implementation plan (4 of 5)
10-task plan covering:
- Accounting engine (auto journal entries for sales/purchases/cuts)
- CFDI 4.0 XML builder (Ingreso/Egreso/Pago with lxml)
- CFDI queue (offline timbrado with retry backoff via Horux API)
- Invoicing blueprint (6 endpoints)
- Accounting blueprint (11 endpoints: reports, periods, entries)
- Hooks into POS engine (non-blocking try/except)
- Frontends for both modules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:08:21 +00:00
7036a18601 docs: add POS + Cash Register implementation plan (3 of 5)
9-task plan covering:
- POS engine (sale processing, Decimal totals, margin info)
- Customers blueprint (CRUD, credit, vehicle history, statements, payments)
- POS blueprint (sales, quotations, layaways with stock reservation)
- Cash register (open/close, X/Z cuts, daily consolidated summary)
- POS frontend (F1-F6 shortcuts, margin display, payment modal)
- Customers frontend (search, credit status, account statements)
- Full integration test (20+ tests covering entire sale lifecycle)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 03:32:00 +00:00
af404a6474 docs: add POS Inventory + Catalog implementation plan (2 of 5)
8-task plan covering:
- Inventory engine (append-only operations, weighted avg cost)
- Barcode generator (PostgreSQL sequence)
- Inventory blueprint (15+ endpoints: CRUD, purchases, adjustments, transfers, physical count, reports)
- Catalog blueprint (search, barcode lookup, cross-references, external availability)
- Catalog UI with cart and barcode scanner support
- Inventory management UI with tabs for all operations
- 5 inventory reports (valuation, ABC, no-movement, low-stock, branch comparison)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 02:08:05 +00:00
2a639a84ed docs: add complete 4-month roadmap with Pitz competitive analysis
Roadmap covers all features across talleres, refaccionarias, and distribuidores.
Includes competitive comparison vs Pitz, Meru, Jetz, and traditional POS.
Pricing strategy and feature differentiation documented.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:50:39 +00:00
1b9b12d08e docs: add POS Foundation implementation plan (1 of 5)
10-task plan covering multi-tenant infrastructure:
- Tenant DB provisioning from template (21 tables)
- PIN auth with JWT, rate limiting, lockout
- Permission system (owner/admin/cashier/warehouse/accountant)
- Audit logging (insert-only)
- Config: branches, employees, theming
- Migration runner for versioned schema updates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:16:59 +00:00
11d8d7ae0b docs: add POS + Inventario complete design spec
Multi-tenant POS system for Mexican auto parts stores (refaccionarias):
- DB-per-tenant isolation with template versioning
- PWA with offline-first via IndexedDB + Service Worker
- Inventory by operations (append-only, no conflicts)
- CFDI 4.0 via Horux360 API with offline queue
- Accounting with auto journal entries
- Role-based permissions (owner/admin/cashier/warehouse/accountant)
- Themeable frontend via CSS custom properties
- 22 table schemas defined, offline edge cases addressed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 01:03:24 +00:00
fb6ea31100 docs: add README, API reference, and architecture documentation
- README.md: project overview, features, quick start, API overview
- docs/API.md: full endpoint reference with examples
- docs/ARCHITECTURE.md: system diagram, DB schema, data pipeline, auth flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:30:53 +00:00
5e6bf788db docs: add design and implementation plans
- SaaS + aftermarket design spec
- SaaS + aftermarket implementation plan (15 tasks)
- Captura partes design
- POS + cuentas design and plan

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:25:38 +00:00
2c6b6e0160 fix(console): fix PostgreSQL connection + add Metabase Actions guide
- Fix console/main.py: import DB_URL instead of missing DB_PATH
- Add sqlalchemy text() import for connection test
- Replace file-exists check with actual PostgreSQL connection test
- Mask password in startup banner
- Add docs/METABASE_ACTIONS.md: complete guide for data entry via
  Metabase Actions (models, forms, dashboard layout, workflows)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 05:52:12 +00:00
7b2a904498 feat: migrate to PostgreSQL + SQLAlchemy ORM, rebrand to Nexus Autoparts
- Migrate from SQLite to PostgreSQL with normalized schema
- Add 11 lookup tables (fuel_type, body_type, drivetrain, transmission,
  materials, position_part, manufacture_type, quality_tier, countries,
  reference_type, shapes)
- Rewrite dashboard/server.py (76 routes) using SQLAlchemy text() queries
- Rewrite console/db.py (27 methods) using SQLAlchemy ORM
- Add models.py with 27 SQLAlchemy model definitions
- Add config.py for centralized DB_URL configuration
- Add migrate_to_postgres.py migration script
- Add docs/METABASE_GUIDE.md with complete data entry guide
- Rebrand from "AUTOPARTS DB" to "NEXUS AUTOPARTS"
- Fill vehicle data gaps via NHTSA API + heuristics:
  engines (cylinders, power, torque), brands (country, founded_year),
  models (body_type, production years), MYE (drivetrain, transmission, trim)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 05:24:47 +00:00
4af3a09b03 docs: add console system documentation and design docs
Console README with usage instructions, keybindings reference, architecture
overview, and test commands. Updated root README with console section, updated
architecture diagram, and installation instructions. Includes approved design
doc and implementation plan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:03:22 +00:00
f395d67136 Initial commit: Sistema Autoparts DB
- Base de datos SQLite con información de vehículos
- Dashboard web con Flask y Bootstrap
- Scripts de web scraping para RockAuto
- Interfaz CLI para consultas
- Documentación completa del proyecto

Incluye:
- 12 marcas de vehículos
- 10,923 modelos
- 10,919 especificaciones de motores
- 12,075 combinaciones modelo-año-motor
2026-01-19 08:45:03 +00:00