feat/parapharmacy-baby-products #31

Merged
Ichitux merged 38 commits from feat/parapharmacy-baby-products into main 2026-07-16 08:54:58 +00:00
Owner
No description provided.
Ichitux added 12 commits 2026-07-13 13:57:05 +00:00
- transformOFFProduct: maps OFF products to unified Product model
- searchBabyProducts: searches baby products via OFF API (1h cache)
- getBabyProductDetails: fetches product details by barcode (1h cache)
- 9 tests passing for transform logic and input validation
- GET /api/products/search?q={query} - parallel search across both sources
- GET /api/products/:source/:id - product detail by source (cima/openfoodfacts)
- Uses Promise.allSettled for fault-tolerant parallel search
- Added imports for searchOTC and OFF service functions
Displays CIMA OTC and Open Food Facts baby products with source/category
badges, product images, brand info, and Nutri-Score for OFF items.
docs: add design spec and implementation plan for parapharmacy + baby products
Run Tests on Branches / Detect Changes (push) Successful in 8s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
4df1594b3b
Ichitux added 1 commit 2026-07-13 14:18:21 +00:00
fix(backend): switch OFF API to /cgi/search.pl endpoint and fix test imports
Run Tests on Branches / Detect Changes (push) Successful in 8s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
26f309acfb
- Changed from /api/v2/search (returning 503) to /cgi/search.pl (working)
- Removed strict categories_tags=baby-food filter that was too restrictive
- Fixed test file to use dynamic imports for ES module compatibility
- Increased timeout to 10s for reliability
Ichitux added 1 commit 2026-07-13 14:23:10 +00:00
fix(backend): improve OFF API error handling
Run Tests on Branches / Detect Changes (push) Successful in 9s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has started running
ee23f61057
- Validate response is JSON before parsing (OFF returns HTML on 503)
- Don't cache empty results to avoid blocking future searches
- Add validateStatus to only accept 200 responses
- Better logging for API failures
Ichitux added 1 commit 2026-07-13 14:28:37 +00:00
feat(backend): add Open Food Facts authentication support
Run Tests on Branches / Detect Changes (push) Successful in 11s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
f1b0eab11d
- Add OFF_USERNAME and OFF_PASSWORD env vars
- Use Basic Auth when credentials are provided
- Improves rate limits for authenticated requests
- Auth is optional (works without credentials)
Ichitux added 1 commit 2026-07-13 14:43:57 +00:00
fix(backend): add retry logic and remove custom User-Agent for OFF API
Run Tests on Branches / Detect Changes (push) Successful in 10s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
452a835b64
- Add retry logic with exponential backoff (2 retries)
- Remove custom User-Agent that was being blocked by OFF
- Fix syntax error (missing catch block)
- OFF API blocks anonymous users during high demand
Ichitux added 1 commit 2026-07-13 15:00:13 +00:00
fix(backend): use v2 structured search API for OFF
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Frontend Tests (push) Successful in 3m25s
Run Tests on Branches / Backend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
20debdb023
- Switch from /cgi/search.pl (503 errors) to /api/v2/search with brand filter
- Add required User-Agent header per OFF documentation
- Add OFF_USER_AGENT env var for customization
- Update .env.example with User-Agent documentation
- Retry logic continues to work with new endpoint
Ichitux added 1 commit 2026-07-13 15:05:42 +00:00
fix(backend): remove auth from OFF read operations
Run Tests on Branches / Detect Changes (push) Successful in 17s
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Tests (push) Has been cancelled
2e3ce44e7b
- READ operations don't require auth per OFF docs (only User-Agent)
- Auth credentials were causing 503 errors
- Keep User-Agent header which is required
Ichitux added 1 commit 2026-07-13 15:13:26 +00:00
debug: add logging for OFF API requests
Run Tests on Branches / Detect Changes (push) Successful in 15s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m57s
Run Tests on Branches / Frontend Tests (push) Failing after 13m41s
Run Tests on Branches / Backend Tests (push) Failing after 15m38s
25ebb899e9
Ichitux added 1 commit 2026-07-13 15:31:45 +00:00
feat(frontend): integrate product search in SearchView
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
31c1a14343
- Add ProductResults component import
- Add products and searchMode state
- Add parallel product search to search effect
- Add filter tabs (Todos/Medicamentos/Parafarmacia)
- Render ProductResults when products found
- Add CSS for filter tabs and products section
Ichitux added 1 commit 2026-07-13 15:36:56 +00:00
feat(frontend): add product detail view and navigation
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
731a6c98ae
- Create ProductView component with product details display
- Add ProductView.css with responsive styling
- Add product screen to App.jsx screen system
- Pass onNavigateToProduct callback from App to SearchView
- Update ProductResults onSelect to use callback instead of window.location
Ichitux added 1 commit 2026-07-13 17:34:58 +00:00
fix(frontend): run medicine and product searches in parallel
Run Tests on Branches / Backend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Detect Changes (push) Has been cancelled
59edc7fbf1
- Use Promise.allSettled for parallel API calls
- Reduces total search time from ~1300ms to ~500ms
- Prevents results disappearing during sequential searches
Ichitux added 1 commit 2026-07-13 17:50:28 +00:00
fix(frontend): set screen to 'product' when navigating to product detail
Run Tests on Branches / Backend Tests (push) Has been cancelled
Run Tests on Branches / Detect Changes (push) Has been cancelled
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
f921b15d67
- Add setScreen('product') to onNavigateToProduct callback
- ProductView was never rendered because screen stayed as 'search'
Ichitux added 1 commit 2026-07-13 18:41:19 +00:00
feat: add pharmacy-product linking system
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
8bf0b33249
- Add pharmacy_products table (PostgreSQL + SQLite)
- Add public route GET /api/products/:source/:id/pharmacies
- Add admin CRUD routes for pharmacy-product links
- Add cascade delete when pharmacy is removed
- Update ProductView to show linked pharmacies
- Create PharmacyProductLink admin component
- Add 'Vincular Producto a Farmacia' tab in AdminView
Ichitux added 12 commits 2026-07-16 08:14:02 +00:00
The backend test was hanging in CI because server.js imports off-service.js
which pulls in redis-client.js. Without a mock, it tries to connect to Redis
at import time, hanging indefinitely in CI where no Redis server exists.

