All projects

Service Pacts

Service Pacts is a multi-tenant SaaS that takes a Canadian trade contractor from a customer's equipment list to a signed recurring service agreement: import the list, send a priced and branded agreement, follow it to signature, and renew it.

Service Pacts
My role
Solo: design, backend, frontend, deployment

The problem

Canadian commercial trade contractors sell recurring maintenance agreements, but build them by hand from a customer’s equipment list in Excel and Word: slow to price, easy to get wrong, and hard to follow to a signature or to renew.

Constraints

  • Multi-tenant: each contractor’s customers, equipment and prices stay private to their company.
  • The customer signing has no account, so the review and signing flow has to work from an emailed link.
  • Equipment lists arrive as Excel, CSV and PDF in no standard layout.
  • Legal weight: a signature needs an audit trail, and the app handles customer data.

What I built

A Next.js app on Supabase/PostgreSQL. A contractor imports an equipment list, AI parsing turns it into priced service lines with 12-month visit schedules, and a branded agreement goes to the customer through a white-label review portal. Signing runs through DocuSeal, renewals are automated from CPI, and Stripe handles subscription billing across three plans.

  • Contractor app → App server and auth
  • Customer review portal → App server and auth
  • App server and auth → AI list parsing
  • App server and auth → E-signature
  • App server and auth → Billing
  • App server and auth → Database

Hard decisions

  • AI parses, a person approves

    The model reads messy lists faster than anyone, but rows it is unsure about are held for human review, so a bad guess never reaches a priced agreement.

  • DocuSeal for e-signature

    A signing provider with its own audit log is stronger evidence than a home-made "I agree" button, and it avoided building legal plumbing.

  • Customers sign in without an account

    A tokenised review portal removes the biggest drop-off for the contractor’s customer, at the cost of treating the link itself as a secret.

Outcome

  • Deployed and live at servicepacts.com with Stripe subscriptions across three plans.
  • Passwordless email sign-in, company-scoped data and role-based access.
  • Ships with CSP, HSTS and other security headers, plus privacy, terms and security pages.

Stack, tests and deployment

App
Next.js, React, TypeScript
Data
Supabase, PostgreSQL
Billing and signing
Stripe, DocuSeal
AI
Equipment-list parsing with a human review step

Links

  • Live site →
  • Behind the loginCustomers, sites, equipment, agreement drafts, signing status and revenue.
  • An estimator at an HVAC or mechanical contractor starts with a messy equipment list in Excel, CSV, Word or PDF. Service Pacts reads it, builds a priced agreement whose scope comes from the equipment types actually on site, sends it to the customer under the contractor's own brand, and tracks it until it is accepted, signed and renewed. It is meant for small and mid-sized shops that do not want a full field-service suite or a pile of Word templates and spreadsheets.

    Features

    • Equipment list import from xlsx, csv, docx and pdf, with AI extraction that flags doubtful rows for review instead of hiding them
    • Priced service agreements with visit schedules, a 12-month service matrix, versions and default terms
    • White-label customer portal opened from a magic link with no account: the customer can accept, refuse (with a reason) or request changes
    • E-signature with a customer signature, a countersignature, an audit trail and a stored signed PDF
    • Pipeline view where every agreement shows one status and how long it has been there
    • Automatic reminders and renewals, with a configurable CPI cap and notice period
    • Trade starter packs, roles (owner, admin, estimator, viewer), plans with Stripe billing, and an API and AI connection on higher plans

    Architecture & Design

    The web app follows ports and adapters: business rules live in a domain and application layer, and Supabase, the PDF renderer, the e-signature provider and the AI extractor sit behind interfaces.

    Next.js web app (server components, server actions with Zod validation)
       ├─ domain / application   business rules, money in integer cents
       └─ adapters
            ├─ Supabase           Postgres + RLS, Auth, Storage
            ├─ AssetExtractor     Claude API
            ├─ SignatureProvider  DocuSeal
            └─ DocumentRenderer   react-pdf
    n8n on Railway: emails, reminders, timing   ·   Resend: transactional email
    

    Key design decisions:

    • Tenant isolation in the database. Every tenant table carries an org id, child rows reference their parents through composite foreign keys so a reference cannot cross tenants, and Postgres row-level security enforces who can read and write.
    • Branding is data, not code. Name, logo, accent colour and contract terms come from each tenant's settings, so the portal, PDFs and emails look like the contractor's and never hard-code a company.
    • The app owns status, n8n only automates. Agreements and contracts each have one explicit state, and the workflow engine sends emails and reminders without owning any of it.
    • Providers behind interfaces. Signing, extraction and PDF rendering can each be swapped without touching the business rules.
    • A strict page structure. Every route splits into a server page, page-specific components, validated server actions and permission-checked data access.

    Author: Felipe Viana

  • Scope

    • Built for Canadian commercial trade contractors, outside Quebec, with all pricing in CAD
    • HVAC and mechanical was the first trade built, with other trades added as starter packs
    • One job done in depth: list to agreement to signature to renewal. One-off project contracts and a full field-service suite are out of scope
    • The public site shows the product with clearly labelled sample data