Mahalli

Mahalli's invoices page, listing invoices with their client, status, total and amount paid in MAD

Mahalli is a desktop app for inventory and invoicing, built around the B2B document chain Moroccan businesses use. The name means "local" in Arabic. It runs on Tauri v2, with a Nuxt 4 frontend on a Rust backend that uses SeaORM and SQLite.

What it does

Document chain

It covers every step of a B2B sale: quote, customer order, delivery note, invoice, payment, and credit note. An approved quote turns into an order, and invoices can't be edited once finalized, so corrections go through a credit note instead. Payments can be partial or full, and the app tracks what each client still owes.

Moroccan paperwork

Every printed document carries the legal identity fields Moroccan businesses need, for both the client and the seller: ICE, IF, RC, and Patente.

Workspaces

You can create, clone, and switch between separate workspaces without restarting the app.

Inventory, clients and dashboard

It tracks stock and products, keeps each client's documents together, and has a dashboard with charts.

Works offline

Everything is stored locally in SQLite, so there's no server to run.

What was hard

Two layers of SQLite

Each workspace is its own SQLite tenant database. A separate catalog database tracks every workspace and which one is active, and the app hot-swaps the tenant connection when you switch.

Built with

Tauri v2
Packages the app for Windows, macOS and Linux, with file dialogs, notifications and auto-updates
Rust
The backend, exposed to the frontend as Tauri commands for every document type
SeaORM
Entities, migrations and queries, split into crates for the catalog and tenant databases
SQLite
One database file per workspace, plus a catalog database that tracks them
tauri-specta
Generates TypeScript bindings from the Rust commands, so frontend calls are typed
Nuxt 4
The frontend, running inside the Tauri window
TypeScript
The language for the frontend
Tailwind CSS
Styling
shadcn/vue
UI components for tables, forms and dialogs, built on Radix Vue
VeeValidate and Zod
Form validation for clients, products and documents
Unovis
The charts on the dashboard
vue-pdf
Renders quotes, orders, delivery notes and invoices as printable PDFs
Nuxt i18n
Translations for the interface
GitHub Actions
Formats the code on every push to main and builds signed releases for Windows, macOS and Linux