Stache n' Scale

Lab Documentation

Version v1.0

My Debt Coach: Engineering Notes

High-level engineering overview of My Debt Coach: product architecture, payoff engine, auth model, demo experience, content stack, and ops tooling. Companion to the Lab entry.

Overview

My Debt Coach is a TypeScript monorepo with a consumer web app, a separate internal ops hub, and shared packages for site configuration and data access.

Stack is Next.js, React, Tailwind, Supabase for auth and Postgres, Sanity for marketing and content, and Vercel for hosting and scheduled jobs.

System shape

At a high level the product splits into three cooperating surfaces:

Architecture

The consumer app separates marketing surfaces, the authenticated portal, and public help content.

Portal areas cover Home, My Debt, Plan, Payments, and Settings. Theme and accent choices stay scoped to the signed-in experience so marketing pages stay visually independent.

Payoff engine

Seven strategies allocate leftover budget after minimums. Users pick a default strategy, then can compare any two on the same monthly budget.

Data and auth

Sign-in supports Google OAuth and email/password through Supabase. Row Level Security keeps each user's financial data private to their account.

User preferences cover timezone, currency, appearance, and whether the session is a time-limited demo.

Live demo

Prospects can open a time-limited trial that lands in the real product with seeded sample debts, payments, and coaching states.

Demo sessions expire automatically. Background jobs prune stale trial data, and rate limits keep concurrent trials isolated.

Content and help

Sanity powers the marketing site, Knowledge Base, and blog. Editors work in an embedded studio; published changes revalidate affected pages.

In-app promo cards rotate curated articles so signed-in users still discover educational content.

Marketing stack

The homepage is a block-based Sanity document: hero, feature grid, product showcases, how-it-works, FAQ, and CTA.

Blog posts, help guides, education articles, legal pages, and site settings are separate document types.

Ops hub

A separate, role-gated application is the live ops surface: not a thin CMS, but the place where growth, support signals, and publishing workflows converge.

Social publishing

Social distribution is API-driven from the ops hub rather than manual link-outs only. Public profile links still appear in marketing footer and structured data.

Analytics connectors

The ops hub is growing a connector pattern for warehouse and BI sync. Credentials never ship to the consumer app.

Ops and deployment

Consumer and ops apps ship on separate Vercel projects so internal experiments stay isolated from consumer releases.