This project focuses on developing a proof of concept for an e-commerce platform, emphasizing two key systems: Catalog Management and Promotion Management. It lays the groundwork for an advanced e-commerce platform capable of managing complex product data, implementing promotional strategies, and maintaining synchronization across various environments.
- A comprehensive solution for handling product catalogs, their classifications, and synchronization between different stages (e.g.,
stageandonline). - Supports importing, creating, updating, and synchronizing products with MongoDB as the primary database.
- Provides API endpoints for managing:
- Products (with attributes, variants, and prices)
- Categories
- Classifications
- Synchronization processes
- Manages promotional campaigns, including their creation, updates, and application to customer carts.
- Includes audit logging to track all changes and actions performed.
- Features a Promotion Evaluation Engine that applies discounts and tracks promotions based on cart data, integrating with commercetools for cart management.
- Server: Node.js
- Backend Framework: Fastify
- Database: MongoDB
- Messaging: NATS
- Search Engine: TypeSense
- Type Validation: TypeBox
- Transparent record versioning
- Transparent audit fields recording
- Audit logs
- Multitenant
- i18n text fields
- Events for indexing and auditlogging with NATS
- CQRS & EventStorming
The project uses the "classic" CQRS pattern with an event store
- Import, create, and update products with dynamic attributes.
- Synchronize catalogs between staged and live environments.
- Handle classifications, categories, and validations.
- Automatic Product indexing with TypeSense
- Create and evaluate promotions with customizable logic.
- Integration with commercetools for real-time cart data.
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install project dependencies:
npm i
-
Install Mandatory Infrastructure
brew install mongodb/brew/mongodb-community@7.0
-
Install Optional Infrastructure
brew install typesense/tap/typesense-server@27.1 brew install nats-server
Create .env and .env.test files using the supplied .example files, both in the <projectRoot> dir, and the <projectRoot>/apps/<project> folders.
npm run dev -w apps/catalognpm run dev -w apps/promotionRefer to the Postman Collection for detailed API documentation and usage examples for product management operations.
This project is a big refactor of the old Catalog and Promotion projects
This project is UNLICENSED.