Skip to content

Continuum

B2B Reverse Logistics Platform

A multi-tenant SaaS demo for AI-native returns, warranty, and vendor credit management

Continuum admin dashboard
Admin dashboard — RMA management, analytics, and AI chat assistant
01

The Context

This project was built as a technical demo for a Senior Backend/Full-Stack Engineer position at Continuum.ai— the company building the first network-deployed platform for B2B reverse logistics.

Rather than just interviewing, I built a working prototype that demonstrates domain understanding, architectural judgment, and AI-native engineering. The goal was to show that I could model the real complexity of B2B returns — not just build a CRUD app, but design a system that reflects how distributors, manufacturers, and service providers actually interact.

The entire project was built using Claude Code as an AI-assisted development accelerator. I authored the architecture; AI accelerated the implementation.

02

What It Does

Multi-tenant SaaS

Each distributor (like an HVAC supply company) gets their own branded subdomain. Tenant isolation is enforced at the database level — every row is scoped to a tenant_id.

RMA Workflow

Customers submit returns through a self-service portal. Items flow through a state machine: draft → submitted → review → approved → receiving → inspection → disposition → completed

Warranty Claims

When a returned item is sent back to the manufacturer, the system tracks the warranty claim through the vendor approval process.

Vendor Credit Reconciliation

Tracks money owed by manufacturers — expected vs confirmed vs received — so distributors don't leave money on the table.

AI Image Analysis

Customers upload photos of damaged products; Claude Vision analyzes damage and auto-suggests return reasons with confidence scoring.

AI Chat Assistant

CSRs can ask natural-language questions about returns, credits, and analytics from an embedded chat widget powered by Claude.

Customer return submission flow
Customer portal — self-service return submission
Admin RMA detail page
Admin dashboard — RMA detail with status timeline
AI chat assistant in action
AI chat assistant — natural language queries on live data
Vendor credit reconciliation
Vendor credits — financial reconciliation dashboard
03

Tech Stack

Monorepo & Build

  • Turborepo + pnpm workspaces
  • Two Next.js 15 apps (customer portal + admin dashboard)

Language & Framework

  • TypeScript (strict mode)
  • Next.js 15 App Router
  • React 19

Database & ORM

  • Neon PostgreSQL (serverless)
  • Drizzle ORM (type-safe queries)
  • 11 tables with multi-tenant row-level isolation

API Layer

  • tRPC v11 (end-to-end type safety)
  • Zod validation on all inputs
  • Shared routers between both apps

Auth

  • Auth.js v5
  • Google SSO + credentials provider
  • JWT sessions with tenant-scoped roles

AI Integration

  • Anthropic Claude API (Sonnet)
  • Claude Vision for image analysis
  • Tool-use / function calling for chat assistant
  • MCP server for external AI access

Infrastructure

  • Vercel (hosting)
  • Subdomain-based multi-tenancy
  • continuumai.online
04

How AI Built This Project

The entire project was built using Claude Code as a development accelerator. I authored a sequence of detailed architectural prompts that guided Claude Code through each phase of development.

The prompts encode real engineering judgment: domain modeling decisions, state machine design, multi-tenancy patterns, API design choices. AI generated the implementation; I made the architectural calls and reviewed every output.

“The prompts aren't just instructions — they're architectural decisions. Every schema field, every state transition, every API endpoint was deliberately chosen to model the real complexity of B2B reverse logistics. AI accelerated the implementation; engineering judgment shaped the architecture.”
05

How AI Lives Inside the Product

1. Image Analysis (Claude Vision)

Customer uploads a photo of a damaged HVAC unit. Claude Vision API analyzes the image and returns structured JSON — auto-populating the return reason, damage description, and warranty candidacy assessment.

  • Confidence scoring helps CSRs prioritize review
  • Graceful fallback to manual entry if AI is unavailable

2. Embedded Chat Assistant (Claude + Tool Use)

Floating chat widget in the admin dashboard, powered by Claude Sonnet with 6 domain-specific tools. Claude can query the live database: search RMAs, check warranty claims, pull vendor credit summaries, and run analytics.

  • Tenant-scoped — the AI only sees data for the logged-in user's organization
  • System prompt teaches Claude the B2B reverse logistics domain

3. MCP Server (External AI Access)

Model Context Protocol server exposes platform data to any MCP-compatible AI client. Claude Desktop or Claude Code can connect and query returns data via natural language.

  • Same Drizzle queries as the web app — single source of truth
  • Exposes domain knowledge as MCP resources (state machine, reason codes, disposition types)
06

Architecture Decisions

Subdomain multi-tenancy over schema-per-tenant

Simpler ops, shared DB with tenant_id on every row. No need to manage N schemas for a demo — and it mirrors how most B2B SaaS actually works at scale.

State machine pattern for RMA lifecycle

Prevents invalid transitions, makes the workflow explicit and auditable. Every status change is logged with who/when/what.

tRPC over REST

End-to-end type safety from DB to UI, no codegen needed. Shared routers between two apps means zero duplication of API contracts.

Activity log on every mutation

B2B compliance requires audit trails. Every status change, disposition, and credit update is logged — making the system trustworthy for real business use.

Single AI provider (Anthropic)

One API key, consistent behavior across vision, chat, and MCP. No abstraction layers needed — just direct Claude API calls where they add value.