New productLegal
SaaS for law firms
Multi-tenant platform for law firms covering clients, case files, documents, calendar and billing, with plan-based subscriptions billed through Stripe.
My contribution: Subscriptions & payments backend (Stripe) · security · containers & deployment
Highlights
- 01Plan-based subscriptions with Stripe: the firm signs up, pays, and its workspace is provisioned automatically.
- 02JWT authentication (Spring Security) with refresh tokens in an HttpOnly cookie, out of JavaScript's reach, and fine-grained roles.
- 03One database per firm, with versioned migrations for the central database and for each firm.
Case study
The problem
Small and mid-sized firms managed case files in shared folders and spreadsheets. Commercial tools were expensive or didn’t fit local practice.
What I did
I built the Stripe integration (customers and plan subscriptions), plus security and containerized deployment, and made the data design decisions.
Technical decisions
- Database-per-tenant instead of a shared schema with a tenant_id column: backing up or deleting one firm’s data is an isolated operation, and no query can mix two firms’ data. The trade-off: every firm adds a database and its connections, and migrations run per firm.
- Two-level migrations: one set for the central database and another for the firm databases, applied when a firm is provisioned and on every new release.
Need something similar?
Let's talk →