# bvr218/nubicta architecture

> Architecture diagram of the GitHub repository bvr218/nubicta, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bvr218/nubicta
- Repository: https://github.com/bvr218/nubicta

## Overview

Nubicta is a Colombian SME ERP covering sales and purchasing, accounting, inventory, payroll, banking, reports, and direct DIAN electronic-document processing. Users work through the web application to manage company records and business documents; those documents can affect inventory and accounting, and electronic documents are submitted to DIAN. The map preserves the README’s major domain branches. Some connections are documented capabilities rather than inspected call paths, so those edges are dashed; sampled source gives firmer evidence for document forms, payroll accounting, DIAN processing, and webhook delivery.

Main entry points: [`app/Http/Controllers/DocumentFormController.php`](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/DocumentFormController.php) (Document forms), [`app/Services/Dian/DianService.php`](https://github.com/bvr218/nubicta/blob/main/app/Services/Dian/DianService.php) (Electronic documents), [`app/Models/SalesDocument.php`](https://github.com/bvr218/nubicta/blob/main/app/Models/SalesDocument.php) (Sales documents), [`app/Http/Controllers/Inventory/ProductController.php`](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Inventory/ProductController.php) (Products and costing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_documents["Business documents"]
  node_docform["Document forms"]
  node_sales["Sales and collections"]
  node_salesdata[("Sales documents<br/>[SalesDocument.php]")]
  node_purchases["Purchases and inbox"]
  node_purchasedata[("Purchase documents")]
  node_contacts[("Contacts<br/>[Contact.php]")]
end

subgraph group_finance["Finance and operations"]
  node_inventory["Products and costing"]
  node_productdata[("Products and stock<br/>[Product.php]")]
  node_accounting["Accounting processes"]
  node_accounts[("Accounts and ledger<br/>[Account.php]")]
  node_banks["Bank reconciliation"]
  node_payroll["Payroll runs"]
  node_payrollservice["Payroll accounting<br/>[PayrollService.php]"]
  node_reports["Reports"]
end

subgraph group_compliance["DIAN and integrations"]
  node_dian["Electronic documents<br/>[DianService.php]"]
  node_webhooks["Webhook events<br/>[Webhooks.php]"]
  node_deliver["Webhook delivery<br/>[DeliverWebhook.php]"]
end

subgraph group_platform["Web application"]
  node_web["ERP web UI<br/>[app.js]"]
  node_company[("Company settings<br/>[Company.php]")]
  node_dashboard["Dashboard"]
end

node_user(("Company user"))
node_dianservice{{"DIAN"}}
node_webhooktarget(("Webhook subscribers"))

node_user -.->|"uses"| node_web
node_web -.->|"submits documents"| node_docform
node_docform -->|"creates sales records"| node_salesdata
node_docform -->|"creates purchase records"| node_purchasedata
node_docform -->|"uses DIAN service"| node_dian
node_sales -.->|"manages"| node_salesdata
node_purchases -.->|"manages"| node_purchasedata
node_user -.->|"manages stock"| node_inventory
node_inventory -->|"manages products"| node_productdata
node_user -.->|"records accounts"| node_accounting
node_accounting -.->|"uses accounts"| node_accounts
node_user -.->|"reconciles statements"| node_banks
node_user -.->|"runs payroll"| node_payroll
node_payroll -->|"delegates payroll"| node_payrollservice
node_payrollservice -->|"posts ledger entries"| node_accounts
node_user -.->|"views reports"| node_reports
node_dian -.->|"submits documents"| node_dianservice
node_dian -->|"processes invoices"| node_salesdata
node_user -.->|"configures company"| node_company
node_user -.->|"views activity"| node_dashboard
node_webhooks -->|"dispatches events"| node_deliver
node_deliver -->|"posts signed events"| node_webhooktarget

click node_web "https://github.com/bvr218/nubicta/blob/main/resources/js/app.js"
click node_docform "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/DocumentFormController.php"
click node_sales "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Sales/SalesDocumentController.php"
click node_salesdata "https://github.com/bvr218/nubicta/blob/main/app/Models/SalesDocument.php"
click node_purchases "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Purchases/PurchaseDocumentController.php"
click node_purchasedata "https://github.com/bvr218/nubicta/blob/main/app/Models/PurchaseDocument.php"
click node_contacts "https://github.com/bvr218/nubicta/blob/main/app/Models/Contact.php"
click node_inventory "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Inventory/ProductController.php"
click node_productdata "https://github.com/bvr218/nubicta/blob/main/app/Models/Product.php"
click node_accounting "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Accounting/ProcessesController.php"
click node_accounts "https://github.com/bvr218/nubicta/blob/main/app/Models/Account.php"
click node_banks "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Banks/ReconciliationController.php"
click node_payroll "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Payroll/PayrollRunController.php"
click node_payrollservice "https://github.com/bvr218/nubicta/blob/main/app/Services/Payroll/PayrollService.php"
click node_reports "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Reports/ReportsController.php"
click node_dian "https://github.com/bvr218/nubicta/blob/main/app/Services/Dian/DianService.php"
click node_webhooks "https://github.com/bvr218/nubicta/blob/main/app/Services/Api/Webhooks.php"
click node_deliver "https://github.com/bvr218/nubicta/blob/main/app/Jobs/DeliverWebhook.php"
click node_company "https://github.com/bvr218/nubicta/blob/main/app/Models/Company.php"
click node_dashboard "https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/DashboardController.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_docform,node_sales,node_salesdata,node_purchases,node_purchasedata,node_contacts,node_user toneBlue
class node_inventory,node_productdata,node_accounting,node_accounts,node_banks,node_payroll,node_payrollservice,node_reports toneAmber
class node_dian,node_webhooks,node_deliver,node_webhooktarget toneMint
class node_web,node_company,node_dashboard toneRose
class node_dianservice toneIndigo
```

## Components

### Business documents

- [Document forms](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/DocumentFormController.php): `app/Http/Controllers/DocumentFormController.php`
- [Sales and collections](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Sales/SalesDocumentController.php): `app/Http/Controllers/Sales/SalesDocumentController.php`
- [Sales documents](https://github.com/bvr218/nubicta/blob/main/app/Models/SalesDocument.php): `app/Models/SalesDocument.php`
- [Purchases and inbox](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Purchases/PurchaseDocumentController.php): `app/Http/Controllers/Purchases/PurchaseDocumentController.php`
- [Purchase documents](https://github.com/bvr218/nubicta/blob/main/app/Models/PurchaseDocument.php): `app/Models/PurchaseDocument.php`
- [Contacts](https://github.com/bvr218/nubicta/blob/main/app/Models/Contact.php): `app/Models/Contact.php`

### Finance and operations

- [Products and costing](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Inventory/ProductController.php): `app/Http/Controllers/Inventory/ProductController.php`
- [Products and stock](https://github.com/bvr218/nubicta/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Accounting processes](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Accounting/ProcessesController.php): `app/Http/Controllers/Accounting/ProcessesController.php`
- [Accounts and ledger](https://github.com/bvr218/nubicta/blob/main/app/Models/Account.php): `app/Models/Account.php`
- [Bank reconciliation](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Banks/ReconciliationController.php): `app/Http/Controllers/Banks/ReconciliationController.php`
- [Payroll runs](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Payroll/PayrollRunController.php): `app/Http/Controllers/Payroll/PayrollRunController.php`
- [Payroll accounting](https://github.com/bvr218/nubicta/blob/main/app/Services/Payroll/PayrollService.php): `app/Services/Payroll/PayrollService.php`
- [Reports](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/Reports/ReportsController.php): `app/Http/Controllers/Reports/ReportsController.php`

### DIAN and integrations

- [Electronic documents](https://github.com/bvr218/nubicta/blob/main/app/Services/Dian/DianService.php): `app/Services/Dian/DianService.php`
- [Webhook events](https://github.com/bvr218/nubicta/blob/main/app/Services/Api/Webhooks.php): `app/Services/Api/Webhooks.php`
- [Webhook delivery](https://github.com/bvr218/nubicta/blob/main/app/Jobs/DeliverWebhook.php): `app/Jobs/DeliverWebhook.php`

### Web application

- [ERP web UI](https://github.com/bvr218/nubicta/blob/main/resources/js/app.js): `resources/js/app.js`
- [Company settings](https://github.com/bvr218/nubicta/blob/main/app/Models/Company.php): `app/Models/Company.php`
- [Dashboard](https://github.com/bvr218/nubicta/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`

### Other components

- **Company user**
- **DIAN**
- **Webhook subscribers**

## Connections

- Company user → ERP web UI: uses
- ERP web UI → Document forms: submits documents
- Document forms → Sales documents: creates sales records (evidence: `app/Http/Controllers/DocumentFormController.php`)
- Document forms → Purchase documents: creates purchase records (evidence: `app/Http/Controllers/DocumentFormController.php`)
- Document forms → Electronic documents: uses DIAN service (evidence: `app/Http/Controllers/DocumentFormController.php`)
- Sales and collections → Sales documents: manages
- Purchases and inbox → Purchase documents: manages
- Company user → Products and costing: manages stock
- Products and costing → Products and stock: manages products (evidence: `app/Http/Controllers/Inventory/ProductController.php`)
- Company user → Accounting processes: records accounts
- Accounting processes → Accounts and ledger: uses accounts (evidence: `app/Http/Controllers/Accounting/ProcessesController.php`)
- Company user → Bank reconciliation: reconciles statements
- Company user → Payroll runs: runs payroll
- Payroll runs → Payroll accounting: delegates payroll (evidence: `app/Http/Controllers/Payroll/PayrollRunController.php`)
- Payroll accounting → Accounts and ledger: posts ledger entries (evidence: `app/Services/Payroll/PayrollService.php`)
- Company user → Reports: views reports
- Electronic documents → DIAN: submits documents
- Electronic documents → Sales documents: processes invoices (evidence: `app/Services/Dian/DianService.php`)
- Company user → Company settings: configures company
- Company user → Dashboard: views activity
- Webhook events → Webhook delivery: dispatches events (evidence: `app/Services/Api/Webhooks.php`)
- Webhook delivery → Webhook subscribers: posts signed events (evidence: `app/Jobs/DeliverWebhook.php`)
