Back
Backend Challenge · NestJS · 2026

CONTACTSHIP-MINI

Lead management microservice built with NestJS and TypeScript for a backend technical challenge. The goal was to demonstrate how I design and build a realistic backend service, prioritizing clarity, good technical decisions, structure, scalability, and maintainability.

NestJS · TypeScript · PostgreSQL · Redis · Bull · OpenAI

What is ContactShip AI

ContactShip AI is a platform that transforms business call handling with cutting-edge AI agents. It replaces traditional call methods with AI-powered agents that handle calls seamlessly, offering multilingual capabilities, transparent pricing, and advanced security.

Features include AI-powered call handling, seamless integration with minimal setup, and global multilingual communication — all while keeping data protected.

About the Challenge

Contactship-Mini is a backend microservice for lead management, built as a technical challenge for ContactShip AI to demonstrate backend design and development skills with NestJS.

I covered all proposed functional and non-functional requirements, documenting how to run the project and the decisions made at each step. The focus was on clarity, good technical decisions, scalability, and maintainability over a "perfect" solution.

Tech Stack

01
NestJS

Backend framework

02
TypeScript

Programming language

03
PostgreSQL (Supabase)

Database with auto-sync schema

04
Redis

Caching layer and job queue broker

05
Bull

Async queue processing for background jobs

06
OpenAI GPT-3.5-turbo

AI integration for lead summaries and next actions

Features Implemented

01
Lead CRUD

Full create, read, list operations with DTO validation

02
Redis Cache

TTL-based caching for lead detail lookups

03
API Key Auth

All endpoints secured via x-api-key header guard

04
Async Job Queues

Bull-powered background processing for heavy tasks

05
CRON Sync

Hourly automated lead sync from RandomUser API (10 per run)

06
Deduplication

By email and externalId to prevent duplicate entries

07
AI Summaries

OpenAI generates lead summaries and recommended next actions, persisted to DB

08
Error Handling

Centralized HTTP exception filters with detailed logging

Automatic Sync

  • Syncs leads from RandomUser API
  • Runs every hour (configurable)
  • 10 leads per execution
  • Deduplication by email & UUID

AI Integration

  • GPT-3.5-turbo powered
  • Generates lead summaries
  • Recommends next actions
  • Persists results to database

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account (PostgreSQL)
  • Redis (local via Docker or cloud via Upstash)
  • OpenAI API Key

Project Links