Insurance quoting platform: a leaner data layer and tests before launch
On an insurance quoting and binding platform heading for launch, I replaced the ORM with plain SQL, moved auth over in a day and put 269 unit tests around the rating engine and binding.
- Sector
- Insurance
- Role
- Engineer on the application from March to May 2026, and on its infrastructure until June.
- Timeline
- March to June 2026
- Stack
- SvelteKit, TypeScript, Postgres, AWS
Outcomes
- 269 Unit tests across the rating engine, PDF parser, binding and coverage.
- 1 day To move authentication to Better Auth across 14 routes, with a SQL migration for existing password hashes.
- 90 Packages removed by replacing the ORM with plain SQL across 39 models.
- 31 of 31 End-to-end tests passing, from a suite that had failures.
The problem
The platform quotes and binds insurance. Pricing comes from a rating engine, policies are bound through the app, and applications arrive as PDFs. I joined while it was being readied for launch.
What I did
I replaced the ORM with plain SQL on a Postgres connection pool: more than 14 services, 16 routes and 39 models. Twelve nested queries became two database views, and 90 packages came out of the dependencies. Validation moved to a lighter library at the same time.
After a day of magic-link login failures I moved authentication to Better Auth, across 14 routes, in a day. Existing users kept their passwords through a SQL migration of the stored hashes.
Then I put tests where mistakes cost money: the rating engine, the PDF parser, binding and coverage. That came to 269 unit tests, and the end-to-end suite went to 31 passing with none failing.
Getting ready for production
I set up continuous deployment to staging and production on AWS, with the client’s own domain. While preparing production for user acceptance testing I found an email configuration mismatch that would have silently failed every magic-link login, and added a guard against seeding production with test data.
Other work included an email system with stored templates and delivery logs, a billing fix for tax that was being left off, and time-limited, audited admin impersonation that can’t make payments or bind policies.
What a client gets from this
Fewer moving parts, a data layer the team can read, and tests around the parts of the product where a mistake reaches a customer’s bill.
Have a prototype that needs to become a product?
Tell me what it is and when it needs to ship. Email is the quickest way to reach me.