PTENES
Legal ERP/CRM · Functional MVP

The entire firm in one single screen.

Clients, cases, deadlines, hearings, tasks, finances, and documents — with an AI legal assistant built into the system.

JurisFlow — AI-powered legal management: clients, cases, calendar and deadlines, finance, documents, and AI assistant
What it is

Nine modules, one database, zero spreadsheets

JurisFlow is a management system for law firms. It’s not a UI prototype: it has a frontend, backend, MySQL database, authentication, and an AI assistant connected to an LLM.

📊 Dashboard that balances the books

Clients, active cases, deadlines for the period, hearings, revenue, expenses, and balance — calculated from actual entries, not typed in by hand.

⚖️ Case with the complete file

CNJ number, court, court division, county, area, stage, client position, opposing party, case value, and activity history.

🤖 AI built into the workflow

Draft petition, case law analysis, deadline calculation, case update summary, extrajudicial notice, and fee agreement.

ModuleWhat it does
Overview DashboardMetrics for clients, active cases, deadlines, hearings, revenue, expenses, and balance
ClientsIndividual/business registration, CPF/CNPJ, contacts, address, profession, marital status, notes, and status
CasesCNJ number, court, court division, county, legal area, stage, opposing party, case value, and status
Case ProgressCase activity, with important items flagged
Client ServicesTriage of new clients via WhatsApp, in person, by video, phone, or email
Deadlines & ScheduleCritical deadlines, hearings, meetings, expert examinations, and due diligence
TasksInternal management: priority, owner, deadline, and status
FinanceRevenue, expenses, fees, court costs, due dates, payments, and cash flow
DocumentsPetitions, answers, appeals, powers of attorney, fee agreements, settlements, notices
AI AssistantGeneration and analysis of legal content via LLM, focused on Brazilian law
How it works

From first contact to fee paid

The path a case takes through the system — each stage is a module, and they all share the same client and case.

Client Service→ Client→ Case→ Case Progress→ Deadlines & Hearings→ Tasks→ Documents→ Finance

Process stages

Each case moves through a fixed sequence, and the dashboard shows how many are at each stage.

Initial→ Instruction→ Decision→ Appeal→ Enforcement→ Archived

Case status

Regardless of the stage, each case has an outcome status used in filters and metrics.

ActiveSuspendedSettled GainLostArchived

🗄️ Data model

Nine tables: users, clients, consultations, lawsuits, lawsuit_movements, calendar_events, tasks, financial_transactions, legal_documents.

🔗 Everything connected

A document links to a client + case + attorney. A financial transaction links to the case that generated it. Nothing is left unlinked.

🎨 Light and dark

Responsive interface with light/dark theme, built with React 19, Radix UI, and Tailwind.

Prerequisites

What needs to be up and running first

JurisFlow is a full-stack application: it runs a Node server and requires MySQL. It’s not a static site.

Node.js 20+ and pnpm

The project uses pnpm (there’s a pnpm-lock.yaml version-controlled) and ESM modules.

# check the versions
node -v
pnpm -v

Accessible MySQL

An empty database is all you need — Drizzle migrations create the nine tables.

# create the database
mysql -u root -p -e "CREATE DATABASE jurisflow"

An LLM key

Only for the Legal Assistant. The other eight modules work without it.

# open .env
BUILT_IN_FORGE_API_URL=
BUILT_IN_FORGE_API_KEY=
User guide · step by step

From clone to running system

Five steps. At the end, JurisFlow is running in your browser, populated with demo data.

1

Clone the repository

All the code — frontend, backend, migrations, and tests — lives in a single repo.

git clone https://github.com/inematds/jurisflow.git
cd jurisflow
2

Install the dependencies

Use pnpm: it owns the lockfile, and a patch is applied to wouter which npm ignores.

pnpm install  # install front end + back end all at once
3

Configure the environment

Copy the example and fill it in. DATABASE_URL e JWT_SECRET are required; LLM keys are needed only if you’re going to use the assistant.

cp .env.example .env

# .env — the minimum to get it running
DATABASE_URL=mysql://usuario:senha@localhost:3306/jurisflow
JWT_SECRET=um-segredo-aleatorio-e-longo
PORT=3000
4

Create the tables

Drizzle generates migrations from the schema and applies them to the database. It’s the same command in both steps.

pnpm db:push  # drizzle-kit generate && drizzle-kit migrate
5

Start the server

One process serves both the API and the frontend. Open the address, log in, and click “Generate Sample Data” in the menu to populate clients, cases, hearings, tasks, finances, and documents.

pnpm dev  # http://localhost:3000

Other commands

pnpm build — builds the front end and back end
pnpm start — runs the production build

Quality

pnpm check — TypeScript type check
pnpm test — Vitest suite

Formatting

pnpm format — Prettier across the board, using the repo’s rules.

Sales Demo

Empty database + “Generate Sample Data” = a fictional law firm ready to present in minutes.

AI Legal Assistant

Six operations, all under Brazilian law

The assistant is instructed to work with the CPC, CPP, CLT, Federal Constitution, Civil Code, CDC, and case law from the STF, STJ, and TST. You choose the operation and describe the case in plain Portuguese.

📝 Draft petition

Describe the case; it returns the document structure with legal grounds and requested relief.

🔍 Case law analysis

Surveys how the courts have ruled on the issue and how it applies to the case.

📅 Deadline calculation

Counted from the notice of service, according to the applicable procedural rule.

📄 Progress summary

Turns the court order or case update into plain language for the client.

📬 Extrajudicial notice

Drafts the notice based on the facts and relief requested that you provide.

🤝 Attorney fee agreement

Builds the agreement with its scope, billing method, and standard clauses.

Two real-world input examples

Draft petition — employment lawsuit

Cliente trabalhou como analista de logística,
fazia duas horas extras diárias e foi demitido
sem receber aviso prévio.

Case Law Analysis — consumer

Jurisprudência do STJ sobre dano moral
em caso bancário — Tema 1061.
⚠️ Check every citation before using it.

The assistant still no is connected to a legal database for verification. It is instructed to cite statutes and case law, but an LLM alone can produce incorrect references. Treat the output as a draft: every cited law and precedent must be checked against the source before being filed with the court.

Roadmap

Where it is and where it’s headed

JurisFlow is currently a functional MVP for legal ERP/CRM with an AI assistant. Next comes integration with the outside world — and, on the horizon, delegating repetitive work to agents.

Today
Legal ERP/CRM + AI assistantNine working modules on MySQL, OAuth + JWT authentication, one-click demo mode, and an assistant covering six operations.
Next
Verified sources and ready-to-use documentsResearch + citations + validation of legal sources in the assistant; direct DOCX/PDF generation of legal filings; RAG over the firm’s own documents.
Integrations
The system communicating with the outside worldAutomatic capture of CNJ case updates, Official Gazette publications, WhatsApp, Gmail, Google Calendar, document OCR, digital signatures, and PIX/boleto payments.
Scale
Large law firm operationsAdvanced team permissions, detailed auditing, multi-company/multi-office support, and automation of procedural deadlines.
Horizon
JurisFlow AgenticGo from being just office software to becoming its operating system: triage, legal, case management, deadlines, documents, and finance agents working in sequence — with the attorney as the approving supervisor.