Commit Graph

111 Commits

Author SHA1 Message Date
Antoni Nuñez Romeu d68463548f Patentes internacionales + Forgot Pwd
Run Tests on Branches / Detect Changes (push) Successful in 19s
Run Tests on Branches / Backend Tests (push) Successful in 2m46s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 2m24s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
2026-08-18 11:01:54 +02:00
Antoni Nuñez Romeu 87df61ab15 feat: add forgot password and username recovery flow
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Backend Tests (push) Successful in 2m24s
Run Tests on Branches / Frontend Tests (push) Successful in 1m57s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
- Add Mailpit SMTP container to docker-compose for dev email capture
- Add nodemailer dependency for email sending
- Add password_reset_tokens table (PG + SQLite)
- Add POST /api/auth/forgot-username endpoint
- Add POST /api/auth/forgot-password endpoint (token-based, 1h expiry)
- Add POST /api/auth/reset-password endpoint
- Create ForgotPasswordModal component (choose mode → email → sent)
- Create ResetPasswordView (token-based new password form)
- Add forgot/recovery links to LoginModal
- Add i18n translations (ES/CA) for the full flow
2026-07-27 15:57:54 +02:00
Antoni Nuñez Romeu e3e7d2f60b feat: pharmacy hours status and open now filter
Run Tests on Branches / Detect Changes (push) Successful in 17s
Run Tests on Branches / Backend Tests (push) Successful in 2m44s
Run Tests on Branches / Frontend Tests (push) Successful in 1m59s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
- Add is_open_now and is_always_open helpers in backend
- Add backend endpoint enrichment with is_open and is_24h fields
- Add client-side getOpenStatus with 24h, opens-at, opens-tomorrow support
- Add open-now filter toggle in PublicView and SearchView
- Add pharmacy no-hours fallback display
- Add sticky pharmacy controls on scroll
- Add admin hours editor with 24h toggle
- Add translations (es/ca) for all hour-related strings
- Add backend tests for hours logic and pharmacy endpoint
- Remove unused backup test files
2026-07-27 14:32:05 +02:00
Antoni Nuñez Romeu 076ca2d590 Fixes in deployment and passwords
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 2m2s
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Backend Tests (push) Successful in 1m58s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-22 18:28:47 +02:00
Antoni Nuñez Romeu 849763896d security: harden production configuration and routes
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Frontend Tests (push) Successful in 2m12s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 2m2s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Run Tests on Branches / Backend Tests (push) Successful in 2m8s
2026-07-22 17:24:54 +02:00
Ichitux e437ad427e Merge branch 'main' into fix/otel-metrics-and-monitoring-dashboards
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Run Tests on Branches / Backend Tests (push) Successful in 1m46s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
2026-07-21 12:30:53 +00:00
Antoni Nuñez Romeu f32ff701e1 fix(otel): lazy-init metrics and fix Grafana dashboards
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Backend Tests (push) Successful in 4m3s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
- Fix OTel custom metrics not reaching Prometheus: ESM static import
  hoisting caused metrics.getMeter() to run before sdk.start(), getting
  NoopMeterProvider. Changed to lazy-init pattern so instruments are
  created on first use after the SDK configures the real MeterProvider.

- Fix Grafana dashboards job labels: OTel adds service.namespace prefix
  (job=farmafinder/farmafinder-backend), updated queries to use regex
  match (job=~".*farmafinder-backend").

- Fix histogram metric names: OTel appends unit suffix (_milliseconds)
  to histogram names (e.g. http_request_duration_ms_milliseconds_bucket).

