How yorchavez9/demo-sunat-html works
This is a browser-based Spanish-language electronic invoicing and small-business management SPA. Users register and configure SUNAT credentials, maintain a product and contact catalog, then issue invoices, receipts, credit/debit notes, or dispatch guides; they can also review summaries, cancellations, and inventory. The README documents local browser storage, SUNAT API connectivity, optional identity lookup, and JSON backup/restore. The graph preserves those capabilities; some page-to-service links are documented at product level rather than verified from sampled page code.
Main entry points: db.js Local data layer · api.js SUNAT API client · comprobanteVenta.js Invoices and receipts · app.js SPA shell
Components 25
Application shell
- SPA shell
js/app.js - Hash router
js/router.js
Electronic documents
- Invoices and receipts
js/pages/comprobanteVenta.js - Credit and debit notes
js/pages/notaComprobante.js - Dispatch guides
js/pages/newDispatchGuide.js - Daily summaries
js/pages/summaries.js - Cancellations
js/pages/anulaciones.js - Document queries
js/pages/documentList.js
Business management
- Purchases
js/pages/compras.js - Inventory
js/pages/inventario.js - Products
js/pages/productos.js - Categories
js/pages/categorias.js - Clients and suppliers
js/pages/contactos.js - Dashboard
js/pages/dashboard.js - Settings and backup
js/pages/settings.js
Shared domain UI
- Invoice item totals
js/components/itemsTable.js - SUNAT fields
js/components/sunat.js - Client selection
js/components/clientPicker.js - Document lookup input
js/components/clientSelector.js - Product selection
js/components/productPicker.js
Data and integrations
- Local data layer
js/store/db.js - Browser localStorage
- SUNAT API client
js/api.js - RUC/DNI lookup services
Other components
- Business user
Connections 30
- Business user → SPA shell: uses
README.md - SPA shell → Hash router: creates
js/app.js - Business user → Invoices and receipts: issues documents
README.md - Business user → Credit and debit notes: creates notes
README.md - Business user → Dispatch guides: creates guides
README.md - Business user → Daily summaries: reviews summaries
README.md - Business user → Cancellations: manages cancellations
README.md - Business user → Document queries: queries documents
README.md - Business user → Purchases: records purchases
README.md - Business user → Inventory: reviews stock
README.md - Business user → Products: manages products
README.md - Business user → Categories: manages categories
README.md - Business user → Clients and suppliers: manages contacts
README.md - Business user → Dashboard: views overview
README.md - Business user → Settings and backup: configures system
README.md - Invoices and receipts → Invoice item totals: binds item table
js/pages/comprobanteVenta.js - Invoices and receipts → Product selection: opens picker
js/pages/comprobanteVenta.js - Invoices and receipts → SUNAT fields: uses document fields
README.md - Dispatch guides → SUNAT API client: submits guide
js/pages/newDispatchGuide.js - Client selection → SUNAT API client: looks up document
js/components/clientPicker.js - Document lookup input → SUNAT API client: looks up document
js/components/clientSelector.js - SUNAT API client → RUC/DNI lookup services: queries identity
README.md - Invoices and receipts → SUNAT API client: sends comprobante
README.md - Credit and debit notes → SUNAT API client: sends notes
README.md - Local data layer → Browser localStorage: persists data
README.md - Settings and backup → Local data layer: backs up data
README.md - Purchases → Local data layer: updates business data
README.md - Inventory → Local data layer: reads stock
README.md - Products → Local data layer: manages catalog
README.md - Clients and suppliers → Local data layer: manages contacts
README.md