Skip to content

feature/recommendation-model#85

Merged
andres15alvarez merged 9 commits into
devfrom
feature/recommendation-model
Apr 27, 2025
Merged

feature/recommendation-model#85
andres15alvarez merged 9 commits into
devfrom
feature/recommendation-model

Conversation

@andres15alvarez
Copy link
Copy Markdown
Member

This pull request introduces a recommendation system for products using machine learning and integrates it into the existing application. It also includes updates to dependencies, enhancements to DTOs, and improvements to the ProductsService. Below is a summary of the key changes:

Recommendation System Integration:

  • Added a new RecommendationModule with a RecommendationService that uses a nearest neighbors algorithm to recommend products based on user purchase history. The service fetches user-specific product data and calculates recommendations using TensorFlow (src/recommendation/recommendation.module.ts, src/recommendation/recommendation.service.ts, src/recommendation/model.ts, src/recommendation/data.ts) [1] [2] [3] [4].
  • Integrated the recommendation system into the ProductsController with a new GET /product/recommendations endpoint, guarded by authentication (src/products/products.controller.ts).

Dependency Updates:

  • Added @tensorflow/tfjs-node for machine learning functionality and updated typeorm to version ^0.3.22 (package.json) [1] [2].

Enhancements to DTOs:

  • Added the @Expose decorator to multiple DTOs to ensure proper serialization and used class-transformer's @Type decorator for nested objects (src/category/dto/category.dto.ts, src/products/dto/manufacturer.dto.ts, src/products/dto/product.dto.ts) [1] [2] [3].

Improvements to Products Service:

  • Refactored the ProductsService by deprecating the old getProducts method and introducing a new, more flexible version that supports additional filters like categoryIds, manufacturerIds, and priceRange (src/products/products.service.ts) [1] [2].
  • Removed unused repositories from the service for cleaner code (src/products/products.service.ts).

Database Enhancements:

  • Added a VirtualColumn to the ProductPresentation entity to calculate stock quantity dynamically using a SQL query (src/products/entities/product-presentation.entity.ts).

@andres15alvarez andres15alvarez added the feature New feature or request label Apr 27, 2025
@andres15alvarez andres15alvarez self-assigned this Apr 27, 2025
@andres15alvarez andres15alvarez merged commit fd44dfe into dev Apr 27, 2025
2 checks passed
@andres15alvarez andres15alvarez deleted the feature/recommendation-model branch April 27, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant