MoreMarket Multi-Vendor E-Commerce Platform
An enterprise-grade marketplace backend built to power a multi-vendor e-commerce ecosystem serving Latin American markets. This comprehensive API platform provides real-time capabilities, dual authentication systems, and sophisticated payment processing through both international and regional payment providers. As part of the development team at BSE America Tech, I architected and implemented the custom payment gateway integration with Sigma, a Panama-based payment provider, enabling the platform to serve merchants and customers across Central and South America.
Key Features
- Custom Payment Gateway Integration - Architected and implemented full integration with Sigma payment provider, enabling credit card processing for Panama and Latin American markets with support for tokenization, transaction processing, and webhook-based payment confirmations
- Dual Authentication Architecture - Separate JWT-based authentication systems for administrators (
/auth-admin) and regular users (/auth-users) with refresh token support, email verification, and password recovery workflows managed through dedicated authentication management services - Real-Time Communication Layer - Socket.io integration with IP tracking and session management, enabling instant updates for order status changes, inventory updates, and multi-user coordination across 61+ API endpoints
- Multi-Vendor Marketplace Logic - Comprehensive service architecture supporting vendor onboarding, product cataloging, inventory management, order routing, and commission calculations with role-based access control across admin, vendor, and customer user types
- Advanced Image Management System - AWS S3 integration with Multer for handling product images, vendor documents, and promotional materials with automatic resizing, format conversion, and CDN distribution
- Flexible Promotion Engine - Support for discount codes, banner promotions, combo deals, and time-limited offers with Joi schema validation ensuring data integrity across promotion creation and redemption workflows
- Email & SMS Marketing Integration - Full E-Goi API integration providing 16 dedicated services for email templates, SMS campaigns, domain management, message scheduling, and delivery reporting with validation utilities
- Fuzzy Search & Filtering - MongoDB text indexes with
feathers-mongodb-fuzzy-searchenabling partial matches across product names, categories, and vendor information with escape-aware query processing
Technical Implementation
Payment Processing Architecture
My primary contribution focused on integrating Sigma, a regional payment provider requiring custom API implementation not available through standard payment libraries. The challenge involved understanding undocumented API behaviors, implementing secure tokenization flows, and handling edge cases specific to Latin American banking systems.
Sigma Gateway Integration: Built a comprehensive payment service (src/services/sigma/) implementing:
- Transaction Processing: Created endpoints for sale initiation, authorization, and capture using Sigma’s REST API with custom request signing and merchant account token management
- Webhook Handler: Implemented secure webhook validation and processing for asynchronous payment confirmations, ensuring idempotent transaction updates to prevent double-charging
- Error Handling & Retry Logic: Developed robust error handling for network timeouts, declined transactions, and regional banking peculiarities including currency conversion validation and CVV verification workflows
- Testing & Monitoring: Built ping service for payment gateway health checks and connection validation during critical transaction windows
The implementation required careful handling of sensitive payment data, PCI compliance considerations, and coordination with Stripe integration for merchants preferring international payment processing.
FeathersJS Service Architecture
The platform leverages FeathersJS 4.x’s service-oriented architecture with 61 interconnected services organized by business domain. Each service follows a consistent three-file pattern (service registration, class implementation, and hooks) with Mongoose models defining MongoDB schemas and indexes.
Hook-Based Middleware Pattern: Implemented payment-specific hooks following the established architecture:
src/hook/validator/- Joi schema validation for payment requests with custom rules for card data and amount validationsrc/hook/permission/- Role-based access ensuring only authorized users can initiate payments and vendors can view their transaction historysrc/hook/services/- Payment-specific business logic including commission calculations and multi-party payment splits
Database Design: Utilized MongoDB’s flexibility for handling payment metadata, transaction histories, and audit logs with compound indexes optimizing query performance for vendor dashboards and financial reporting.
Authentication & Security
The dual authentication system separates administrative operations from customer actions, with JWT tokens carrying different payload structures and permission levels. Payment endpoints require additional verification layers ensuring transaction authenticity and preventing unauthorized fund movements.
Implemented password hashing through @feathersjs/authentication-local, email verification workflows through feathers-authentication-management-ts, and secure session management with MongoDB-backed express sessions for maintaining payment context across multi-step checkout flows.
Business Impact & Use Cases
The platform enables small to medium-sized vendors across Latin America to establish online storefronts without building their own payment infrastructure. The Sigma integration specifically addresses the need for local payment processing, reducing transaction fees compared to international providers and supporting banking systems common in Panama and neighboring countries.
Multi-Vendor Marketplace Capabilities:
- Vendors manage their own product catalogs, inventory, and pricing with automated commission deductions on each sale
- Customers browse unified product catalog across all vendors with single checkout experience and consolidated order management
- Platform administrators monitor all transactions, manage disputes, and configure system-wide promotion rules
Payment Flexibility: By supporting both Sigma (regional) and Stripe (international), merchants can choose payment providers based on their target markets, reducing cross-border fees while maintaining PCI compliance and fraud protection.
The real-time communication layer ensures customers receive instant order confirmations, vendors get immediate sale notifications, and administrators can monitor platform activity as it happens, reducing support burden and improving user satisfaction.
Development & Deployment
Built using TypeScript 4.5 with strict typing compiled to CommonJS for Node.js 16 runtime. The codebase follows ESLint configuration with Prettier integration ensuring consistent code style across the development team.
Testing Approach: Jest test suite with ts-jest covering critical payment workflows including successful transactions, declined payments, webhook processing, and error scenarios. Payment integration testing used Sigma’s sandbox environment to simulate various transaction states without processing real payments.
Team Collaboration: Developed as part of a 5-person backend team at BSE America Tech, coordinating with frontend developers consuming the REST and WebSocket APIs. Used Git-based workflow with feature branches and code reviews ensuring payment-critical code met security and reliability standards.
Deployment Process: Application compiled via npm run compile and deployed using PM2 process manager with separate configurations for development, test, and production environments. MongoDB Atlas provides managed database hosting with automatic backups and replica sets ensuring high availability for transaction data.
The platform serves production traffic at api.moremarket.com handling real transactions for active vendors and customers across the marketplace ecosystem.