Primsell NFT E-Commerce
Web3 NFT Campaign Platform with 7-Service Monorepo
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
Frontend
Blockchain
Infra
Challenges & Solutions
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.
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.