Also added the missing searchOTC mock for cima-service.js to fix the
SyntaxError from the export mismatch.
- Merge 3 parallel test jobs (backend/frontend/mobile) into one sequential job
- Remove dependency on dorny/paths-filter@v3 (replaced with git diff script)
- Add npm cache via setup-node to speed up dependency installation
- Downgrade Node.js from 24 to 22 LTS for stability
- Reduce checkout fetch-depth from full history to 2 commits
- Lazy-load tesseract.js only in OCR route (skips 30MB WASM download)
- Conditional tracing.js import (skip OTel gRPC in test mode)
- Remove unused barcode-detector import
- Add testTimeout/openHandlesTimeout to jest.config.js
- Add --forceExitTimeout=30000 to test script
- Split CI test jobs into parallel workflows (backend/frontend/mobile)
- Add timeout-minutes: 15 to all test jobs
- Use npm ci --ignore-scripts + selective native rebuild
The top-level await redisClient.connect() in redis-client.js was
blocking module import when no Redis server is available (CI env).
Add NODE_ENV guard + reconnect strategy with max retries.
- Backend: OTel metrics via OTLP -> Alloy -> Prometheus (OTEL_METRICS_EXPORTER=otlp)
- New business metrics (src/metrics.js): searches, CIMA latency/errors, cache
  hits/misses, logins, rate-limits, pharmacy writes/links, push sent/failed,
  DB + Redis timings/errors, HTTP req count/duration, heartbeat
- Backend health endpoints /healthz and /readyz
- Mobile (Expo): Grafana Faro RUM via @grafana/faro-react-native
- redis/postgres exporters in docker-compose + Prometheus scrape jobs
- Grafana dashboards (backend, datastores, mobile RUM, overview)
- Prometheus alert rules (farmafinder_*) -> existing Alertmanager (Telegram)
- Design/spec saved to docs/superpowers/specs/
The resolved @opentelemetry/semantic-conventions version in CI does not
export ATTR_SERVICE_NAMESPACE/ATTR_SERVICE_NAME as named exports, breaking
the backend test import. Use plain 'service.name'/'service.namespace'
string keys so the code is independent of the semantic-conventions version.
The top-level await redisClient.connect() in redis-client.js was
blocking module import when no Redis server is available (CI env).
Add NODE_ENV guard + reconnect strategy with max retries.
Background fixes & improvements
Run Tests on Branches / Detect Changes (push) Successful in 16s
Run Tests on Branches / Backend Tests (push) Successful in 1m53s
Run Tests on Branches / Frontend Tests (push) Failing after 1m57s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m44s
1180599260
Ichitux added 1 commit 2026-07-16 08:31:12 +00:00
Merge origin/main into feat/parapharmacy-baby-products - resolve conflicts keeping feature branch improvements
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Successful in 1m37s
Run Tests on Branches / Frontend Tests (push) Failing after 1m41s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
a85fd6cd05
Ichitux added 1 commit 2026-07-16 08:51:09 +00:00
fix: add ok: true to fetch mocks in SearchView tests
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Successful in 1m37s
Run Tests on Branches / Frontend Tests (push) Successful in 1m41s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
5aadc096d1
Ichitux merged commit 837f2cd4f3 into main 2026-07-16 08:54:58 +00:00
Ichitux deleted branch feat/parapharmacy-baby-products 2026-07-16 08:54:58 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Ichitux/FarmaFinder#31