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.
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.