SaaS & Infrastructure · Est. $18k – $20k
Backend Test Suite

Social discovery platform · under NDA

Coralsoft designed, built and shipped this product for the client.

WebBackendVitest 3.2 (Node env mode)Deno 2.xHono 4.x
Backend Test Suite
The situation

What was in place before we started.

A full backend test suite built from scratch for a Deno-based Supabase Edge Functions API — unit tests, integration tests, schema validation, a production-grade mock layer, and CI/CD quality gates across 13 feature modules.

The client (covered under NDA) operates a social discovery platform for real-time, location-aware interaction — users discover nearby events, check in at venues, connect with attendees, and manage social profiles through a mobile app. The server side is a collection of Supabase Edge Functions: individually deployed, serverless TypeScript handlers behind a shared Hono routing layer, covering auth, events, profiles, venues, photo uploads, Stripe payments, and admin operations.

When Coralsoft joined the project, the backend had no test coverage. The challenge was not simply writing tests — it was building the testing infrastructure that made meaningful tests possible in a non-standard runtime. Edge Functions run on Deno; the natural test runner for TypeScript projects runs on Node. Bridging the two module systems without a transpilation step, mocking the Supabase query builder's fluent API faithfully, and doing all of this without ever touching a live database required deliberate infrastructure work before a single assertion could be written.

Constraint

The goal was not maximum coverage — it was reliable coverage of the most business-critical paths: auth, event participation, and Stripe webhook processing. The infrastructure built in this engagement makes raising coverage thresholds incrementally straightforward.

Estimated Timeline
6 months
Estimated Team
5 people
Estimated Budget
$18k – $20k
Platforms
2
Stack
Vitest 3.2 (Node env mode)Deno 2.xHono 4.xSupabase JS SDKZod 3.xStripe webhooksTwilioGoogle MapsShort.iov8 coverageGitHub Actions
Delivery story

Backend Test Suite: a product foundation built for reliable delivery

01

Challenge

A full backend test suite built from scratch for a Deno-based Supabase Edge Functions API — unit tests, integration tests, schema validation, a production-grade mock layer, and CI/CD quality gates across 13 feature modules. The main delivery challenge was to give users a maintainable interface and architecture that could absorb new requirements without slowing delivery, while keeping Unit tests, Schema tests, and Integration tests consistent across the complete journey. We framed the engagement around the smallest production-worthy flow first, then expanded the scope without weakening the underlying component and data model.

02

How we built it

We first separated the core product rules from external services, then defined typed boundaries for every integration. The team delivered Unit tests, Schema tests, and Integration tests as end-to-end flows, adding retries, idempotent operations, validation, and observable failure states before polishing the interface. This kept third-party behaviour from leaking into the product experience and made later integrations easier to add. The implementation was anchored by Vitest 3.2 (Node env mode), Deno 2.x, Hono 4.x, and Supabase JS SDK, with shared TypeScript contracts across the frontend and service layer.

03

Delivery

The delivered scope brought Unit tests, Schema tests, Integration tests, and Deno-to-Node bridge into one coherent production-ready product experience. The reusable component and data patterns leave a clear route for the next product iteration. For Backend Test Suite, the practical result is a product that communicates its value quickly while giving the team a maintainable base for continued delivery in saas & infrastructure.

Challenges

Each constraint, and what we did about it.

Constraint

The goal was not maximum coverage — it was reliable coverage of the most business-critical paths: auth, event participation, and Stripe webhook processing. The infrastructure built in this engagement makes raising coverage thresholds incrementally straightforward.

What we did

Three pieces of custom infrastructure make the entire suite possible. First, a Vitest module alias layer maps Deno-style ESM import URLs to their Node equivalents at resolution time — allowing Deno TypeScript to run through Vitest in Node environment mode without a transpilation step. Second, a Deno environment shim installs a Deno global that proxies env.get and env.set to a plain object reset between tests — no real credentials anywhere in the suite.

Results

Measured outcomes.

50
Test files across 13 feature modules
26
Geofence edge case tests for nearby discovery flows
0
Live database calls in the entire test suite
Roadmap

Estimated delivery sequence.

6 months
Weeks 1–4

Discovery & architecture

Pure utility logic — phone normalisation, Haversine geofence, age calculation, SMS templates, magic link tokens, env config.

  • Unit tests
Weeks 5–13

Core build

Zod contracts tested independently — required fields, conditional rules, format patterns, character limits, date ordering.

  • Schema tests
Weeks 14–18

Integrations & data

Full HTTP handler path — real Hono context, real Zod validation, mocked Supabase and external services.

  • Integration tests
Weeks 19–23

Hardening & QA

Vitest module aliases map Deno-style ESM import URLs to Node package names at resolution time — allowing Deno TypeScript to run through Vitest in Node mode without a transpilation step.

  • Deno-to-Node bridge
Weeks 24–26

Launch & handover

createMockSupabaseClient — a full reproduction of the Supabase JS query builder API as a tree of vi.fn() stubs.

  • Mock Supabase client

More work like this.

Every case study covers a product Coralsoft designed, built, and shipped for a client.