Skip to content

Conversation

@philipbrembeck
Copy link
Contributor

@philipbrembeck philipbrembeck commented Mar 27, 2025

Summary by Sourcery

Refactor and improve the ingredients classification process with enhanced error handling, worker-based processing, and dependency updates

New Features:

  • Added a worker-based approach for ingredient classification to improve performance
  • Implemented fallback mechanism for translation failures
  • Added concurrency scripts for development workflows

Enhancements:

  • Improved error handling in translation process
  • Moved sophisticated ingredient matching to a separate worker thread
  • Updated project dependencies to latest versions
  • Simplified translation error management

CI:

  • Added concurrently script for running multiple development checks
  • Improved lint and test script integration

Tests:

  • Updated unit tests to reflect new error handling behavior
  • Added more robust test scenarios for translation failures

Chores:

  • Updated package.json scripts
  • Upgraded NestJS and related dependencies
  • Cleaned up OpenAPI specification
  • Updated Dockerfile to use corepack

Note

Adds Redis-backed caching and rate limiting, moves ingredient classification to a worker with translation fallback, and caches product data across sources with input validation and updated health/docs.

  • Platform:
    • Redis Integration: Add RedisModule with RedisService, CacheService, and config (REDIS_* env). Use cache keys and thundering-herd locks.
    • Rate Limiting: New RedisRateLimiterMiddleware with in-memory fallback; applied globally (excludes health).
    • Health: Add Redis health indicator to /health.
  • Ingredients:
    • V1 Worker: Offload classification to ingredient.worker (worker_threads).
    • Translation: Cache DeepL responses; on failure, proceed with untranslated input; adjust tests accordingly.
  • Product:
    • Caching & Fetch: Cache grade, OpenFoodFacts, PETA, and OpenEANDB responses; parallelize fetch; add barcode validation; update tests.
  • API Docs:
    • Update OpenAPI: improved v1 ingredients 200 description, add local server, health examples; minor tag tweaks.
  • Ops/Build:
    • Docker: enable corepack.
    • Env: add REDIS_HOST/PORT/PASSWORD.
    • Scripts: add process:all, check.
  • Dependencies:
    • Bump NestJS/JS libs; add redis, rate-limiter-flexible, concurrently, etc.

Written by Cursor Bugbot for commit 0228cf8. Configure here.

kodiakhq bot and others added 30 commits December 4, 2024 03:22
…nestjs/testing-10.4.13