Verified: app_heartbeat_total, http_requests_total, db_query_duration_ms,
redis_cmd_duration_ms, and all other custom metrics now flow correctly
through OTLP -> Alloy -> Prometheus remote_write.
2026-07-21 13:18:18 +02:00
Antoni Nuñez Romeu ba626172a2 fix: send push notification when stock changes from 0 to available
Run Tests on Branches / Detect Changes (push) Successful in 16s
Run Tests on Branches / Backend Tests (push) Successful in 1m51s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-21 12:18:38 +02:00
Antoni Nuñez Romeu 85fc1ede15 fix: resolve {{count}} interpolation and add notification bell for parapharmacy products
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m44s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m51s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
- Add interpolation support to t() function in LanguageContext (web + mobile)
- Pass medicine, currentUser, onLoginRequest props to PharmacyList in ProductView
- Remove duplicate title in ProductView (PharmacyList already renders one)
2026-07-17 15:15:18 +02:00
Antoni Nuñez Romeu 854de92be5 fix: add i18n support for parapharmacy products and notification bell
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m37s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m52s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
- Mobile: Replace hardcoded Spanish in map.tsx with t() calls
- Mobile: Add notification bell to parapharmacy product detail screen
- Mobile: Add map/product i18n keys to es.js and ca.js locales
- Web: Add useTranslation to ProductView.jsx, replace all hardcoded strings
- Web: Add 24 productView.* translation keys to es.js and ca.js locales
- Fix 'Disponible en X farmacias' to respect language setting
2026-07-17 13:04:04 +02:00
Antoni Nuñez Romeu 84f4ef390d Fixing dockerfile & compose checks
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 1m34s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-17 12:04:15 +02:00
Antoni Nuñez Romeu 2f32bfbab6 Fixing Dockerfile with missing files
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 1m38s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-17 11:33:03 +02:00
Ichitux be707408b2 Merge branch 'main' into feat/i18n-bilingual-ca-es
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m40s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m40s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-17 08:25:14 +00:00
Antoni Nuñez Romeu ee958d4525 feat(i18n-mobile): add bilingual support (Català / Castellano) for React Native app
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m40s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m37s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Add lightweight i18n system matching the web app architecture.
Language persisted in AsyncStorage('ff-lang').

New files:
- src/i18n/locales/ca.js (~190 translation keys)
- src/i18n/locales/es.js (~190 translation keys)
- src/i18n/LanguageContext.jsx (Provider + AsyncStorage)
- src/i18n/useTranslation.js (hook)
- src/i18n/index.js (barrel export)

Modified 16 files:
- app/_layout.tsx: wrap with LanguageProvider, translate stack titles
- app/(tabs)/_layout.tsx: translate tab bar labels
- app/(tabs)/index.tsx: translate home screen
- app/(tabs)/search.tsx: translate search screen
- app/(tabs)/alerts.tsx: translate alerts screen
- app/(tabs)/profile.tsx: translate profile + add language selector (CA/ES)
- app/(tabs)/scan.tsx: translate scanner screen
- app/auth/login.tsx: translate login/register
- app/medicine/[id].tsx: translate medicine detail
- app/pharmacy/[id].tsx: translate pharmacy detail
- app/product/[source]/[id].tsx: translate product detail
- 5 components: MedicineCard, StockBadge, SearchBar, LoadingSpinner, BarcodeScanner

Language selector in Profile screen (globe icon + CA/ES toggle).
No routes changed. No API calls affected.
2026-07-17 10:22:41 +02:00
Antoni Nuñez Romeu a59fbda878 Fixes on docker compose & Dockerfile for Parapharmacy API
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Successful in 1m31s
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-17 10:22:27 +02:00
Ichitux d12c575fcf Merge branch 'main' into feat/i18n-bilingual-ca-es
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m45s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
2026-07-17 07:50:32 +00:00
Antoni Nuñez Romeu 38374341ed feat(i18n): add bilingual support (Català / Castellano)
Run Tests on Branches / Detect Changes (push) Successful in 11s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m44s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Add lightweight i18n system using React Context + useTranslation hook.
No external dependencies. Language persisted in localStorage('ff-lang').

New files:
- src/i18n/locales/ca.js (~410 translation keys)
- src/i18n/locales/es.js (~410 translation keys)
- src/i18n/LanguageContext.jsx (Provider + t() function)
- src/i18n/useTranslation.js (hook)
- src/i18n/index.js (barrel export)

