estock.ma
eStock
Sales, purchases and inventory for Moroccan businesses.
- Role
- Solo: product, design, code and infrastructure
- Year
- 2026
- Website
- estock.ma
The problem
eStock is the multi-tenant rebuild of a legacy Symfony and Vue stock application that a distributor still runs every day. Quotes, delivery notes, invoices, purchases, stock and payments in a single tool that works on a phone, built around Moroccan rules: ICE, VAT, stamp duty and amounts in words.
What I built
- 01 Spaces with yearly dossiers, roles per space and a permission catalogue resolved per dossier.
- 02 A stock ledger as the single source of truth: FIFO lots, weighted average cost and transfers between warehouses.
- 03 Nine document types sharing one form engine: drag-to-reorder lines, sections, subtotals, and a discount spread across VAT rates with the same algorithm in JavaScript and on the PDF.
- 04 An importer that moves a real client’s legacy database into a fresh space, numbering and history included.
- 05 Dashboards with server-rendered SVG charts, in colours checked for colour blindness.
- 06 A landing page in French, English and Arabic (right to left), with screenshots generated automatically from a demo space.
Details I obsessed over
- Almost everything can be undone: a validated document goes back to draft, its stock movements are reversed and its number is kept.
- Money and quantities are computed with arbitrary-precision decimals, never floats.
- Every user action lands in a ClickHouse audit log with automatic rotation, readable as a plain-language history.
- A ⌘K global search that applies exactly the same visibility rules as the lists it searches.
Stack
- Laravel 13
- PHP 8.4
- ClickHouse
- MySQL 8.4
- Redis
- Pest
- Cloudflare R2
- Resend
- Alpine.js
- Tailwind CSS
- Blade
- Docker