khlass.ma
Khlass
Invoicing and compliance for Moroccan auto-entrepreneurs.
- Role
- Solo: product, design, code and infrastructure
- Year
- 2026
- Website
- khlass.ma
The problem
Moroccan freelancers live under hard limits: a yearly turnover ceiling, a flat tax on every dirham collected, and a 30% withholding once a single client pays more than 80,000 MAD in a year. Generic invoicing tools make PDFs. Khlass answers the questions that actually matter: how much room is left this year, which client is about to cross the threshold, and how much tax is due this quarter.
What I built
-
01
Quotes, invoices and credit notes with gap-free yearly numbering (
FA-2026-0001), where a number can only move forward. - 02 Live gauges for the annual ceiling and the per-client threshold, computed on cash actually collected and converted to MAD at the payment date.
- 03 A free-form A4 document designer: blocks positioned to the millimetre, legal mentions movable but never removable.
- 04 Pixel-exact PDFs rendered by headless Chromium, with an automatic fallback when Chromium isn’t available.
- 05 Subscriptions by card through YouCan Pay or by bank transfer with manual approval, both through a single activation path.
- 06 The whole product, documents included, in French and English.
Details I obsessed over
- An issued invoice is immutable. Corrections go through a credit note linked to the original, exactly as the law expects.
- Ceilings, rates and legal wording live in one config file: a new finance law is a one-line change, not a hunt through the code.
- Clients paying from abroad through Deel, Upwork or Payoneer get a yearly total instead of a withholding gauge that would mislead.
- Legal content is frozen when a document is issued; branding is applied when it’s rendered. Changing your logo never rewrites history.
Stack
- Laravel 13
- PHP 8.4
- Chromium PDF
- YouCan Pay
- MySQL
- Redis
- Cloudflare R2
- Turnstile
- Alpine.js
- Tailwind CSS
- Blade
- Docker