Modified 22 files:
- main.jsx: wrap App with LanguageProvider
- App.test.jsx: add LanguageProvider wrapper for tests
- 13 user components: BottomNav, HomeView, LoginModal, SearchView,
  ProfileView, AlertsView, ScannerView, PharmacyList, MedicineResults,
  ProductResults, SavedNotifications, ErrorBoundary, SearchBar
- 6 admin components: AdminView, LoginForm, PharmacyManagement,
  MedicineManagement, PharmacyMedicineLink, PharmacyProductLink

ProfileView includes language selector (globe icon + modal CA/ES)
placed next to the Theme selector.

No routes changed. No API calls affected. No navigation changes.
2026-07-17 09:43:45 +02:00
Antoni Nuñez Romeu 9eb174dc8b fix(parapharmacy-api): use CORS_ORIGIN env var for Swagger server URL
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Failing after 7s
Swagger UI hardcoded localhost:3002, causing NetworkError when accessed
from the deployed server. Now reads CORS_ORIGIN to build the correct
server URL for API calls from the Swagger UI.
2026-07-16 23:14:48 +02:00
Antoni Nuñez Romeu cf087fc0b7 Fixed CI/CD and .env vars
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Successful in 1m45s
Run Tests on Branches / Frontend Tests (push) Successful in 1m46s
Run Tests on Branches / Frontend Mobile Tests (push) Has been skipped
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
Run Tests on Branches / PIP Platform Tests (push) Failing after 1m37s
2026-07-16 18:10:17 +02:00
Antoni Nuñez Romeu 8763f54071 fix: sync package.json and fix test scripts
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Successful in 1m58s
Run Tests on Branches / Frontend Tests (push) Successful in 1m38s
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m35s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
- scraper: changed test script to echo (no tests)
- parapharmacy-api: added --passWithNoTests to jest
- frontend: changed vitest to vitest run (exit after tests)

All tests now pass:
- backend: 17 tests passed
- frontend: 7 tests passed
- parapharmacy-api: no tests (exits cleanly)
- scraper: no tests (exits cleanly)
2026-07-16 17:31:05 +02:00
Antoni Nuñez Romeu fa74a6e060 fix: filter scraper results by search query
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Failing after 16s
Run Tests on Branches / Frontend Tests (push) Failing after 16s
Run Tests on Branches / Frontend Mobile Tests (push) Failing after 17s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
The scraper was extracting ALL products from the page including
navigation menu items. Now it filters products to only include
those that contain the search query in their name.

Before: Found 47 products (mostly navigation items)
After: Found 2 Capricare products (filtered by query)
2026-07-16 17:03:21 +02:00
Antoni Nuñez Romeu de8fdbb904 feat: add sort by distance and directions to ProductView
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Backend Tests (push) Failing after 17s
Run Tests on Branches / Frontend Tests (push) Failing after 16s
Run Tests on Branches / Frontend Mobile Tests (push) Failing after 18s
Run Tests on Branches / Parapharmacy API Tests (push) Has been skipped
- Added sort by distance functionality (same as SearchView)
- Added PharmacyList component with distance display
- Added 'Cómo llegar' button in map popup (Google Maps directions)
- Uses haversineKm for distance calculation
2026-07-16 16:55:48 +02:00
Antoni Nuñez Romeu 6155fdcd15 fix: add pharmacy map to ProductView and fix pharmacies endpoint
- Added PharmacyMap component to ProductView
- Updated backend to accept all valid sources for pharmacies endpoint
- Shows map with pharmacy locations and list of pharmacies with prices
2026-07-16 16:48:25 +02:00
Antoni Nuñez Romeu 08b7437803 fix: add 'seed' and 'manual' to valid product sources
Products created via seed script or manual entry have source='seed'
or 'manual', which wasn't in the valid sources list.
2026-07-16 16:40:41 +02:00
Antoni Nuñez Romeu 26e7d92079 fix: handle both array and object responses in admin search
The CIMA search API returns {results: [...]} but the admin panel
was treating it as an array, causing CIMA products to be lost.

