Skip to content

Case study / VentureFract

Moving a venture investing platform from a Lovable prototype to a real backend

VentureFract is a two-sided fractional venture investing platform that connects investors and founders across the deal lifecycle. The product was built in Lovable, with a React frontend calling Supabase directly, so business rules lived in the browser and the database. I audited the whole backend surface and wrote the plan to move it into a separate FastAPI service without changing how the product behaves, and I am leading that migration.

Client
VentureFract
My role
Backend architect — audit, migration plan and delivery lead
Sector
FinTech · venture capital

The challenge

The platform covers onboarding, a deal pipeline, deal memos, investment committee voting, syndicates, term sheets, pitch decks and documents. All of it ran without a backend of its own. The React frontend read and wrote Supabase directly.

The backend behaviour was spread across 95 edge functions, 53 Postgres RPCs, about 200 triggers and roughly 1,219 row-level security policies over about 440 tables. Around half of the real business logic, including deal scoring, investor matching and the financial models, ran in the browser, where anyone could read or bypass it. AI usage limits and credit metering could not be enforced on the server.

Two more facts shaped the work. Ownership in the prototype was per user, while the target backend is organisation-based, so every record needed a mapping before anything could be ported. And an existing FastAPI backend already had about 140 endpoints and 83 tables, so a rebuild from scratch would have duplicated or conflicted with it.

  • Business logic, including scoring and financial models, running in the browser
  • No server-side enforcement of AI usage limits
  • Per-user ownership moving to organisation-based multi-tenancy
  • Inherited security gaps: hard-coded third-party keys, string-built SQL, unauthenticated admin paths

What I built

I started with a full audit of the Lovable backend: edge functions, RPCs, schema, triggers, row-level security, storage, realtime, integrations and the logic living in the frontend. That produced a complete endpoint inventory.

I reconciled the inventory against the existing FastAPI codebase and produced an overlap map showing what already exists, what needs extending and what is new. From that I wrote a phased migration plan, with a conversion approach for every surface and acceptance criteria for each phase. The per-user to organisation mapping is defined up front, and the existing organisation tenancy and self-managed JWT model is the target.

The browser-side scoring, matching and financial engines are moving to Python at exact numeric parity, checked with golden-master tests. That covers an 8-dimension deal scorer, 100-point investor matching, founder, investor and risk scores, and financial modelling for IRR, MOIC, TVPI, DPI, Monte Carlo and cap-table dilution. AI usage metering moves to the server behind a single LLM provider interface over OpenAI, Anthropic and Gemini.

Payments, escrow and KYC are feature-flagged stubs behind clean interfaces, with no real money movement. Hard-coded secrets move into configuration and string-built SQL is replaced with parameterised queries. I broke the delivery into Jira epics and tickets written against the actual code and onboarded the developers working on it.

Architecture and stack

Target backend
Python 3.12 · FastAPI · SQLAlchemy 2.0 (async) · SQLModel · Alembic · PostgreSQL · Pydantic
Security
Self-managed JWT authentication · Role-based access · slowapi rate limiting
AI
OpenAI · Anthropic · Gemini (one provider interface)
Infrastructure
AWS S3 · AWS SES · Pytest
Migrating from
Lovable (React, TypeScript) · Supabase Postgres · Deno Edge Functions · RPCs · Row-level security

Outcome

The migration is in progress. The team has a complete map of what the prototype actually does, a phased plan with acceptance criteria, and tickets written against real code, so the work can be split across developers without anyone guessing.

Moving scoring, matching and financial models to the server means investors and founders see results that cannot be read or altered in the browser, and the golden-master tests prove the numbers have not changed in the move. It is the same exercise I run in technical due diligence: find where the real logic lives before deciding what to rebuild.

Last updated

Have a project like this?

Book a free 1-hour intro call, or send a short brief and I’ll reply with a proposed scope within two working days.