Back to Projects

Primsell NFT E-Commerce

Web3 NFT Campaign Platform with 7-Service Monorepo

Overview

Full-stack NFT e-commerce platform with 7 microservices: Express.js backoffice backend, NestJS payment service, 4 React 18 frontends, and shared component layer. Event-driven workflows manage order lifecycle, contract deployment, and reward distribution. Redux + React Query hybrid state management across all frontend apps.

Key Features

  • 7-service monorepo: Express.js backend, NestJS payment service, 4 React 18 SPAs, shared component layer
  • Event-driven workflow engine using EventEmitter2 for complex business process orchestration
  • Redux Toolkit + React Query hybrid state management — server state vs UI state separation
  • Web3 integration: wagmi hooks, Web3Modal, ethers.js for wallet and transaction management
  • MUI-based shared component layer imported as git submodule across all frontend apps
  • 11 background daemons for order expiration, NFT sales tracking, and POAP distribution

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

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.

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.

Key Achievements

7 Services
Express.js + NestJS + 4 React 18 frontends
Hybrid State
Redux Toolkit + React Query across all apps
11 Daemons
Async processing with 60s execution locks
10K+ Items
Full NFT lifecycle from mint to royalty distribution