All projects
LiveBusiness system

FinyX-ERP

Accounting, inventory, point of sale and ZATCA e-invoicing in one Arabic desktop product, with an online ordering platform on top

A commercial ERP and POS for small and mid-sized businesses: around twenty modules from sales and stock to payroll and zakat, ZATCA Phase-2 e-invoicing built from scratch, thermal printing, a licence server, and a restaurant ordering platform with a web store and mobile apps. In use at a restaurant today.

Visit the live sitefinyxerp.com
My role
Product owner and sole engineer: architecture, data model, desktop app, e-invoicing library, API, web, mobile, licence server and installer
Timeline
2026
Platforms
Windows desktop, Web, Android, REST API
finyxerp.com
Supermarket point of sale: barcode line entry, quick keys for weighed produce, the running total with VAT and the payment button
Customer Android app item screen with sauce choices, add-ons and the add-to-cart button
Lines of code
~427k
Automated tests
~810
Database tables
117
Signed release
v1.14.1

The problem

Small businesses usually run on a patchwork: one tool for sales, a notebook for stock, a spreadsheet for accounts, and an accountant who reconciles them at month end. Every gap between those tools is a place where money disappears without anyone noticing.

  • Sales, stock and the general ledger were recorded separately, so the books never matched the shelf.
  • Businesses selling in Saudi Arabia must issue ZATCA Phase-2 e-invoices: signed XML, a hash chain and reporting to the authority, which most local tools do not support.
  • Cashiers needed fast thermal receipts and labels, not A4 reports, and the till has to keep selling when the internet drops.
  • Owners could not limit what each employee sees or changes.
  • Restaurants wanted online orders without paying a delivery app a commission on every sale, and the orders that do come through delivery apps were never settled properly in the books.

The solution

One desktop product that treats every sale as an accounting event, signs it for ZATCA in the same transaction, and extends online through an API that shares the same business logic.

  • Around twenty modules: accounting, sales, purchasing, inventory, restaurant POS and kitchen display, delivery, payroll, attendance, commissions, production, branches, multi-currency and zakat.
  • An invoice, its stock movements, its journal entry and its signed e-invoice are saved in one database transaction.
  • ZATCA Phase-2 e-invoicing written from scratch in C#: UBL 2.1 XML, the cryptographic stamp, QR codes, device onboarding, clearance and reporting.
  • Three-level permissions (page, action and field) across 16 built-in roles.
  • A restaurant platform: web store, staff and kitchen portal, and customer, driver and manager apps.
  • A licence server with passkey sign-in, and a signed Windows installer with device-bound licences.

Architecture

A layered .NET solution where the desktop app and the online server compile the same domain and application code, so a business rule is written once and enforced in both places. E-invoicing is its own library with no operating-system dependency, used by both.

Shared FinyX core: Domain + Application

Desktop

  • WPF + MVVM
  • Own design system
  • Sells offline

Data

  • EF Core
  • SQLite, SQL Server, PostgreSQL
  • 74 migrations

Online

  • ASP.NET Core API (~220 endpoints)
  • Next.js store and staff portal
  • Customer, driver and manager apps

Compliance and devices

  • ZATCA Phase-2 library
  • Moyasar and Apple Pay
  • ESC/POS and label printers

Licensing

  • Licence server
  • Passkeys and Web Push
  • Native licence guard

Modules

Each module maps to a department, and all of them write to the same ledger.

Sales and POS
Fast cashier screen with an on-screen keyboard, cash shifts and shortages, returns, thermal receipts and barcode labels.
E-invoicing
ZATCA Phase 2: signed simplified and standard invoices, credit notes from returns, QR codes, device onboarding, and a queue that reports or clears every document.
Inventory
Lots and expiry dates with first-expiry-first-out, branch transfers and weighted-average costing.
Accounting
Chart of accounts, journal entries, closed periods per branch, year reopening, financial statements and zakat.
Purchasing
Supplier invoices and payments that update stock and payables together.
Restaurant
Tables, kitchen display, menu import with modifiers and sizes, business hours, online orders and a ready board.
Delivery
Driver assignment and tracking, driver commissions, and delivery platforms settled as payment methods with their own receivable and commission accounts.
Payroll and attendance
Employees, salaries and commissions posted to the ledger, with attendance from the phone checked by GPS and a device key.

