Loading
Updated Jun 30, 2026 · 2 min read
Rebuilding accounting and payroll for modern Moroccan businesses
Problem
Moroccan SMBs need accounting and payroll software that reflects local compliance rules, audit expectations, and operating constraints.
Solution
A compliance-first architecture with tenant-scoped data, versioned payroll rules, and operator workflows for review and approval.
Why this matters
The rebuild creates a foundation where compliance logic, tenant isolation, and audit history are modeled as product infrastructure instead of UI-only behavior.
Generafi's original product was built on legacy architecture that, while functional, had become increasingly difficult to extend. The system was optimized for a different era of Moroccan tax law, and every new compliance requirement meant manual system updates.
A rebuild from scratch was the only path forward that would not perpetually constrain the product vision.
Architecture principle
Architecture decisions should directly map to business constraints. The multi-tenant layer exists because SMBs are price-sensitive, not because distributed systems are interesting on their own.
Multi-tenancy is critical for unit economics, but isolation needs to be rock-solid. The direction is row-level isolation at the database layer with tenant-scoped queries at application boundaries.
Organizations in Morocco do not always map neatly to fixed role hierarchies. The product needs flexible roles and action-level permissions instead of assumptions baked into the interface.
Tax law changes. Payroll rules change. Historical calculations still need to remain reproducible. Each payroll configuration needs versioning, effective dates, and audit context.
First tenant
1
live
Payroll rules
47
versioned
Audit events
250K+
logged
Rule coverage
94
% compliance
System design, threat modeling, and compliance mapping before implementation.
Tenant isolation, user management, and audit infrastructure became the base layer.
Versioned payroll and tax rules moved from application logic into auditable product data.
The rebuild has given Generafi a stronger foundation, but the next work is about integration depth, better reporting, and performance at larger customer workloads.
Technical decisions and product lessons from this project.
Back to portfolio
View all projects →