A partner platform for personal bankruptcy procedures
The full cycle of a partner lawyer working with a debtor client: registration, moving through the procedure on a state machine, settlement calculations, document generation, training, notifications, chat with a supervisor.
About the client
URITECH runs personal bankruptcy procedures through a network of partner lawyers across the regions. The partner brings the client — the debtor — and URITECH supports the procedure.
The technological challenge: automate the work of several dozen partners with hundreds of clients at once, across partners of very different skill levels, procedures of different complexity, and the compliance requirements of legal practice.
The problem
Before the portal, everything ran on spreadsheets, messengers and personal email. That worked at five to ten partners. Past fifty it started to break:
- Documents got lost. Every procedure involves dozens of signed documents. Partners sent them by messenger, lost them, confused versions.
- Finance was calculated by hand. Partner commission, deductions, balances — spreadsheets, errors, disputes.
- Partners did not know the status. When to file the next document, what to expect from the client — they asked the supervisor in chat. One supervisor was drowning in 200-plus messages a day.
- Onboarding a new partner took three to four weeks of a supervisor’s unpaid time.
What we built
A full portal with eight connected modules.
A multi-role model
- The partner works with their own clients.
- The supervisor sees the partners in their region and helps them.
- The administrator sees everything, and manages settings and pricing.
- The client — the debtor — gets a simplified portal with only their own documents and statuses.
JWT authentication, role-based access enforced at the service layer, soft delete for every key entity.
A procedure state machine
Each bankruptcy procedure is a sequence of more than thirty stages with transition conditions. We implemented it as an explicit state machine at the service layer: transitions are validated, history is preserved, and progress is visible on the dashboard.
Finance and settlements
Partner commission, deductions, instalments, penalties. Every formula is covered by unit tests at 100% — an error in finance means a damaged relationship with a partner, so the risk here is held at zero.
Document generation
DOCX templates in S3, filled through python-docx, versioned. The partner picks a template, a service fills in the client’s data, and the finished file downloads. Template changes go through the admin panel, with no code release.
Real-time chat with a supervisor
A WebSocket channel between partner and supervisor for each client. History is written to Postgres, files to S3. This cut the supervisor’s load threefold: instead of 200 scattered messages a day, around 30 structured threads.
Notifications
A centralised notification service: email, push, in-app. The partner chooses the channels. Both scheduled notifications (a document deadline has arrived) and event-driven ones (the supervisor replied in chat).
Payments
Payment integration for accepting money from clients and transferring commission to partners, with support for instant payments, recurring charges and commission splitting.
Partner training
A course of twelve lessons with tests. Until it is completed, functionality stays limited. This cut onboarding for a new partner from three weeks to five days.
Stack and infrastructure
- Backend: Python 3.12, FastAPI 0.115, SQLAlchemy 2.0 (async), Alembic, Celery with Redis, structlog, slowapi for rate limiting, bcrypt with PyJWT for auth
- Frontend: React 18, TypeScript, Vite, TanStack Query, Radix UI, Tailwind, Zustand, react-hook-form with Zod, Sentry
- Tests: pytest with pytest-asyncio on the backend, Vitest, Testing Library and Playwright on the frontend
- Storage: PostgreSQL as the main database, Redis for Celery and caching, S3 for files and backups
- Payments: a payment provider SDK with instant-payment support
What mattered to the client’s business
- Data protection compliance and anti-money-laundering requirements: a separate audit log for sensitive operations.
- DOCX, not PDF — lawyers are used to editing documents, and PDF gets in the way.
- Soft delete everywhere — in legal practice nothing should simply disappear.
- Full logging of user actions — for resolving disputes between a partner and a client.
What changes for each role
A platform like this touches four different groups of people, and the value is different for each.
The partner lawyer. The portal covers the whole cycle of working with a debtor: documents, procedure status, commission calculation, training. Generating documents from DOCX templates with the client’s data filled in automatically saves hours on every procedure. Notifications arrive wherever the lawyer prefers — email, push or in the portal — and the system reminds them of filing deadlines, which makes missing a stage difficult.
The network supervisor. Instead of a stream of messages across messengers, there are structured threads per client, history inside the system, and files that do not get lost. This is the main source of savings: supervisor load falls without any loss in quality, which means the network can grow without hiring supervisors in proportion.
The operations director. The procedure runs on a state machine of more than thirty stages, so at any moment it is clear which document is due and when. The built-in training course with tests removes a substantial part of onboarding from the supervisor, and limiting functionality until training is complete holds network quality steady as it grows.
The debtor client. The portal shows which stage the procedure has reached, which documents are ready and what is required from them. That removes most of the calls to the lawyer — not because the client was told not to call, but because the question is answered before the call.
The IT director. A multi-role model where partner, supervisor, administrator and debtor each see only their own data, plus JWT authentication, an audit log for sensitive operations and soft delete — the baseline set for legal practice under data protection law. The finance module is covered by tests: commission, deductions and instalments are exactly where an error turns immediately into a dispute with a partner.
Does one platform cover both a client portal and document assembly?
In this one, yes, and the join between the two is where the work went.
Document templates are filled from the same procedure record the debtor’s portal displays. The partner picks a template, the service pulls the client’s data and the current stage out of the state machine, and the finished file downloads. Nothing is re-typed. That matters, because re-typing was the original failure: when the portal and the document generator are separate tools, somebody copies fields between them, and that is how versions diverged and documents went missing in messengers.
The combination also changes what the debtor sees. The portal shows the documents the procedure itself produced, at the stage that produced them, rather than a list of files somebody uploaded by hand. That is what removed most of the calls to the lawyer.
We do not rank commercial bankruptcy platforms against each other here. We have not run procedures on them, so any comparison table we published would be invented. What we can describe is what the two features cost when they are built together: six months, five people, and the finance module taking the largest share of the testing effort, because an error there becomes a dispute with a partner rather than a bug report.
Solo practitioner, or a network?
This platform was built for a network, and that is not a setting you switch off.
Three of the four roles exist only because the network does: the supervisor who covers a region, the administrator who manages settings and pricing, and the training course that keeps a new partner’s functionality limited until they pass it. Real-time chat belongs in the same group, since it needs somebody on the other end. For a lawyer working alone, all of that is weight without value.
What stays useful is the smaller half: the procedure state machine, document generation and the debtor portal, three of the eight modules. Those can be worth building on their own, but the arithmetic changes. A custom build pays off when coordination is the expensive part, and coordination is what a network has. A lawyer working alone has a filing-deadline problem instead, and a filing-deadline problem is smaller than a six-month project.
Details
Technical details are available on request under NDA. This is a live production project, deployed on the client’s own infrastructure.
A similar problem in your business?
In one call we will work out what this would be worth to you and which architecture fits.
Services used in this project
- B2B platforms
Custom B2B platform
Custom development of B2B platforms, partner portals, CRM and workflow systems: roles, integrations, payments, documents, analytics.
- Messenger bots
Messenger bot development for business
Telegram bot development for B2B: order intake, CRM and accounting integration, payments, a user portal inside the messenger, AI answers, support and sales bots.
- Legaltech
Legaltech platforms and legal portals
Building legaltech platforms, legal portals and B2B2C services for law firms: case workflow, automated document generation, payments, integrations with government services.
What else we can show
Deep dives on this case
- Automatic document generation: when you need an LLM and when you need a templateAI and LLM
- A legaltech platform for a law firm: what to automate and what to leave aloneB2B platforms
- Bankruptcy software with a client portal: what a solo practitioner needs and what to skipB2B platforms
- How to check a development estimate: what belongs in it and what is usually missingB2B platforms
- What a custom B2B platform costs, and why the range is so wideB2B platforms
- What a legaltech platform costs for a law firmB2B platforms
- What support for a system costs after launch and what it coversB2B platforms
- A custom development contract: what the client should put in it to avoid depending on the vendorB2B platforms
- How to accept work from a vendor stage by stage when you are not a programmerB2B platforms
- Product-led custom development: how it differs from project work and when you need itB2B platforms
- Build or buy: when a custom B2B platform pays off and when it does notB2B platforms
- How to choose a development vendor: what to check before you signB2B platforms
- The discovery phase: what the client pays for and what they get to keepB2B platforms
- The vendor has disappeared and the system is still running: how to take it overB2B platforms