Skip to content
MSALEH

01 / 05 · Case Study

True Legal

A financial system for a law firm: client payments, case expenses, fees and staff advances in one place.

Sector
Legal
Role
Sole engineer
Year
2026
Stack
Next.js · PostgreSQL · Better Auth
True Legal dashboard in Arabic: payments, expenses, fees, balance and a six-month cash flow chart

01

The problem

A law firm needed one system for its clients, their cases and the money moving on their behalf: payments, case expenses, fees and staff advances.

The first version has run the firm's daily operations since launch. An October 2026 review led to production fixes and a second version on the firm's own infrastructure.

02

Constraints

  • Three roles, three views of the money

    Staff, admins and the owner each see a different part of the finances; only the owner sees everything.

  • Changes without downtime

    The firm works in the system daily, so no change may interrupt work or lose a record.

  • No password resets

    The move to the new version must not lock anyone out.

  • Arabic reports that match the screens

    Seven right-to-left PDF reports, matching the application to the piastre.

03

Three key decisions

  1. Decision 1ADR-0001

    PostgreSQL, with access rules in one place

    Self-hosted PostgreSQL replaces Supabase, giving the firm control of its data and backups. Access rules now live in one module that every query passes through.

    Trade-offWithout row-level security, every server route checks the caller's role, and Supabase's auth, realtime and storage each needed a replacement.

  2. Decision 2ADR-0002

    Existing passwords carried over

    Better Auth verifies the migrated password hashes as they are, so everyone keeps their current password.

    Trade-offThe old hashing scheme stays until each password is next changed.

  3. Decision 3Migration plan

    Settlements that keep the history

    Settling an account used to reset its payments and erase the history behind the balance. A dated Settlement record now closes it at a point in time.

    Trade-offOne more record type, in exchange for statements that can always be reproduced.

04

Outcome

  • The second version was verified against the first under all three roles: every page, exported amount and permission.
  • All seven Arabic PDF reports come from one module, in one to two seconds each.
  • Production fixes shipped first, verified against a full backup of the live database.

The second version goes live once the firm's new server is in place.

Want to hear how True Legal was built?

Screens

Demo data, invented for this page

  • A client's account with payments, expenses, balance and fees
    01One client's account for the current period.
  • A case's ledger with expenses and office costs, each recorded by a staff member
    02Each case keeps its own ledger, and every entry names who recorded it.
  • The log of every transaction across clients, filterable by client, type and date
    03Every movement of money, across all clients, in one log.
Next project02 / 05KidzeniaAn Arabic-first online store for a children's and teens' clothing manufacturer, with cash on delivery.
Kidzenia storefront home page in Arabic with a summer collection banner