build(deps-dev): Bump @nestjs/testing from 10.4.12 to 10.4.13
Bumps [@nestjs/swagger](https://github.com/nestjs/swagger) from 8.0.7 to 8.1.0.
- [Release notes](https://github.com/nestjs/swagger/releases)
- [Changelog](https://github.com/nestjs/swagger/blob/master/.release-it.json)
- [Commits](nestjs/swagger@8.0.7...8.1.0)

---
updated-dependencies:
- dependency-name: "@nestjs/swagger"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/swagger-8.1.0

build(deps): Bump @nestjs/swagger from 8.0.7 to 8.1.0
Bumps [axios](https://github.com/axios/axios) from 1.7.8 to 1.7.9.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.7.8...v1.7.9)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…axios-1.7.9

build(deps): Bump axios from 1.7.8 to 1.7.9
Bumps [express](https://github.com/expressjs/express) from 4.21.1 to 4.21.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](expressjs/express@4.21.1...4.21.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…express-4.21.2

build(deps): Bump express from 4.21.1 to 4.21.2
Bumps [@nestjs/axios](https://github.com/nestjs/axios) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/nestjs/axios/releases)
- [Changelog](https://github.com/nestjs/axios/blob/master/.release-it.json)
- [Commits](nestjs/axios@3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: "@nestjs/axios"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/axios-3.1.3

build(deps): Bump @nestjs/axios from 3.1.2 to 3.1.3
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.14.0 to 17.15.0.
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md)
- [Commits](eslint-community/eslint-plugin-n@v17.14.0...v17.15.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-n
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…eslint-plugin-n-17.15.0

build(deps-dev): Bump eslint-plugin-n from 17.14.0 to 17.15.0
Bumps [@nestjs/cli](https://github.com/nestjs/nest-cli) from 10.4.8 to 10.4.9.
- [Release notes](https://github.com/nestjs/nest-cli/releases)
- [Changelog](https://github.com/nestjs/nest-cli/blob/master/.release-it.json)
- [Commits](nestjs/nest-cli@10.4.8...10.4.9)

---
updated-dependencies:
- dependency-name: "@nestjs/cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/cli-10.4.9

build(deps-dev): Bump @nestjs/cli from 10.4.8 to 10.4.9
Bumps [@nestjs/testing](https://github.com/nestjs/nest/tree/HEAD/packages/testing) from 10.4.13 to 10.4.15.
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.15/packages/testing)

---
updated-dependencies:
- dependency-name: "@nestjs/testing"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/testing-10.4.15

build(deps-dev): Bump @nestjs/testing from 10.4.13 to 10.4.15
Bumps [@nestjs/core](https://github.com/nestjs/nest/tree/HEAD/packages/core) from 10.4.13 to 10.4.15.
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.15/packages/core)

---
updated-dependencies:
- dependency-name: "@nestjs/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/core-10.4.15

build(deps): Bump @nestjs/core from 10.4.13 to 10.4.15
Bumps [@nestjs/common](https://github.com/nestjs/nest/tree/HEAD/packages/common) from 10.4.13 to 10.4.15.
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.15/packages/common)

---
updated-dependencies:
- dependency-name: "@nestjs/common"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.17.0 to 8.18.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.18.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/common-10.4.15

build(deps): Bump @nestjs/common from 10.4.13 to 10.4.15
…typescript-eslint/parser-8.18.0

build(deps-dev): Bump @typescript-eslint/parser from 8.17.0 to 8.18.0
Bumps [@nestjs/platform-express](https://github.com/nestjs/nest/tree/HEAD/packages/platform-express) from 10.4.13 to 10.4.15.
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.15/packages/platform-express)

---
updated-dependencies:
- dependency-name: "@nestjs/platform-express"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/platform-express-10.4.15

build(deps): Bump @nestjs/platform-express from 10.4.13 to 10.4.15
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.17.0 to 8.18.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.18.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/eslint-plugin-8.18.0

build(deps-dev): Bump @typescript-eslint/eslint-plugin from 8.17.0 to 8.18.0
Bumps [express-rate-limit](https://github.com/express-rate-limit/express-rate-limit) from 7.4.1 to 7.5.0.
- [Release notes](https://github.com/express-rate-limit/express-rate-limit/releases)
- [Commits](express-rate-limit/express-rate-limit@v7.4.1...v7.5.0)

---
updated-dependencies:
- dependency-name: express-rate-limit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…express-rate-limit-7.5.0

build(deps): Bump express-rate-limit from 7.4.1 to 7.5.0
dependabot bot and others added 2 commits December 1, 2025 03:19
Bumps [pino](https://github.com/pinojs/pino) from 9.6.0 to 9.14.0.
- [Release notes](https://github.com/pinojs/pino/releases)
- [Commits](pinojs/pino@v9.6.0...v9.14.0)

---
updated-dependencies:
- dependency-name: pino
  dependency-version: 9.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…pino-9.14.0

build(deps): Bump pino from 9.6.0 to 9.14.0
dependabot bot and others added 2 commits December 1, 2025 03:19
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.29.0 to 8.48.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.48.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.48.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/eslint-plugin-8.48.0

build(deps-dev): Bump @typescript-eslint/eslint-plugin from 8.29.0 to 8.48.0
dependabot bot and others added 2 commits December 1, 2025 03:20
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.31.0 to 2.32.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.31.0...v2.32.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-version: 2.32.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…eslint-plugin-import-2.32.0

build(deps-dev): Bump eslint-plugin-import from 2.31.0 to 2.32.0
dependabot bot and others added 2 commits December 1, 2025 03:24
Bumps [pino-http](https://github.com/pinojs/pino-http) from 10.4.0 to 10.5.0.
- [Release notes](https://github.com/pinojs/pino-http/releases)
- [Commits](pinojs/pino-http@v10.4.0...v10.5.0)

---
updated-dependencies:
- dependency-name: pino-http
  dependency-version: 10.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…pino-http-10.5.0

build(deps): Bump pino-http from 10.4.0 to 10.5.0
dependabot bot and others added 2 commits December 2, 2025 04:15
Bumps [redis](https://github.com/redis/node-redis) from 5.5.6 to 5.10.0.
- [Release notes](https://github.com/redis/node-redis/releases)
- [Changelog](https://github.com/redis/node-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/node-redis/compare/redis@5.5.6...redis@5.10.0)

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 5.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…redis-5.10.0

build(deps): Bump redis from 5.5.6 to 5.10.0
dependabot bot and others added 2 commits December 2, 2025 04:16
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.17.0 to 17.23.1.
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md)
- [Commits](eslint-community/eslint-plugin-n@v17.17.0...v17.23.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-n
  dependency-version: 17.23.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…eslint-plugin-n-17.23.1

build(deps-dev): Bump eslint-plugin-n from 17.17.0 to 17.23.1
dependabot bot and others added 2 commits December 2, 2025 04:35
Bumps [express](https://github.com/expressjs/express) from 4.21.2 to 4.22.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.22.0/History.md)
- [Commits](expressjs/express@4.21.2...4.22.0)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 4.22.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…express-4.22.0

build(deps): Bump express from 4.21.2 to 4.22.0
dependabot bot and others added 2 commits December 2, 2025 04:49
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.4.5 to 29.4.6.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](kulshekhar/ts-jest@v29.4.5...v29.4.6)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-version: 29.4.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…ts-jest-29.4.6

build(deps-dev): Bump ts-jest from 29.4.5 to 29.4.6
dependabot bot and others added 2 commits December 3, 2025 03:06
Bumps [@nestjs/cli](https://github.com/nestjs/nest-cli) from 11.0.12 to 11.0.14.
- [Release notes](https://github.com/nestjs/nest-cli/releases)
- [Commits](nestjs/nest-cli@11.0.12...11.0.14)

---
updated-dependencies:
- dependency-name: "@nestjs/cli"
  dependency-version: 11.0.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/cli-11.0.14

build(deps-dev): Bump @nestjs/cli from 11.0.12 to 11.0.14
dependabot bot and others added 2 commits December 3, 2025 03:06
Bumps [@nestjs/platform-express](https://github.com/nestjs/nest/tree/HEAD/packages/platform-express) from 10.4.15 to 10.4.20.
- [Release notes](https://github.com/nestjs/nest/releases)
- [Commits](https://github.com/nestjs/nest/commits/v10.4.20/packages/platform-express)

---
updated-dependencies:
- dependency-name: "@nestjs/platform-express"
  dependency-version: 10.4.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/platform-express-10.4.20

build(deps): Bump @nestjs/platform-express from 10.4.15 to 10.4.20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants