Dueloop

Role / Services

Full-stack Development & Product Engineering

Industry

FinTech / SaaS

Location & Year

Remote © 2026

Dueloop landing page with the headline 'Get paid on time, without the awkward follow-ups' beside a ring of invoice cards
Platform

Web (responsive), self-hosted

Project length

Ongoing

Live since

Oct 2026

Main tech stack
Next.js 16TypeScriptSupabasePostgreSQLStripeWhatsApp Cloud APIDocker

About the project

Dueloop - Invoice follow-up that chases payment on a schedule you control and leaves every money decision to a person

Dueloop is invoice follow-up software for small businesses. It sends polite reminders by email or WhatsApp on a schedule the business controls, reads the replies that come back, records promises and disputes, takes payment through the business's own Stripe account, and keeps a ledger of every payment that lands.

I built it solo as a TypeScript monorepo - a Next.js dashboard, public customer pages and a REST API in front of twenty-odd domain packages - around one rule: the software proposes, a person decides. Every reminder can wait for an approval, a model may suggest what a reply means but can never change an invoice, and nothing is marked paid unless Stripe confirms it or an authorised person records it.

It runs self-hosted on Docker with Supabase underneath (Postgres with row-level security, pgmq queues and pg_cron), so a business keeps its own customer data on its own server.

The problem

Chasing late invoices is the job nobody in a small business wants, and handing it to software is usually worse than doing it by hand. An automated chaser that believes 'I already paid' closes a real debt; one that ignores a reply keeps badgering a customer who has done nothing wrong. Dueloop automates the follow-up and the record-keeping, then stops at exactly the points where a human judgement about money is needed.

The Dueloop landing page shown side by side on a laptop and a phone

Features

01Scheduled Email & WhatsApp Reminders
02Approval Queue Before Sending
03Replies Read as Promises & Disputes
04Stripe Links, Transfers & Payment Proofs
05Balancing Ledger & Receipts
06CSV Import & REST API

Technologies used

Frontend
  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS
  • Radix UI
Backend
  • Node.js 24
  • Supabase
  • PostgreSQL + RLS
  • pgmq & pg_cron
  • pnpm monorepo
Integrations
  • Stripe
  • WhatsApp Cloud API
  • SMTP & IMAP
  • Anthropic / OpenAI
Infrastructure
  • Docker
  • Supabase Storage & Vault
  • Playwright
  • Vitest

Project goals

The aim was to automate the awkward part of getting paid without ever letting software make a decision about money. It needed to:

  • -chase overdue invoices on a schedule, but never outside quiet hours, holidays or consent;
  • -turn free-text replies into promises, disputes and tasks a person can work through;
  • -take payment through the business's own Stripe account, so no card details pass through Dueloop;
  • -keep a ledger where every receipt balances - money received equals amount applied plus credit.

Development journey

01Phase 1

Domain Core First

Wrote the invoice state machine, the rule that decides what should happen next, money in integer minor units and send windows in real time zones as one pure package with no I/O and no clock - then drove it with a simulator before any UI existed.

State MachineProperty TestingSimulation
02Phase 2

Multi-tenant Data & Import

Built the Postgres schema with row-level security on every table, a role matrix for owner, accountant and collector, and a CSV import with a preview and an error report that changes nothing when the same file is uploaded twice.

SupabaseRow-level SecurityCSV Import
03Phase 3

Sending & Replies

Added the outbox: pg_cron enqueues due invoices, and a worker re-checks the invoice, consent, quiet hours and budget right before sending, then sends once. Inbound email and WhatsApp replies became promises, disputes and tasks, with AI suggestions optional.

QueuesApprovalsReply Classification
04Phase 4

Payments, Proofs & Operations

Shipped Stripe payment links, bank transfers and customer-uploaded proofs that a person checks, all landing in one balancing ledger - then the unglamorous half: health checks, heartbeats, a watchdog, data retention, erasure and a rehearsed backup restore.

StripeLedgerRunbook

Challenges & solutions

Challenge

Never sending the same reminder twice

Solution

Sending runs through a pg_cron and pgmq outbox. The worker claims a job, drops it if the invoice was rescheduled since, reloads fresh context and re-runs the rules, then sends once. If the result of a send is unclear, the invoice parks itself and waits for a person instead of guessing.

Challenge

Letting AI help without letting it decide

Solution

A model only ever attaches a suggestion to a reply. The rules in the pure core decide what actually happens, and with AI switched off every reply simply goes to a human. No model output can change an invoice or release a message.

Challenge

Keeping each business's data its own

Solution

Every table carries a tenant id under row-level security, cross-table references carry it too, and dashboard mutations go through database functions that re-check role and tenant. A scripted check runs against the real schema, so a new table cannot ship unprotected.

Key learnings

  • -A pure domain core with no I/O, no clock and no randomness - the current time is passed in as an argument - makes the hard rules about money testable and keeps them out of the UI.
  • -Idempotency has to be designed into the queue, the import and the ledger at the same time; bolting it onto one of them just moves the duplicate somewhere else.
  • -Putting the safety rules in the database as constraints, triggers and row-level security means a bug in the app layer cannot quietly corrupt money.
  • -Approval-first workflows live or die on the approval screen: if it is slow, people turn the automation off entirely.
The Dueloop staff dashboard showing overdue totals, reminders waiting for approval, open tasks and open balance by age
Next case