Now handles both formats:
- Array: [...]
- Object: {results: [...]}
2026-07-16 16:32:24 +02:00
Antoni Nuñez Romeu dca7e373cd fix: use parapharmacy endpoint for all non-CIMA sources
- ProductView now checks if source is 'cima' to decide endpoint
- All other sources (seed, promofarma, docmorris, primor) use parapharmacy endpoint
- Same fix applied to mobile getProduct function

Before: only 'parapharmacy' source used parapharmacy endpoint
After: all non-CIMA sources use parapharmacy endpoint
2026-07-16 16:23:57 +02:00
Antoni Nuñez Romeu 63b25e3f4f fix: use _id for MongoDB products in frontend
- SearchView now uses p._id || p.id for product navigation
- ProductResults uses product._id || product.id for React key
- Fixes 'undefined' error when clicking parapharmacy products
2026-07-16 16:18:22 +02:00
Antoni Nuñez Romeu e5dcfbd2f5 fix: allow parapharmacy sources in pharmacy-products endpoint
Updated validation to accept: cima, promofarma, docmorris, primor, parapharmacy

Before: product_source must be 'cima'
After: product_source must be one of: cima, promofarma, docmorris, primor, parapharmacy
2026-07-16 16:02:25 +02:00
Antoni Nuñez Romeu 3666f4dee8 fix: update ProductResults and admin panel for parapharmacy
- Updated ProductResults component with new source labels
- Added price display for parapharmacy products
- Updated admin panel to search both CIMA and Parapharmacy
- Updated getSourceBadge to handle parapharmacy sources
- Added CSS for product price display
2026-07-16 15:58:35 +02:00
Antoni Nuñez Romeu 3429b7e548 fix: product detail view for parapharmacy products
- Updated ProductView to use correct endpoint for parapharmacy
- Updated getProduct service to handle parapharmacy products
- Shows price, category, brand, source for parapharmacy products
- Updated labels from 'OFF' to 'Parafarmacia'
2026-07-16 15:47:14 +02:00
Antoni Nuñez Romeu 570d4ab43e feat: unified search - remove filter tabs, show all results together
- Frontend now searches both CIMA and Parapharmacy simultaneously
- Removed filter tabs (Todos/Medicamentos/Parafarmacia)
- Results show in a single unified list
- Mobile: Shows medicines first, then parapharmacy section
- Web: Same unified approach with results summary
2026-07-16 15:36:08 +02:00
Antoni Nuñez Romeu 05b99e9ed4 feat: working scraping for Promofarma, DocMorris, and Primor
- Fixed Primor URL format and selectors
- Created simple N8N webhook that calls scraper API
- All 3 sources now working:
  - Promofarma: 20 products
  - DocMorris: 10 products
  - Primor: 20 products
- Total: 130 products in database
- N8N webhook at /webhook/scrape working correctly
2026-07-16 15:19:07 +02:00
Antoni Nuñez Romeu 972a59662d fix: fix parapharmacy proxy route order and add axios import
- Moved parapharmacy routes before :source/:id routes to prevent conflicts
- Added axios import to server.js
- Backend proxy now correctly forwards to parapharmacy-api
- Tested: search for 'capricare' returns 1 result, 'crema' returns 7 results
2026-07-16 15:03:46 +02:00
Antoni Nuñez Romeu a5a75d3249 feat: working Puppeteer scraper for Promofarma
- Added Puppeteer with Chrome in Docker
- Scraper extracts products using data attributes
- Added /api/scrape endpoint
- Tested: 10 products scraped from Promofarma

