Custom Software for Legal Technology (LegalTech)
Secure, flexible, and compliant architecture tailored for the unique challenges of the Legal Technology (LegalTech) sector.
Vivek Mishra — Founder & Lead Architect, ERPStack
Quick Answer
In short: in a legaltech system a client matter can never go negative. ERPStack builds custom legal software with a per-matter IOLTA trust ledger in PostgreSQL, LEDES 1998B and UTBMS validation on every invoice, FRCP 37(e) litigation holds with defensible load files, and Model Rule 1.6(c) confidentiality enforced through RBAC.
Why Custom ERP for Legal Technology (LegalTech)?
Operating in the Legal Technology (LegalTech) sector requires a systems architecture designed for high scalability, operational flexibility, and strict regulatory compliance. Standard off-the-shelf software forces your teams to reshape their workflows to fit rigid software packages. A custom ERP for the Legal Technology (LegalTech) industry maps directly to your exact business logic. Deployed to your secure cloud infrastructure (AWS or Azure), the system isolates database schemas, automates redundant reporting tasks, and scales without user seat licensing fees. This ensures your corporate data remains under your absolute control, eliminates vendor lock-in, and lowers long-term operational technology costs by up to 70% over a 3-year period.
Industry Pain Points
- The practice management system and the finance ERP never reconcile at month end
- Trust accounting in a general ledger that will let a client matter go negative
- LEDES 1998B e-billing files rejected on UTBMS task and activity codes after transmission
- Conflicts checked by searching iManage or NetDocuments instead of a party index
- Ethical walls enforced by folder permissions rather than Postgres row-level security
- Legal holds tracked by email, so FRCP 37(e) preservation cannot be evidenced
Engineering Blueprint
The architecture spec for a legaltech ERP is not the document store — it is the professional-conduct rules, because they contain database invariants. Model Rule 1.15 makes a lawyer hold client property separate from the firm’s; ERPStack turns that into a PostgreSQL constraint before the first Drizzle ORM migration.
The trust ledger that cannot go negative
Trust accounting is the one legaltech ledger with a hard invariant: no balance for an individual client may be negative at any time. Massachusetts SJC Rule 1.15 lists the records — a check register, a subsidiary ledger per client matter, a ledger for the firm’s own funds covering bank charges — and a reconciliation at least every 60 days proving 3 balances identical: register, adjusted bank statement, and the sum of all matter balances. Records survive 6 years past the representation. ERPStack builds that as a per-matter PostgreSQL ledger in Drizzle ORM with a CHECK constraint, so ACID Compliance enforces it; NetSuite, Odoo and Sage X3 let an operator post the negative and apologise later, which is the Technical Debt every legaltech ERP inherits.
// Drizzle ORM on PostgreSQL — IOLTA: a client matter can never go negative
export const trustLedger = pgTable('trust_ledger', {
matterId: uuid('matter_id').notNull(),
postedAt: timestamp('posted_at').notNull(),
amountCents: bigint('amount_cents', { mode: 'number' }).notNull(),
runningCents: bigint('running_cents', { mode: 'number' }).notNull(),
}, t => [check('no_negative_matter', gte(t.runningCents, 0))]);LEDES and UTBMS: billing as a wire format
Outside counsel guidelines are a rules engine, not a PDF, and LEDES is the wire format that carries them. LEDES 1998B is an ASCII pipe-delimited file of 24 fields, still the most used legaltech e-billing standard in the US; the LEDES Oversight Committee also publishes LEDES 98BI, LEDES 2000, LEDES XML Ebilling 2.0, 2.1 and 2.2, and a LEDES API ratified in 2020. Every line carries UTBMS codes — the ABA Litigation Code Set of 1997 has 5 phases and 29 task codes, LOC Patent Codes date from 2009, IP Patent Prosecution Codes from 2023. ERPStack validates codes, rate cards and block-billing rules in TypeScript with Zod, publishes over a REST API, and pairs it with Certified Timesheet Tracking so realisation is measurable.
Ethical walls are an access model
A conflicts check is a graph query over parties, not a full-text search of documents. When a personally disqualified lawyer joins a firm, the conduct rules require timely screening from any participation plus prompt written notice to the affected former client — in engineering terms, Postgres row-level security keyed to matter and person, an access-attempt log, and proof the wall existed on a date. ERPStack builds legaltech conflicts as a normalised party graph in PostgreSQL under RBAC, SSO and short-lived JWT sessions, multi-tenant by firm and matter and surfaced through Next.js and TypeScript. Elite 3E and Aderant at the large end, Clio and PracticePanther at the small end are all credible, which is why we cut over in stages — the Strangler Fig Migration Pattern takes time and billing first and leaves practice management authoritative until finance and practice management reconcile.
Our Solutions
- Per-matter IOLTA trust ledger in PostgreSQL with a CHECK constraint that refuses a negative balance
- Three-way reconciliation generated in SQL: check register, bank statement and matter balances
- LEDES 1998B and LEDES XML 2.2 export validated against UTBMS codes in TypeScript with Zod
- Conflicts as a normalised party graph in Drizzle ORM, not full-text search over documents
- Ethical walls as Postgres row-level security with an access-attempt Immutable Audit Trail
- Legal holds, custodians and Concordance DAT load-file exports on Next.js with RBAC and SSO
Compliance & Security
In legaltech the conduct rules are the acceptance criteria. ERPStack reads Model Rule 1.6(c) and FRCP 37(e) as PostgreSQL requirements, not as a security page.
Rule 1.6(c): reasonable efforts, evidenced
Rule 1.6(c) requires reasonable efforts to prevent inadvertent or unauthorised disclosure of, and unauthorised access to, confidential client information; Comment [18] weighs the sensitivity of the information, the likelihood of disclosure, the cost and difficulty of safeguards, and whether a safeguard makes the software too hard to use. Rule 1.1 Comment [8] adds the duty to keep abreast of the risks of relevant technology. A legaltech build answers with RBAC, SSO, OAuth, per-matter keys in AWS KMS, a Bastion Host inside a Zero-Trust Security perimeter, and Semgrep SAST inside CI/CD Deployment Pipelines.FRCP 37(e) makes the audit trail a requirement
If electronically stored information that should have been preserved is lost because a party failed to take reasonable steps, FRCP 37(e) lets a court order curative measures — and on a finding of intent to deprive, instruct a jury to presume the information was unfavourable, dismiss the action, or enter default judgment. Hence legaltech needs an Immutable Audit Trail, not a soft-delete flag; the rule has read this way since 1 December 2015. ERPStack scopes legal holds to custodians and matters as Event-Driven Architecture messages on Apache Kafka, blocks the purge job at the PostgreSQL level while a hold is live, and mirrors releases to AWS S3 Object Lock.Production, load files and the EDRM
Discovery has a shape: EDRM Model 2.0, published 2023, and FRCP 26(f), which makes parties confer at least 21 days before the Rule 16(b) conference and file a plan within 14 days covering preservation and form of production. FRCP 34(b)(2)(E) then requires ESI as ordinarily maintained or in a reasonably usable form, never the same ESI in two forms. The Western District of Washington model ESI agreement names the columns — custodian and duplicate custodians, author, recipients, subject, file name, size, extension, original path, created, sent, modified and received, and hash value — 14 columns before a document moves. ERPStack models that in Drizzle ORM and emits Concordance DAT and Opticon OPT load files from a Node.js worker on AWS, regression-tested with Playwright.Privilege, clawback and data residency
FRE 502(d) lets a federal court order that disclosure connected with the litigation does not waive privilege, and that the non-waiver binds any other federal or state proceeding — so a legaltech system must be able to un-produce a document and show which order covered it. Cross-border matters add residency: Commission Implementing Decision (EU) 2023/1795 of 10 July 2023 is the EU–US Data Privacy Framework an outside counsel guideline points at. ERPStack pins a matter to a region at row level, keeps GDPR Data Compliance and SOC 2 Compliance evidence in PostgreSQL, and routes model calls through an allow-list so privileged text never reaches an unapproved endpoint. Proposed Evidence Rule 707 was published for comment from 15 August 2025 to 16 February 2026.
Standards we engineer to
- ABA Model Rule 1.15 / IOLTA
- ABA Model Rule 1.6(c)
- FRCP 37(e)
- FRE 502(d)
- EU-US Data Privacy Framework
- SOC 2 Type II
- ISO 27001
Get the Blueprint
Download our comprehensive Systems Architecture Blueprint to see how we architect compliant solutions.
Download BlueprintMetrics & Integrations
Illustrative engineering targets for this sector — the SLAs and capacities we design and build toward, not a live service dashboard.
Negative trust balances by PostgreSQL constraint
Three-way reconciliation cadence
LEDES 1998B fields validated pre-send
Legal hold notice to purge-lock
Integration: LEDES 1998B / LEDES XML 2.2
Integration: UTBMS code sets
Integration: iManage
Integration: NetDocuments
Integration: Relativity
Integration: Elite 3E
Implementation Process
Trust invariant design
The per-matter IOLTA ledger and its PostgreSQL CHECK constraint, written before any legaltech UI.
Matter and party graph
Drizzle ORM tables for clients, matters, parties, aliases and adverse relationships.
LEDES and UTBMS conformance
LEDES 1998B and LEDES XML 2.2 writers with UTBMS validation in TypeScript and Zod.
Ethical wall and access log
Postgres row-level security keyed to matter and person, with RBAC, SSO and an access-attempt trail.
Hold and production pipeline
Legal holds, custodian tracking and Concordance DAT load-file exports behind an Immutable Audit Trail.
Strangler Fig cutover
Time and billing move to Next.js first; practice management stays authoritative until ledgers agree.
Proven in Legal Technology (LegalTech)
Field Operations & Compliance Portal
Unified operational portal for field tracking and compliance
Read Case StudyFrequently Asked Questions
One invariant: no individual client balance may be negative at any time. Massachusetts SJC Rule 1.15 also requires a check register, a subsidiary ledger per client matter, and a reconciliation at least every 60 days proving register, bank statement and matter totals identical. ERPStack enforces the invariant as a PostgreSQL CHECK constraint, because legal ledgers cannot rely on operator discipline.
Almost always the codes, not the transport. LEDES 1998B is an ASCII pipe-delimited file of 24 fields, and each line carries UTBMS task, activity and expense codes; the ABA Litigation Code Set of 1997 alone has 5 phases and 29 task codes. ERPStack validates codes, rate cards and block-billing rules in TypeScript with Zod before the legal invoice is transmitted.
At 40 lawyers, usually buy. Clio and PracticePanther cover intake, matters, time and trust for most legal work, and a custom ERP that only re-creates them is wasted spend. Custom software development earns its place when a firm has a workflow it will not bend — an alternative fee model, a client-specific outside counsel rules engine. ERPStack often builds beside Clio.
Elite 3E and Aderant are genuinely deep at partner compensation, multi-currency and matter costing, and a firm that already runs one rarely benefits from replacing it. The recurring legaltech complaint is that finance and practice management never reconcile. ERPStack usually builds the reconciliation layer and the client-facing portal in Next.js rather than a replacement ERP.
As row-level security plus an access log, not folder permissions. The conduct rules require timely screening of a personally disqualified lawyer from any participation, plus prompt written notice to the affected former client. ERPStack keys Postgres row-level security to matter and person, records every access attempt in an Immutable Audit Trail, and version-stamps the wall so a legal auditor can see when it existed.
That reasonable steps were taken to preserve. FRCP 37(e) lets a court order curative measures when electronically stored information that should have been preserved is lost, and on a finding of intent to deprive, instruct the jury to presume it was unfavourable, dismiss, or enter default judgment. ERPStack blocks the purge job at the PostgreSQL level while a legal hold is live.
By making the egress path the enforcement point. ERPStack routes every model call through an allow-list bound to the matter, strips privileged fields before the request leaves, and writes the prompt, model version and destination into an Immutable Audit Trail. That gives a legal team an answer to what left the building, and lets a client-specific restriction be enforced rather than promised.
Yes, if residency is a column and not a policy. ERPStack tags each legaltech matter with a region at row level, deploys the workload into that AWS or Microsoft Azure region, and keeps GDPR Data Compliance evidence queryable. Where transfers to the US are involved, the reference point is Commission Implementing Decision (EU) 2023/1795 of 10 July 2023, the EU-US Data Privacy Framework.
Because a conflict lives in the party list, not the documents. iManage and NetDocuments index files; a legal conflicts check needs normalised parties, aliases, corporate parents and adverse relationships joined across every matter the firm ever opened. ERPStack builds that as a party graph in PostgreSQL with Drizzle ORM, so the query is deterministic instead of a relevance score.
The form agreed at the Rule 26(f) conference, or failing that, FRCP 34(b)(2)(E): as ordinarily maintained or in a reasonably usable form, and never the same ESI in two forms. FRCP 26(f) makes the parties confer at least 21 days before the Rule 16(b) conference. ERPStack emits Concordance DAT and Opticon OPT load files with Bates ranges, extracted text and hash values, so a legal team never produces the same document twice.