Mersi

Services Overview

NestJS Amazon product search and Sui payment verification service.

The scraping/ service is a NestJS 10 application (package name amazon-shopping-agent) built primarily as an Amazon product search service. It provides two capabilities:

  • Real-time product search — builds a native Amazon search URL from the user's query, runs the Apify apify/e-commerce-scraping-tool actor against it, normalises the scraped results, and returns a ranked product list.
  • Sui payment verification — verifies on-chain Sui transactions and forwards deposit confirmation events to the backend/ service.

All routes are served under the /api prefix. Port defaults to 3000 (override with PORT env var). The search endpoint is publicly accessible.

Tech Stack

LayerTechnology
FrameworkNestJS 10 / Express
LanguageTypeScript 5
DatabasePostgreSQL 15 (TypeORM)
Cache / LocksRedis 7 (ioredis)
SearchMeilisearch v1.5 (provisioned, not yet used)
Web scrapingApify apify/e-commerce-scraping-tool actor
Sui payments@mysten/sui
Validationclass-validator / class-transformer
Rate limiting@nestjs/throttler
API docs@nestjs/swagger (Swagger UI at /api-docs)

Infrastructure

Module Catalog

ModuleRoutesPurpose
RealtimeSearchModuleGET /api/search/realtime, GET /api/search/realtime/product/:asinApify scraping + product normalisation
PaymentModulePOST /api/payment/verify, GET /api/payment/transaction/:txHash, GET /api/payment/:idSui TX verification + deposit forwarding
SuiModuleinternalSui RPC client used by PaymentModule
NormalizationModuleinternalFlatten and validate Apify product payloads
DatabaseModuleinternalTypeORM data sources, entities, migrations

Quick Start

cd scraping

# Copy and fill environment variables
cp .env.example .env

# Start all services
docker compose up -d

# App is available at http://localhost:3000

The compose stack starts the NestJS app, PostgreSQL, Redis, and Meilisearch. See Environment Reference for every variable.

The NestJS app waits for PostgreSQL, Redis, and Meilisearch to pass their health checks before accepting traffic.

How is this guide?

On this page