Back to Projects

Primsell NFT E-Commerce

Web3 NFT Campaign Platform with 7-Service Monorepo

Overview

Web3 e-commerce platform for brands to create and manage NFT campaigns — minting, secondary sales royalty tracking, and reward redemption via QR codes or wallet connections. Architected as a 7-service monorepo with event-driven workflow engine, 11 background daemons, and Stripe payment integration.

Key Features

  • 7-service monorepo: backoffice backend, payment service (NestJS), 4 React frontends, shared layer
  • Event-driven workflow engine with EventEmitter2 for order, contract, and reward lifecycles
  • 11 background daemons for async processing with 60-second execution locks
  • Blockchain integration — smart contract deployment, OpenSea/Rarible sales parsing, royalty calculations
  • Stripe payment flow with webhooks, order lifecycle management, and Binance API currency conversion
  • ACL-based authorization with JWT, refresh tokens, and rate limiting

Tech Stack

Backend

Express.jsNestJSSequelizeMikroORMPostgreSQLRedisTypeScript

Frontend

React 18Redux ToolkitTanStack QueryMaterial UIStyled Components

Blockchain

ethers.jswagmiWeb3ModalAlchemy SDKIPFSPolygon/Ethereum

Infra

DockerAWS S3AWS X-RaySentryAwilix DI

Challenges & Solutions

Event-Driven Workflow Engine

Problem

Complex business processes — order lifecycle, contract deployment, reward distribution — required reliable state machine orchestration across 7 services without data loss.

Solution

Built custom workflow engine using EventEmitter2 with PostgreSQL-backed state machines. Abstract base classes (AbstractService, AbstractDaemon, AbstractSubscriber) standardized the pattern. 11 daemons handle async processing with 60-second execution locks and Sentry alerting.

Multi-Marketplace Royalty Tracking

Problem

NFT secondary sales happen across OpenSea and Rarible with different APIs and data formats — need real-time royalty calculations and automatic reward distribution.

Solution

Background daemons poll marketplace APIs, normalize sale data, calculate creator royalties in basis points, and trigger automated reward distribution via smart contract calls. Structured error logging to DB with auto-cleanup of old records.

Monorepo State Management

Problem

4 React frontends needed consistent data handling while serving different user journeys — admin dashboard, checkout, QR redemption, and KYC verification.

Solution

Redux Toolkit for UI state (modals, filters) + React Query for server state (API caching, background sync). Shared component layer as git submodule ensured consistent MUI-based UI. Redux-Saga handled complex async flows like payment confirmation chains.

Key Achievements

7 Services
Monorepo with Express.js, NestJS, and 4 React frontends
11 Daemons
Background processors for async order and NFT lifecycle
10K+ Items
NFT creation flows with IPFS metadata storage
Awilix DI
Full dependency injection across 19 controllers and 27+ services