InvoSpark ERP is an enterprise-grade multi-branch Enterprise Resource Planning (ERP) platform designed for complex retail, supply chain, and multi-currency environments. Built with a modern decoupled stack featuring NestJS 11, Prisma ORM with PostgreSQL, and Next.js 15 (App Router), the platform provides strict transactional ACID guarantees, an immutable stock ledger audit trail, accounting cancellation guardrails, and real-time multi-branch inventory synchronization.
Engineered atomic payment workflows executing voucher generation during purchasing/sales invoicing. Encapsulates payment allocation logs and financial vouchers inside single Prisma $transaction blocks to guarantee zero-discrepancy ledger updates.
Architected a document-driven inventory ledger recording every stock movement (SALE, RETURN, ADJUSTMENT) alongside prior and updated running balances for complete audit trail transparency.
Implemented strict financial guards preventing invoice deletion or cancellation when linked to active sales returns, maintaining strict balance sheet alignment and avoiding unrecorded inventory leaks.
Stores dual-currency entries alongside locked exchange rates (exchangeRate, totalInBaseCurrency), ensuring macro-economic fluctuations do not distort past financial statements.
Guarded stock inventory against concurrent branch transactions using version-based optimistic locking (ProductBranch.version) to prevent race conditions during peak checkout periods.
Built a Socket.IO gateway broadcasting instant notifications for low-stock threshold breaches and voucher allocations across isolated branch rooms (branch_id).

Engineered an executive financial dashboard delivering real-time business KPIs. Features dynamic computation pipelines tracking Gross vs. Net revenues (net of returns), automated COGS-derived Gross Profit Margin (%), dual-currency aggregation (USD/SYP), and multi-branch liability totals.

Architected a centralized product catalog managing enterprise master data (SKUs, Categories, Dual-Currency Pricing). Features a popover visual overlay for real-time Branch Availability, enforcing transactional inventory consistency across isolated operational units.

Architected an immutable, transaction-driven Global Stock Ledger logging line-item movements (Sales, Purchases, Returns, Adjustments). Computes precise prior and updated running balances with mandatory timestamps and user attributions for audit reconciliation.

Integrated a reactive stock-monitoring engine that evaluates real-time inventory against dynamic reorder thresholds. Triggers low-stock alerts and suggests immediate business workflows (e.g., Create Purchase Order).

Engineered an end-to-end sales invoicing pipeline supporting dual-currency POS operations (USD/SYP rate freezing), line-item savings tracking, and dynamic 15% VAT calculations. Reconciles partial customer returns by pro-rating tax reversals and recalculating Net Totals (transitioning status to PARTIALLY REFUNDED), while enforcing strict accounting guardrails that lock invoice cancellation when linked to active return entries.

Engineered a centralized sales invoice management directory with real-time aggregate metrics (Page Total, Paid Amount, Remaining Balance). Features multi-parameter filtering (status, date ranges, full-text search), visual strikethrough pricing for partially refunded invoices, and seamless dual-currency state tracking.

Architected a unified returns management system handling both Customer (Sales) and Supplier (Purchase) return workflows. Features a centralized registry linked to original invoice references, paired with a modal inspector that calculates itemized refund breakdowns, enforces historical exchange rate freezing (1 USD = 14,000 SYP), applies pro-rated 15% VAT reversals, and logs mandatory return reason codes for audit compliance.

Architected a double-entry supplier ledger computing real-time running balances (CR/DR). Accurately reconciles purchases, returns, inline invoice payments, and standalone vouchers with full multi-currency conversion tracking.

Engineered an atomic purchasing and Accounts Payable (AP) workflow supporting dual-currency transactions (USD/SYP exchange rate freezing). Features multi-stage payment processing (embedded at creation or via standalone supplier vouchers), real-time payment allocation logging, automatic remaining balance computation (Balance Due), and live ledger synchronization updating supplier credit/debit totals across branch directories.

Engineered a granular Role-Based Access Control (RBAC) security framework with strict UI/API data-masking layers across 4 operational roles (Super Admin, Accountant, POS Cashier, Inventory Manager). Restricts sensitive financial metrics for warehouse staff, isolates POS transactions, and enforces branch-scoped data security. Features instant one-click demo credentials directly on the landing page for live role-switch testing.

Configured multi-tenant enterprise security with granular domain permissions, role-based navigation guards, dynamic branch context switching, and isolated data visibility across operational units.

Implemented enterprise authentication controls including strict password policy validation, secure JWT refresh session lifecycles, and audit logging for account governance.
Explore the live demo or review the repository on GitHub.