Case Study · SaaS Platform

Renewly — never miss the date that decides a contract renewal

A multi-tenant SaaS for software spend. It reads vendor contracts with AI, tracks the cancellation-notice deadline behind every auto-renewal, and ranks where money is being wasted, with Stripe-gated plans and strict tenant isolation.

Project
Multi-tenant SaaS platform
Scope
API · Data model · AI · Billing
Stack
Node · Express · Prisma · Stripe
Status
Working build, open source
Renewly title with the formula noticeDeadline equals renewsOn minus noticePeriodDays and a timeline from a December cancel date to a March renewal
The Brief

The expensive date is not the renewal date

A contract that auto-renews on 1 March with a 90-day notice period is really decided on 1 December.

Most spend trackers tell you what you spent. Renewly is built around the notice window: miss it and the company has silently committed to another year. So the product treats one derived date as its centre of gravity, and everything else exists to make sure that date never passes unnoticed.

noticeDeadline = renewsOn − noticePeriodDays
Track the deadline, not the renewal.
What We Built

From a pasted contract to a saved dollar

01

AI contract extraction

Paste a contract and get vendor, amount, billing cycle, seats and notice period, plus a risk level and the reasons behind it. It can create the subscription from the extracted terms.

02

Savings insights

Ranked recommendations across the portfolio: idle seats, monthly versus annual billing, long auto-renew notice windows and overlapping tools in one category.

03

Real multi-tenancy

Shared database with row-level isolation. Every tenant-owned row carries an organisation id, and a guard scopes every query. Cross-tenant access returns 403, never data.

04

Billing that gates something

Free, Pro and Scale plans are enforced on the server. Going over a limit returns a real 402 Payment Required with an upgrade path, not just a locked button.

05

Nightly renewal reminders

A scheduled sweep across all tenants finds deadlines inside the next 14 days and emails each organisation’s owners.

06

Runs with zero API keys

The AI provider and Stripe both ship with deterministic mock modes, so the whole product works offline. Add keys to switch to the live services.

Plan Gating

Limits the API actually enforces

Free · $0

Get started

  • Up to 5 subscriptions
  • Up to 2 members
  • AI features locked
  • 402 on any limit hit
Pro · $29/mo

For growing teams

  • Up to 50 subscriptions
  • Up to 10 members
  • Contract extraction
  • Savings insights
Scale · $99/mo

No ceiling

  • Unlimited subscriptions
  • Unlimited members
  • All AI features
  • Same server-side checks
Architecture

One request, five guards

Routes wire middleware, controllers translate HTTP, services hold the logic.

Only the service layer touches the database. A request to create a subscription passes through each guard in order, and the tenant id is never read from the request body.

POST /api/subscriptions
  helmet · cors · body parser · rate limit
  requireAuth     verify access JWT          → req.user
  requireTenant   membership in X-Org-Id     → req.org
  requireRole     member or above
  validate        Zod schema
  service         plan cap → 402 · scope by org · audit log
Design Thinking

Decisions that mattered

403, not 404, for foreign tenants

A 404 would reveal whether an organisation id exists. A 403 gives an attacker nothing to probe.

Derive the deadline, never store it

A stored notice deadline drifts the moment the renewal date or notice period changes. Computing it keeps it correct by construction.

Mocks that really work

The mock AI parses the contract you paste, and mock billing calls the same activation code as the Stripe webhook. Anyone can run the full product without keys, and the real paths stay exercised.

Rotating refresh tokens

Refresh tokens are stored hashed and rotated on use, with reuse detection, so a stolen token only works until the real user refreshes.

SQLite first, Postgres one line away

A demo that needs a database container before it boots does not get run. Switching to PostgreSQL is a single line in the Prisma schema, and Docker Compose provisions it.

3
Plans enforced
server-side
3
Roles: owner,
admin, member
0
API keys needed
to run it
14d
Reminder window
before a deadline
Where It Stands

A working, tested, open-source build

The backend is complete; the product surface is a lean demo dashboard.

In place: authentication with token rotation, organisations and invites, role-based access, subscriptions with spend rollups, AI extraction and insights, Stripe checkout and webhooks, audit logs, Swagger docs, a Docker setup and a Jest and Supertest suite covering tenant isolation, RBAC, token rotation and plan gating.

Next: PDF upload ahead of extraction, Slack or Teams reminders, SSO and per-tenant usage metering.

Read the code on GitHub →

Under the Hood

Design & stack

Backend
Node.jsExpressZodLayered routes, controllers and services with validated requests and typed errors.
Data
PrismaSQLitePostgreSQLRow-level multi-tenancy; SQLite by default, PostgreSQL by changing one line.
AI
Anthropic-compatible APIDeterministic fallbackStrict-JSON extraction and portfolio analysis, falling back to a rules engine when no key is set.
Billing
StripeCheckout, customer portal and signature-verified webhooks, with a mock mode.
Security
JWTbcryptHelmetRate limitingAccess and refresh tokens, hashed passwords, RBAC and audit logs.
Delivery
DockerJestSupertestGitHub ActionsContainerised, tested against an isolated database and built in CI.

Want something like this for your business?

Tell us a little about your idea. We will tell you honestly what it would take, how long it would take and what it would cost.

  • Free discovery call
  • Reply within 24 hours
  • First working version in 72 hours

Building a SaaS that has to be right about money and data?

Multi-tenant isolation, billing and AI features are a focused build. Tell us what you are making and we’ll scope it.

View the Code ↗ Start a Conversation