Enterprise resource planning system with inventory, sales, purchasing, and accounting modules. Pairs a Rust API with a React interface and TypeScript client, preserving tenant context across all operations.
The problem
Orders, inventory stock, and double-entry bookkeeping must stay synchronized while strictly isolating data and access permissions between companies.
The solution
Modular monolith organized in Rust crates using Axum and SQLx. PostgreSQL enforces Row-Level Security (RLS) within tenant-scoped transactions. Modules link stock reservations, dispatches, and journal entries; React interacts with the API through a typed TypeScript SDK.
From sales order to journal entry
The sales cycle coordinates documents, stock reservations, and inventory movements. Automated journal entries are posted when company ledger accounts are configured.
- Sales orderCustomer · products · warehouse
- ConfirmationStock reservation
- DispatchInventory release
- BookkeepingIf accounts configured
Create sales order
React · TypeScript SDK · Rust
The order aggregates customer details, products, quantities, and target warehouse. The Rust API validates input and calculates line item totals.
Confirm and reserve
SQLx · PostgreSQL
Order confirmation reserves available inventory and validates current warehouse balances within an atomic transaction.
Dispatch and log movements
Inventory · stock movements
Order dispatch fulfills reserved stock, registers physical warehouse movement logs, and advances the sales order status.
Post to general ledger
Double-entry · tenant context
If company accounts are configured, the system generates double-entry journal records within the dispatch transaction under tenant context.
Traceable inventory
Reservations and movement records maintain complete visibility into how sales activity affects warehouse stock.
Accounting ledger entries
Automated journal entries connect commercial transactions directly to the balance sheet and profit-and-loss reports.
Key technical challenges
Preserving tenant context across every operation
Transactions set tenant configuration before querying or modifying records. PostgreSQL RLS policies evaluate this context to restrict access strictly to each company’s rows.
Coordinating inventory and accounting
Order confirmation reserves stock, and order dispatch deducts inventory while logging movements. When accounts are configured, dispatch generates the corresponding accounting journal entry within the exact same database transaction.
Core capabilities
- Multi-warehouse inventory, movements, and stock reservations.
- Sales and purchase orders, customer and supplier management.
- Double-entry bookkeeping, collections, payments, and financial reports.
- Company data isolation and role-based access control (RBAC).
- TypeScript client SDK, OpenAPI documentation, and Docker deployment.
