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

- Lines of code
- ~427k
- Automated tests
- ~810
- Database tables
- 117
- Signed release
- v1.14.1
Screens
Supermarket point of sale: barcode line entry, quick keys for weighed produce, the running total with VAT and the payment button
ZATCA e-invoicing settings in the simulation environment: the registered business, this till’s onboarding, and the documents sent with their reported or cleared status
Cleared ZATCA tax invoice with item lines, VAT total and the e-invoice QR code
Today’s dashboard: net sales, gross and net profit, collections and payments, stock alerts, and items that need action
Touch-screen restaurant cashier with open orders, the menu grid and the current ticket
The pharmacy point of sale, one of five sector layouts the same product switches between
Licence server security: passkeys that sign licences, session limits, and the layers that protect the console
finyxerp.com: the Phase-2 e-invoicing page, signed XML and QR, reporting within 24 hours, clearance before printing
Restaurant web store menu with categories, item photos and prices
Staff portal kitchen view with incoming order tickets and per-item send buttons
finyxerp.com home: the till, stock, books and the authority stacked as one system
The business phone app selling from the same catalogue, with barcode search and stock per item
Customer Android app item screen with sauce choices, add-ons and the add-to-cart button
Manager Android app daily summary with sales, live orders and kitchen status
finyxerp.com on a phone
Problem / Solution
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
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.
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
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
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.
Tech stack
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
Outcome
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.
Written about it
Articles about this project
- "Arabic search that finds what you meant: hamza, taa marbuta, tashkeel"Why احمد does not find أحمد, which normalisation rules are safe and which merge different words, and where to normalise: the index and the query, never the text you show.
- Arabic on a thermal printer, and the five bytes that ate a rollWhy ESC/POS printers mangle Arabic, how to print it as a 1-bit image at the head's exact width, and the geometry bug that turned a 12 cm receipt into a roll on the floor.
- 372 tests passed. No sale could reach the ledger.How I keep a 322,000-line accounting system correct on my own: one save gate, append-only money, a hash-chained audit trail, real-database tests, and the audit that caught what they missed.
- Double-entry bookkeeping for developers: a ledger that cannot lieAccounting as a data model: entries that balance exactly, posting, reversal instead of editing, balances you derive, and the trial balance as a test, with real code from FinyX-ERP.
- The final payment should be the easy one. How I run client projectsHow I run client projects so the client pays, trusts me and comes back: a written proposal with phases, every phase live on their server, tests they can read, and a handover pack.
- What does custom software cost? The seven things that move the priceWhy two quotes for the same system can differ tenfold: the seven things that set the size, and the price, of custom software, with examples from systems I built.
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