YB
All work
ERP PlatformLive8 min read

Hesabi

Tunisian ERP & accounting SaaS for SMBs — invoicing, payroll, inventory, compliance.

Overview

Hesabi is a full-featured Tunisian SMB ERP: invoicing, accounting, payroll, inventory, and a client portal — designed around local fiscal reality.

Project story

Building an ERP means modeling the business carefully. A 36-model Prisma schema and 29 migrations exist so every module stays coherent as the product grows.

Problem

Tunisian SMBs needed a modern ERP that speaks local fiscal reality — TVA, TTN, TEIF — without enterprise complexity or spreadsheet chaos.

Solution

A Next.js 16 / React 19 product with Prisma/PostgreSQL, PWA support, PDF/XLSX exports, web push, and Dockerized prod/dev stacks with Playwright + Vitest coverage.

Features

  • Invoicing & fiscal compliance
  • Accounting & payroll
  • Inventory & client portal
  • PDF/XLSX exports & PWA

Architecture

Next.js 16 App Router · React 19 · Prisma/PostgreSQL · multi-stage Docker · PWA shell · background-ready workers for exports and notifications.

Frontend

Next.js 16 App Router dashboards and client portal.

Backend

Server actions / API routes tied to domain modules.

Database

36-model Prisma schema on PostgreSQL.

Authentication

Auth-gated modules with role-aware access.

Cloud

Compose variants for prod and dev environments.

DevOps

Multi-stage Docker builds with health checks.

Security

Hardened API boundaries and secrets isolation.

AI-ready

Data model prepared for reconciliation automation.

Security

  • Auth-gated modules with role-aware access
  • Hardened API boundaries and audit-friendly data flows
  • Secrets via environment isolation in Compose

Performance

  • Server Components for dashboard shells
  • Optimized PDF/XLSX generation paths
  • PWA caching for repeat sessions

Accessibility

  • Dense ERP UI with clear hierarchy
  • Keyboard-reachable primary actions
  • Readable tabular data patterns

Mobile experience

PWA support so field and office teams stay productive on phones and tablets.

AI features

AI-ready data model and export pipelines for future automation of reconciliation and reporting.

Challenges

  • Modeling Tunisian fiscal compliance without slowing UX
  • Keeping a 36-model schema coherent across migrations
  • Balancing ERP density with approachable SMB UX

Results

  • Full ERP covering invoicing, accounting, payroll, inventory, and client portal
  • 36-model Prisma schema with 29 SQL migrations
  • PDF/XLSX exports, web push, and PWA support for field teams
  • End-to-end Playwright + Vitest coverage with Dockerized prod/dev stacks

36

Prisma models

29

SQL migrations

Next 16

Stack

Lessons learned

  • Local compliance belongs in the schema, not in footnotes
  • Tests and Docker are part of the product for ERPs
  • PWA turns dense software into daily tools

Tech stack

Frontend

Next.js 16React 19TypeScriptPWA

Data

PrismaPostgreSQL

Quality

PlaywrightVitest

Ops

DockerCompose

Timeline

2025 — Present

8 min read

My role

ArchitectureFull-Stack DevelopmentProduct EngineeringDevOps

Scalability

Composable domain modules (invoicing → payroll → inventory) on a shared PostgreSQL schema designed for multi-tenant growth.

Video walkthrough

Product walkthrough placeholder — add a Loom or demo reel here when ready.