Primsell NFT E-Commerce
Web3 NFT Campaign Platform with 7-Service Monorepo
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
Frontend
Blockchain
Infra
Challenges & Solutions
Event-Driven Workflow Engine
Complex business processes — order lifecycle, contract deployment, reward distribution — required reliable state machine orchestration across 7 services without data loss.
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
NFT secondary sales happen across OpenSea and Rarible with different APIs and data formats — need real-time royalty calculations and automatic reward distribution.
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
4 React frontends needed consistent data handling while serving different user journeys — admin dashboard, checkout, QR redemption, and KYC verification.
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.