Marketplace API

AutoApp Backend

NestJS car marketplace API with Elasticsearch faceted search, Redis caching, Prisma/PostgreSQL, and dealer/CNIC verification workflows.

AutoApp Backend project preview

Background & Context

Car marketplaces in Pakistan live or die on search speed and trust. Buyers filter by make, model, city, and price at volume; dealers need verification; fraud patterns appear as soon as listings scale. AutoApp required an API foundation that could serve large listing catalogs without collapsing under faceted queries—and encode CNIC/dealer trust into the domain rather than bolting it on later.

Tekvers engineered a NestJS modular monolith (autoapp-backend): auth, users, dealers, listings, search, favorites, reports, admin, and health modules. PostgreSQL via Prisma holds transactional data; Redis caches popular listings; Elasticsearch powers text relevance plus facet aggregations with sync-on-write and a nightly reindex cron. Docker Compose runs API + dependencies for production parity.

Honesty for operators: phone OTP is mock (fixed code logged to console), image fields are URL lists without an upload pipeline, Prisma migrations/ are not checked in yet, and dealer registration does not auto-promote User.role to DEALER. The deliverable is a strong API foundation with clear hardening remaining before consumer-scale production.

The Challenge

A Pakistan car marketplace needed faceted search, dealer and identity verification, favorites/reports, and infrastructure that can grow with listing volume—from an API-first modular backend. Without a coherent marketplace api foundation, AutoApp Backend stakeholders faced fragmented tools, slow handoffs, and limited visibility—classic failure modes Tekvers designs against.

The Solution

AutoApp Backend: NestJS car marketplace API with Elasticsearch faceted search, Redis caching, Prisma/PostgreSQL, and dealer/CNIC verification workflows. Production-shaped API scaffold for high-volume car listings. Tekvers delivered a maintainable marketplace api system for AutoApp Backend using NestJS, PostgreSQL, Redis, Elasticsearch, with phased rollout, operator workflows, and documentation suited to long-term ownership.

Our Approach

  1. Search & cache architecture

    Elasticsearch handles faceted listing discovery (cities, makes, models, fuelTypes) while Redis absorbs hot popular-listing reads. Listing create/update/delete syncs ES; admins can reindex; cron reindexes daily at 03:00.

  2. Trust & marketplace modules

    CNIC submit with format validation and admin verify; dealer register (business name + city) with admin verification/subscription plan patches; listing reports with admin status workflow; favorites per user.

  3. Auth, RBAC, and ops

    Phone OTP request/verify (mock SMS), JWT + hashed refresh token rotation, global throttling and DTO validation, Pakistan phone validation (`@IsPhoneNumber('PK')`), and `GET /api/health` across Postgres, Redis, and Elasticsearch.

What We Delivered

  • NestJS modular monolith API under `/api`
  • Prisma/PostgreSQL persistence for users, dealers, listings, and related entities
  • Elasticsearch faceted search with sync + nightly reindex fallback
  • Redis caching for popular ACTIVE listings
  • OTP auth (mock) with JWT access/refresh and role guards
  • CNIC and dealer verification admin workflows
  • Favorites and listing reports modules
  • Docker Compose stack for API + Postgres + Redis + Elasticsearch

Outcomes & Impact

  • Production-shaped API scaffold for high-volume car listings
  • Faceted search foundation suitable for marketplace UX
  • Trust workflows (CNIC, dealers, reports) modeled in the core domain
  • Clear hardening backlog: real SMS OTP, migrations, image upload, role auto-promotion

AutoApp’s marketplace can search, verify, and scale from a Tekvers API core—facets stay fast, dealers and identity are enforceable by admins, and ops can reproduce the dependency stack locally with Docker Compose.

Technology Stack

  • NestJS
  • PostgreSQL
  • Redis
  • Elasticsearch
  • Docker
  • Prisma

Services Delivered

Guides & articles from this niche

Planning a similar platform? Share your scope and we will map architecture, delivery phases, and a realistic timeline.