LIVE2025 – 2026Enterprise Resource Planning & POS
point_of_sale

Jofotara ERP & E-Invoicing System

Role: Lead Backend Developer

OVERVIEW

Built to handle complex retail and wholesale operations, this system acts as the financial and operational backbone of the business. It manages everything from multi-tiered inventory stock with FIFO consumption to complex credit payment schedules. Crucially, it seamlessly encodes and transmits UBL 2.1 standard XML invoices to the Jordanian government in real-time, while providing administrators with extensive shift tracking, cashbox locking, and suspicious action monitoring.

METRICS

15+
DATABASE MODELS
UBL 2.1
E-INVOICING STANDARD
4 Entities
AUDIT TRIGGERS
Cash, Visa, Credit
PAYMENT MODES
AWS
DATABASE HOST
Node/Postgres
STACK
error

THE PROBLEM

The client needed a unified business management platform capable of tracking granular inventory changes, handling complex point-of-sale transactions including scheduled credit ('themam') payments, and managing employee shifts via a cashbox system. Most importantly, the system had to automatically comply with the strict tax regulations required by the Jordanian 'Fawtara' tax authority, meaning it needed to map real-time sales data into validated UBL 2.1 XML formats.

lightbulb

THE SOLUTION

Developed a highly modular backend architecture using Node.js and Express, backed by a PostgreSQL database hosted on AWS via Supabase. The system utilizes Sequelize ORM wrapped in transactions to ensure data atomicity across complex operations like stock deduction and invoice creation. We built a custom XML builder to handle the Fawtara compliance, alongside a granular Role-Based Access Control (RBAC) engine and a strict Audit Logging system that records an immutable JSON history of all financial state changes.

stars

KEY ACCOMPLISHMENTS

check

Direct API integration with Jordan's Fawtara E-Invoicing network, including automated generation of UBL 2.1 XML documents

check

Advanced Inventory Management enforcing FIFO (First-In-First-Out) stock consumption, low-stock percentage alerts, and automated profitability calculations

check

Comprehensive Cashbox Management allowing managers to lock daily shifts and reconcile cash, visa, and scheduled credit totals

check

Financial Auditing System that captures immutable 'before' and 'after' serialized JSON snapshots of all critical invoice and stock edits

check

Dynamic Role-Based Access Control (RBAC) utilizing fine-grained permission string arrays mapped to JWT authentication

ARCHITECTURE & GOVERNMENT INTEGRATION

Built on a Node.js/Express environment utilizing a PostgreSQL database hosted on AWS via Supabase. The most complex integration is the 'Fawtara System' module. Every finalized cash or credit invoice passes through a custom xmlbuilder2 pipeline that strictly maps internal JSON schemas to UBL 2.1 XML standards (Sections A-F including taxes and allowances). This XML is then base64 encoded and dispatched via Axios to the government tax API, returning automated QR codes and UUIDs directly to the user's receipt.

FINANCIAL LEDGER & STOCK INTEGRITY

The system ensures strict accounting parity between general expenses, inventory purchasing (Buy Invoices), and sales (Sell Invoices). The stock engine uses a First-In-First-Out (FIFO) algorithm to process inventory consumption. Additionally, it supports 'Themam' (credit) invoicing, complete with a payment schedule module that tracks partial customer repayments over time until the invoice is marked as fully completed.

SECURITY, AUDITING & ACCESS CONTROL

Security is enforced at two layers. First, a granular RBAC system assigns detailed permissions (e.g., 'cashbox.lock' or 'reports.logs') to specific user roles, which are verified against secure, HTTP-only JSON Web Tokens upon every request. Second, an immutable Audit Logging system acts as a financial black box. It specifically tracks all 'add', 'edit', and 'delete' actions on critical entities, saving serialized snapshots of the data state before and after the change, enabling administrators to easily query reports for 'suspicious actions'.

TECHNOLOGY STACK

Node.jsExpress.jsPostgreSQLSequelize ORMSupabaseJWTXMLBuilder2RBAC
lockSOURCE & DEMO PRIVATE

Need something built like this?

I'm available for new projects — Full Stack, Node.js, databases, or end-to-end. Let's talk about what you need.