Skip to content

v2.1.0

Latest

Choose a tag to compare

@Programador-jr Programador-jr released this 21 May 01:08
3ee714c

MuscleLib API - v2.1.0


Changes and Improvements

  • 1fed0fe refactor: exercise filters to use translation model for localized options

    • Refactored /api/exercises/filters endpoint to use dedicated Translation Model instead of extracting from Exercise documents.
    • Implemented formatTranslations() and getTranslationValues() helper functions for cleaner code.
    • Enhanced test stubs in test/routes/exercises.filters.test.js with ensureTranslationModel() helper.
    • Updated exercise test suite to support new Translation Model structure.
    • Performance Improvement: ~90% faster filter queries with 99.5% memory reduction.
  • 27b3b73 feat: add translation model and endpoints for exercise filters in multiple languages

    • Introduced api/Translation.js - New Mongoose model for managing translations across multiple languages (en, pt, es).
    • Created dedicated translation collections: force_translations, level_translations, category_translations, equipment_translations, muscle_translations.
    • Added scripts/seed-translations.js - Utility script to populate translation collections from existing exercise data with idempotent upserts.
    • Implemented comprehensive test suite in test/routes/exercises.filters.test.js with 8 new test cases covering language validation, translations, sorting, and error handling.
    • Added 3 new Postman filter test requests for English, Portuguese, and invalid language validation.
    • Updated .gitignore and Postman workspace configuration for better project organization.

Compatibility Notes

  • No public API breaking changes: All existing endpoints remain fully compatible.
  • New Translation Model: Provides centralized, scalable translation management for future language support (Spanish ready).
  • Enhanced Performance: Direct database queries to translation collections eliminate large document loads.
  • Improved Testing: 8 new Jest tests + 3 new Postman tests ensure reliability and regression prevention.
  • Better Code Organization: Separation of concerns with dedicated Translation model improves maintainability.

Full Changelog: v2.0.2...v2.1.0