Ahmed AlsaidyProduct & Systems Engineer
← All projects
Local-first Inventory, Treasury & POS
Client System

ManageX ERP & POS

A local-network inventory, accounting and POS system covering purchasing, barcode cashier sales, document-backed stock movements, treasury balances and role-based permissions

Role
Full-stack engineering & UI design
Timeline
2026
Platforms
Windows · Web · Server
كاشير POS
fast checkout & receipts
مخازن وخزينة
stock ledger & treasury
عربي / EN
bilingual interface
LAN
offline local network
ManageX daily operations dashboard with stock, sales and balance KPIs
ManageX daily operations dashboard with stock, sales and balance KPIs Click to expand ⤢

Overview

Business problem & context

Trading businesses and warehouses operating on a local network need a system that keeps running when the internet drops while preventing silent stock adjustments or unlogged cash edits

System Architecture

System layers & components

A local-first Windows LAN system: a FastAPI application server fronting a locked-down PostgreSQL database, with a bilingual (AR/EN) operations UI supporting barcode POS, 80mm thermal receipts and A4 invoices

Architecture diagram of Warqa w Qalam and ManageX unified storefront, offline POS, and stock ledgerARCHITECTURE BLUEPRINT · OMNICHANNEL & OFFLINE POS120 TABLES · 572 TESTS · 80MM THERMALONLINE STOREFRONTWarqa w Qalam Web52 Public Web RoutesCart · Checkout · OrdersRTL Mobile + DesktopIN-STORE & OFFLINE LANBarcode POS & ManageX• Works Without Internet• USB Barcode Scanner• 58/80mm Thermal & A4Signed Offline LicenseERP & RBAC ENGINELaravel 12 / FastAPI• 184 RBAC Staff APIs• 6-Role Permission Guard• Supplier Purchase Orders• Server Print PDF Engine• Margin & Sales Analytics572 PHPUnit Tests7,786 Assertions + E2EIMMUTABLE LEDGER DBPostgreSQL (120 Tables)Stock LedgerDocument-Backed OnlyCash TreasuryAppend-Only ShiftsPartner Sub-LedgersSuppliers & CustomersMandatory Audit TrailNo silent balance edits
L1

Operations UI · Desktop & Mobile LAN

Catalog, stock ledger, POS checkout & treasury screens

  • Bilingual UI (AR / EN)
  • Barcode POS Session
  • A4 & 80mm Receipt Preview
  • Responsive 390px LAN View
L2

Application Server · FastAPI (Python)

Business rules, 6-role RBAC, print engine & licensing

  • FastAPI REST Services
  • 6-Role RBAC Catalog
  • Server-Side Print Templates
  • Digitally Signed License Verifier
L3

Persistence · PostgreSQL (Server-Only)

Append-only ledgers, partner balances & mandatory audit log

  • Document-Backed Stock Ledger
  • Append-Only Cash Treasury
  • Customer & Supplier Sub-Ledgers
  • Immutable Security Audit Log
Tech Stack — Technologies used:
  • FastAPI
  • Python
  • PostgreSQL

Data Model

Database schema & core tables

Built on document-backed ledgers: no screen edits a stock or cash balance directly; every balance is the sum of signed document entries

Table Role in the system
products / warehouses Bilingual SKU catalog, barcodes, units, dual price tiers & warehouses
stock_ledger_entries Stock movements strictly linked to purchase, sale, transfer or count docs
purchase_orders / sales_orders / pos_sessions Purchase invoices, sales orders and cashier POS sessions
treasury_entries / partner_balances Cash/bank ledger and customer/supplier receivable & payable balances
roles / permissions / audit_logs RBAC permission matrix and mandatory audit trail

Implementation

Key technical decisions

01

Document-backed, append-only stock & cash ledgers

Every stock or cash change must originate from a posted document (purchase, sale, transfer or inventory count), making reconciliation deterministic

02

Server-rendered A4 & 80mm thermal print templates with audit logging

A4 invoices and 80mm thermal receipts are rendered server-side in Arabic and English, and every print action is recorded in `audit_logs`.

03

Digitally signed online/offline licensing

Protected on-premise deployments with digitally signed machine-bound licenses supporting offline activation alongside built-in backup and restore

Security

Security & access control

  • PostgreSQL listens only to the local FastAPI application server; clients never connect to the DB directly
  • Six built-in roles with granular permission checks guarding financial reports, discounts and user administration
  • Mandatory audit log capturing logins, role changes, invoice postings and document prints

Code Highlight

Invariant: every stock ledger entry requires a source document

managex/domain/ledger.py · PY
ALLOWED_SOURCES = {"purchase_invoice", "sales_invoice", "pos_receipt", "stock_transfer", "inventory_count"}

def record_stock_movement(*, sku_id: int, warehouse_id: int, qty_delta: Decimal,
                          source_type: str, source_id: int, actor_id: int) -> LedgerEntry:
    if source_type not in ALLOWED_SOURCES or not source_id:
        raise ValueError("Stock movement rejected: a posted source document is required")
    if qty_delta == 0:
        raise ValueError("Zero-quantity movement is not permitted")
    return LedgerEntry(sku_id=sku_id, warehouse_id=warehouse_id, qty_delta=qty_delta,
                       source_type=source_type, source_id=source_id, created_by=actor_id)

Summary

Outcome & status

Deployed on-premise on Windows for full-team daily operation across catalog, purchasing, POS, treasury and financial reporting

Next project Maghsalty → Laundry & dry-cleaning marketplace

Technical Evaluation · GCC / Remote / Egypt

Building an operational system, rescuing an AI cloud stack, or hiring a Product Engineer on retainer?

Complete the 30-second scope qualifier so our first conversation goes directly into system architecture, milestones, and budget fit.