Spurtcommerce Custom NPM Packages-4.8.3 Release

Spurtcommerce
spurt-commerce
Published in
5 min readDec 15, 2023

Introduction: In the dynamic world of ecommerce, where Multi-Vendor platforms are becoming increasingly popular, the need for efficient and tailored solutions is more crucial than ever. Spurtcommerce, being the leading Multi-Vendor ecommerce solution, developed a few custom Node npm packages for handling authentication, product management, customer management, order processing, cart functionalities, and vendor management and these packages are in turn used in actual Spurtcommerce Multi-Vendor solution’s backend codebase.

1. Auth Package:

The @spurtcommerce/auth npm package serves as a robust authorization middleware designed for use with the “routing-controllers” library in Spurtcommerce multi-vendor backend APIs. This middleware leverages TypeORM for database interactions, JWT for secure authentication, and CryptoJS for cryptographic operations that helps controlling access to your routes based on user roles, tokens, and permissions. Key features of the package includes,

• Validates users based on their roles, such as customers, vendors, and administrators

• Grants access based on user roles and permissions

• Verifies the validity of tokens using the provided jwtSecret

• Check if the token has been revoked by checking the database

• Validates users against different entities in the database, including ‘Customer’, ‘Vendor’, ‘User’, and ‘UserGroup’

  • Ensures users meet specific criteria such as being active and not flagged for deletion

<<see more>>

2. Customer Package:

Managing customer interactions is a fundamental aspect of many applications. The @spurtcommerce/customer npm package signifies this process by offering simple and efficient functions for customer registration, customer list retrieval, and customer profile fetching. Built on top of TypeORM, it ensures smooth interactions with your database, making customer-related tasks manageable for Spurtcommerce multi-vendor backend APIs. Key features of the package includes,

• Securely register new customers. Passwords are hashed, and registration details are validated.

• Retrieve lists of customers based on various criteria such as name, email, date, and more.

• Individual Profile Fetching — Effortlessly obtain detailed profiles for specific customers

<<see more>>

3. Product Package:

The @spurtcommerce/product package provides a versatile set of functions for handling various operations in a Node.js application. It streamlines product-related tasks, simplifies category management, and offers robust functionalities for tax management. Developers can leverage this toolkit within the Spurtcommerce multi-vendor backend APIs, to create products, retrieve product lists, manage categories with advanced filtering, create new categories, handle taxes seamlessly, and more. Key features of the package includes,

• Easily create new products with the provided payload

• Retrieve a list of products with flexible filtering options

• Streamline the process of creating new categories

• Retrieve a list of categories with advanced filtering options

• Effortlessly create new taxes with specified details

• Retrieve a list of taxes, update tax information, and delete taxes as needed

<<see more>>

4. Marketplace Package:

The @spurtcommerce/marketplace provides essential functionality for vendor-specific marketplace features of Spurtcommerce multi-vendor backend such as vendor registration, profile retrieval, and managing vendor products. Key features of the package includes,

• Allows vendors to register by providing necessary details

• Performs validation checks for duplicate display names and matching passwords

• Interacts with the database to store vendor and customer information

• Retrieves and returns the profile of a specific vendor

• Fetches additional details such as customer information, country, and vendor categories

• Retrieves a list of products associated with a specific vendor

• Supports filtering based on keywords, SKU, status, and price

• Provides pagination for managing large product lists

• Retrieves and includes associated categories for each product

• Calculates earnings for each product based on order history

<<see more>>

5. Cart Package:

The @spurtcommerce/cart package is designed to streamline cart-related operations of Spurtcommerce multi-vendor backend APIs. It offers features like creating and updating carts, retrieving cart lists, and removing items from the cart. With a focus on simplicity and efficiency, this npm package simplifies the implementation of shopping cart functionalities for developers. Key features of the package includes,

• Cart Creation: Seamlessly create and manage shopping carts in your Node.js application

• Flexible Cart Updates: Effortlessly update cart items, quantities, and prices to accommodate various scenarios

• Intuitive Cart Deletion: Easily remove items from the cart, ensuring a smooth user experience

• Detailed Cart Listing: Retrieve comprehensive lists of cart items with essential product details and pricing information

• IP Address Tracking: Enhance security and analytics by keeping track of user IP addresses

• Product Options Support: Handle products with multiple options, such as variations, with ease

• Stock Management: Implement stock-related checks to enforce quantity limits and prevent out-of-stock issues

• Extensive Product Information: Retrieve detailed product information, including images, descriptions, and stock status

• Dynamic Pricing: Leverage dynamic pricing features, including discounts and special offers, for an enhanced shopping experience

<<See more>>

6. Order Package:

The @spurtcommerce/order npm package designed for handling order creation and management within a TypeScript application, particularly suited for Spurtcommerce multi-vendor backend APIs. It provides functionalities for creating orders, validating coupons, processing payments, and managing stock. Key features of the package includes,

• Order Creation: Efficiently handles the creation of orders with detailed customer and product information.

• Coupon Validation: Validates and applies coupons to orders, ensuring accuracy and adherence to coupon rules.

• Dynamic Pricing: Calculates dynamic pricing for products, considering tax, special prices, discounts, and tire prices.

• Stock Management: Manages product stock, including quantity checks, stock alerts, and updates after order creation.

• Plugin Integration: Integrates with plugins, allowing extensibility for features like payment methods and discounts.

• Vendor Support: Supports orders with multiple vendors, including commission calculations and order logs for vendors.

• Customer Account Handling: Manages customer accounts, including new customer creation, login validation, and account-related validations.

• Email Notifications: Sends email notifications to customers and administrators upon successful order placement, providing order details.

• Payment Method Processing: Processes payments through different payment methods, handling redirections and responses accordingly.

• Configurable Settings: Allows configuration of settings such as order status, invoice prefixes, and currency information.

<<see more>>

Conclusion:

The custom npm packages-based approach of the Spurtcommerce Multi-Vendor solution, not only improves the overall product’s customization experience but also sets the stage for future scalability and adaptability to emerging industry trends.

--

--

Spurtcommerce
spurt-commerce

Spurtcommerce: Customizable, Open Source B2C,B2B eCommerce with NodeJS API, Angular Admin and Vendor, along with Angular/React Storefronts.