The scraper now works with Promofarma's HTML structure which uses
data-name, data-pvp attributes on article elements.
2026-07-16 14:54:51 +02:00
Antoni Nuñez Romeu 2ad4210221 feat: add scrape script and fix N8N webhook workflow
- Add direct scrape.js script for testing
- Fix N8N webhook workflow (lastNode response mode)
- Note: Real scraping requires Puppeteer for anti-bot sites
2026-07-16 13:14:56 +02:00
Antoni Nuñez Romeu e2dd3474a4 fix: add 'seed' and 'manual' to Product source enum
Allows seed script and manual product creation to work.
2026-07-16 13:06:17 +02:00
Antoni Nuñez Romeu 30f97fe87d feat: complete N8N scrapers for 6 sources and seed script
- Create comprehensive N8N workflow for all 6 parapharmacy sources
- Create webhook-triggered manual scraping workflow
- Add seed script with 20 sample products
- Update n8n/README.md with complete documentation
- Update docs/parapharmacy.md with seeding instructions
- Add seed script to package.json

Sources configured:
- Promofarma
- Pharmarket
- DocMorris
- 1001Farma
- Primor
- MiFarma
2026-07-16 13:00:20 +02:00
Antoni Nuñez Romeu 0c2f1cf928 fix: use npm install instead of npm ci in Dockerfile
npm ci requires package-lock.json which is at root level in monorepo.
npm install works without it.
2026-07-16 12:40:22 +02:00
Antoni Nuñez Romeu 7274979f62 chore: remove Open Food Facts (OFF) integration
- Remove off-service.js and off-service.test.js
- Remove OFF import from server.js
- Simplify /api/products/search to only use CIMA
- Remove 'openfoodfacts' from valid product sources
- Update frontend-mobile Product interface to remove OFF source
- Remove OFF env vars from .env.example
- Add PARAPHARMACY_API_URL to .env.example

OFF was replaced by the new parapharmacy-api microservice.
2026-07-16 12:34:08 +02:00
Antoni Nuñez Romeu b34657c78f feat: add parapharmacy API with MongoDB and N8N setup
- Create parapharmacy-api microservice with Express + Swagger + MongoDB
- Add product model with full-text search and deduplication
- Add CRUD endpoints and bulk upsert for scrapers
- Update docker-compose.yml with MongoDB, N8N, and parapharmacy-api services
- Add proxy endpoints in FarmaFinder backend for parapharmacy
- Update frontend services to use parapharmacy API
- Add Swagger documentation at /api/docs
2026-07-16 12:26:54 +02:00
Antoni Nuñez Romeu 5aadc096d1 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
2026-07-16 10:51:01 +02:00
Ichitux 1180599260 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
2026-07-16 10:13:25 +02:00
Antoni Nuñez Romeu f88c9db0a2 fix: regenerate backend package-lock.json — sync OTel dependencies 2026-07-16 10:13:04 +02:00
Antoni Nuñez Romeu 562201869a Fixed backend test 2026-07-16 10:13:04 +02:00
Antoni Nuñez Romeu 8245abd313 fix: skip Redis connection in test mode — prevents CI hang
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.
2026-07-16 10:13:04 +02:00
Antoni Nuñez Romeu a73ef4d422 fix(backend): use string resource attribute keys instead of semantic-conventions named exports
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.
2026-07-16 10:13:04 +02:00
Antoni Nuñez Romeu 295e5cd8fb feat: add end-to-end observability (metrics, health, mobile RUM, dashboards, alerts)
- 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/
2026-07-16 10:13:04 +02:00
Antoni Nuñez Romeu d66a9184aa fix: skip Redis connection in test mode — prevents CI hang
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.
2026-07-16 10:12:37 +02:00
Antoni Nuñez Romeu 3bfc0524d5 ci: optimize test performance — from ~3h to 3.5s
- 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
2026-07-16 10:12:37 +02:00
Antoni Nuñez Romeu 3a082877dd fix: add missing mocks for off-service.js and searchOTC in backend tests
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.
2026-07-16 10:12:37 +02:00