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
Backend framework
Programming language
Database with auto-sync schema
Caching layer and job queue broker
Async queue processing for background jobs
AI integration for lead summaries and next actions
Features Implemented
Full create, read, list operations with DTO validation
TTL-based caching for lead detail lookups
All endpoints secured via x-api-key header guard
Bull-powered background processing for heavy tasks
Hourly automated lead sync from RandomUser API (10 per run)
By email and externalId to prevent duplicate entries
OpenAI generates lead summaries and recommended next actions, persisted to DB
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