Engineering decisions

Accounting software is judged by one thing: whether the numbers can be trusted a year later. E-invoicing adds a second judge, the tax authority, which recomputes every byte. Most of the work went into making wrong states impossible rather than unlikely.

One transaction per business event
An invoice, its stock movements, its journal entry and its signed e-invoice commit together or not at all, so the ledger can never drift from the shelf or from what ZATCA receives.
ZATCA Phase 2 without a third-party SDK
About 1,700 lines of C# on .NET cryptography alone: UBL 2.1 XML, C14N canonicalisation and SHA-256 hashing, an XAdES signature with ECDSA on secp256k1, and the nine-tag QR. After signing, the library hashes the final XML again and refuses to send it if anything changed.
A hash chain per till
Every device has its own key, counter and chain of previous-invoice hashes, so documents are submitted strictly in order. Simplified invoices are reported within 24 hours; standard B2B invoices are cleared by ZATCA before they are printed.
Onboarding that can resume
The till generates its key and CSR, requests a compliance certificate with the OTP, passes six sample documents (invoice, credit and debit note, standard and simplified), then swaps to a production certificate. Keys are protected by DPAPI on the desktop and ASP.NET Data Protection on the server.
Selling when the internet drops
Signing happens offline inside the sale, so the receipt carries a valid QR at once. A background queue reports pending documents every two minutes, retries on an outage (1 minute up to 3 hours) and stops on a rejection, so an error is never resent blindly.
Locked history
Posted documents cannot be edited and closed periods reject writes. A signed invoice is final: the only correction is a return with its own signed credit note.
Permissions enforced where data changes
Over 80 permissions at page, action and field level are checked in the service layer, not only where buttons are drawn.
One codebase, two hosts, three engines
The desktop app and the ASP.NET Core server compile the same domain code. EF Core runs on SQLite by default, SQL Server or PostgreSQL for larger sites, with an automatic move from SQLite to PostgreSQL.
Licensing that cannot be copy-pasted
A licence server with passkey (WebAuthn) sign-in, Web Push approvals and rate limits: a device activates only after the server attests it, and a native guard checks the licence and the binary at run time.
Release engineering
WiX MSI and setup builds, Authenticode code signing, and 22 builds between 7 and 17 November 2026 on the way to 1.14.1. The servers run behind Caddy with automatic TLS, HSTS preload and HTTP/3.

Desktop

  • C#
  • .NET 10
  • WPF
  • MVVM

Data

  • EF Core
  • SQLite
  • SQL Server
  • PostgreSQL

Server and web

  • ASP.NET Core
  • JWT
  • OpenAPI
  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS 4

Mobile

  • Expo 57
  • React Native
  • TanStack Query

E-invoicing

  • ZATCA Phase 2
  • UBL 2.1
  • XAdES
  • ECDSA secp256k1
  • C14N
  • TLV QR

Documents and devices

  • QuestPDF
  • ZXing
  • ESC/POS
  • TSPL

Payments and security

  • Moyasar
  • Apple Pay
  • SMS OTP
  • WebAuthn passkeys
  • Web Push
  • DPAPI

Release and hosting

  • WiX
  • Authenticode
  • Native AOT
  • Docker
  • Caddy

Where it stands

FinyX ships as a signed installer with an Android app beside it, is in its fourteenth minor release, and runs at a restaurant every day.

  • Version 1.14.1 was released on 17 November 2026, with 74 database migrations behind it.
  • About 810 automated tests cover accounting rules, permissions, the server, the licence server and e-invoicing, 25 of them dedicated to ZATCA.
  • The e-invoicing flow is proven end to end against ZATCA’s sandbox: onboarding, all six compliance checks, then reporting and clearance.
  • Running it at a real restaurant fed a round of fixes back into the cashier, printing and shift screens.
  • Training videos for the cashier, the owner and the accountant, and sector brochures, were produced from the product itself.

Need something like this?

Tell me about the operation you want to organise and I will map it into a clear system before writing a line of code.

Let's talk