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

This commit is contained in:
2026-07-17 07:50:32 +00:00
7 changed files with 225 additions and 22 deletions
+1
View File
@@ -18,6 +18,7 @@ N8N_EMAIL=admin@farmafinder.com
# Parapharmacy API # Parapharmacy API
PARAPHARMACY_API_URL=http://parapharmacy-api:3002 PARAPHARMACY_API_URL=http://parapharmacy-api:3002
PARAPHARMACY_CORS_ORIGIN=http://localhost:4000
MONGODB_URI=mongodb://mongodb:27017/parapharmacy MONGODB_URI=mongodb://mongodb:27017/parapharmacy
# Expo Push Notifications (mobile) # Expo Push Notifications (mobile)
+159 -11
View File
@@ -13,6 +13,8 @@ jobs:
outputs: outputs:
backend: ${{ steps.filter.outputs.backend }} backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }} frontend: ${{ steps.filter.outputs.frontend }}
parapharmacy-api: ${{ steps.filter.outputs.parapharmacy-api }}
pip-platform: ${{ steps.filter.outputs.pip-platform }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dorny/paths-filter@v3 - uses: dorny/paths-filter@v3
@@ -25,6 +27,11 @@ jobs:
frontend: frontend:
- 'apps/frontend/**' - 'apps/frontend/**'
- 'packages/**' - 'packages/**'
parapharmacy-api:
- 'apps/parapharmacy-api/**'
- 'packages/**'
pip-platform:
- 'apps/pip-platform/**'
test-backend: test-backend:
name: Backend Tests name: Backend Tests
@@ -46,6 +53,68 @@ jobs:
- name: Run tests - name: Run tests
run: npm test --workspace=farma-clic-backend run: npm test --workspace=farma-clic-backend
test-parapharmacy-api:
name: Parapharmacy API Tests
needs: detect-changes
if: needs.detect-changes.outputs.parapharmacy-api == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run Parapharmacy API Tests
run: npm test --workspace=farmafinder-parapharmacy-api
test-pip-platform:
name: Pip Platform Tests
needs: detect-changes
if: false && needs.detect-changes.outputs.pip-platform == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: pip_test
POSTGRES_USER: pip
POSTGRES_PASSWORD: pip_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U pip"
--health-interval=10s
--health-timeout=5s
--health-retries=5
redis:
image: redis:alpine
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv
run: pip install uv
- name: Install dependencies
working-directory: apps/pip-platform
run: uv sync --extra dev
- name: Run Tests
working-directory: apps/pip-platform
run: uv run pytest
test-frontend: test-frontend:
name: Frontend Tests name: Frontend Tests
needs: detect-changes needs: detect-changes
@@ -90,6 +159,58 @@ jobs:
git.hacecalor.net/ichitux/farmafinder-backend:latest git.hacecalor.net/ichitux/farmafinder-backend:latest
git.hacecalor.net/ichitux/farmafinder-backend:${{ gitea.sha }} git.hacecalor.net/ichitux/farmafinder-backend:${{ gitea.sha }}
build-parapharmacy-api:
name: Build Parapharmacy API
needs: [ detect-changes, test-parapharmacy-api ]
if: |
always() &&
needs.detect-changes.outputs.parapharmacy-api == 'true' &&
(needs.test-parapharmacy-api.result == 'success' || needs.test-parapharmacy-api.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: git.hacecalor.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push parapharmacy-api image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/parapharmacy-api/Dockerfile
push: true
tags: |
git.hacecalor.net/ichitux/farmafinder-parapharmacy-api:latest
git.hacecalor.net/ichitux/farmafinder-parapharmacy-api:${{ gitea.sha }}
build-pip-platform:
name: Build Pip Platform
needs: [ detect-changes, test-pip-platform ]
if: |
always() &&
needs.detect-changes.outputs.pip-platform == 'true' &&
(needs.test-pip-platform.result == 'success' || needs.test-pip-platform.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: git.hacecalor.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push pip-platform image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/pip-platform/Dockerfile
push: true
tags: |
git.hacecalor.net/ichitux/farmafinder-pip-platform:latest
git.hacecalor.net/ichitux/farmafinder-pip-platform:${{ gitea.sha }}
build-frontend: build-frontend:
name: Build Frontend name: Build Frontend
needs: [ detect-changes, test-frontend ] needs: [ detect-changes, test-frontend ]
@@ -117,24 +238,51 @@ jobs:
deploy: deploy:
name: Deploy name: Deploy
needs: [ detect-changes, build-backend, build-frontend ] needs: [ detect-changes, build-backend, build-frontend, build-parapharmacy-api, build-pip-platform ]
if: | if: |
always() && always() &&
(needs.build-backend.result == 'success' || needs.build-backend.result == 'skipped') && (needs.build-backend.result == 'success' || needs.build-backend.result == 'skipped') &&
(needs.build-frontend.result == 'success' || needs.build-frontend.result == 'skipped') && (needs.build-frontend.result == 'success' || needs.build-frontend.result == 'skipped') &&
(needs.build-parapharmacy-api.result == 'success' || needs.build-parapharmacy-api.result == 'skipped') &&
(needs.build-pip-platform.result == 'success' || needs.build-pip-platform.result == 'skipped') &&
(needs.detect-changes.outputs.backend == 'true' || needs.detect-changes.outputs.frontend == 'true') (needs.detect-changes.outputs.backend == 'true' || needs.detect-changes.outputs.frontend == 'true')
runs-on: ubuntu-latest runs-on: self-hosted
steps: steps:
- name: SSH to remote server - name: Pull latest code
uses: appleboy/ssh-action@v1.0.3 working-directory: /docker/FarmaFinder
with: run: |
host: ${{ secrets.HOST }} set -euo pipefail
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd /docker/FarmaFinder
git pull git pull
- name: Sync .env files from .env.example
working-directory: /docker/FarmaFinder
run: |
set -euo pipefail
while IFS= read -r env_example; do
dir=$(dirname "$env_example")
env_file="$dir/.env"
if [ ! -f "$env_file" ]; then
cp "$env_example" "$env_file"
echo "[env-sync] Created $env_file from $env_example"
else
while IFS= read -r line || [ -n "$line" ]; do
case "$line" in
''|\#*) continue ;;
esac
key=$(echo "$line" | cut -d'=' -f1)
if ! grep -qF "$key=" "$env_file"; then
echo "$line" >> "$env_file"
echo "[env-sync] Added missing key '$key' to $env_file"
fi
done < "$env_example"
fi
done < <(find apps -name ".env.example" -type f)
- name: Deploy containers
working-directory: /docker/FarmaFinder
run: |
set -euo pipefail
docker compose pull docker compose pull
docker compose down --remove-orphans docker compose down --remove-orphans
docker compose up -d docker compose up -d
+49 -3
View File
@@ -13,6 +13,8 @@ jobs:
backend: ${{ steps.filter.outputs.backend }} backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }} frontend: ${{ steps.filter.outputs.frontend }}
frontend-mobile: ${{ steps.filter.outputs.frontend-mobile }} frontend-mobile: ${{ steps.filter.outputs.frontend-mobile }}
parapharmacy-api: ${{ steps.filter.outputs.parapharmacy-api }}
pip-platform: ${{ steps.filter.outputs.pip-platform }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dorny/paths-filter@v3 - uses: dorny/paths-filter@v3
@@ -31,6 +33,8 @@ jobs:
parapharmacy-api: parapharmacy-api:
- 'apps/parapharmacy-api/**' - 'apps/parapharmacy-api/**'
- 'packages/**' - 'packages/**'
pip-platform:
- 'apps/pip-platform/**'
test-backend: test-backend:
name: Backend Tests name: Backend Tests
@@ -104,7 +108,49 @@ jobs:
cache: 'npm' cache: 'npm'
- name: Install dependencies - name: Install dependencies
run: npm ci --ignore-scripts run: npm ci --ignore-scripts
- name: Install parapharmacy-api native deps
run: npm rebuild sqlite3 bcrypt --workspace=farma-clic-parapharmacy-api
- name: Run Parapharmacy API Tests - name: Run Parapharmacy API Tests
run: npm test --workspace=farma-clic-parapharmacy-api run: npm test --workspace=farmafinder-parapharmacy-api
test-pip-platform:
name: PIP Platform Tests
needs: detect-changes
if: false && needs.detect-changes.outputs.pip-platform == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: pip_test
POSTGRES_USER: pip
POSTGRES_PASSWORD: pip_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U pip"
--health-interval=10s
--health-timeout=5s
--health-retries=5
redis:
image: redis:alpine
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv
run: pip install uv
- name: Install dependencies
working-directory: apps/pip-platform
run: uv sync --extra dev
- name: Run Tests
working-directory: apps/pip-platform
run: uv run pytest
+4
View File
@@ -20,5 +20,9 @@ VAPID_SUBJECT=mailto:admin@example.com
# https://expo.dev/accounts/[username]/settings/access-tokens # https://expo.dev/accounts/[username]/settings/access-tokens
EXPO_ACCESS_TOKEN= EXPO_ACCESS_TOKEN=
# Clave para que los workflows de N8N (capa ETL) hagan ingest al catálogo unificado.
# Genera una cadena aleatoria fuerte, p.ej.: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
INGEST_API_KEY=dev-ingest-key-change-me
# Parapharmacy API # Parapharmacy API
PARAPHARMACY_API_URL=http://localhost:3002 PARAPHARMACY_API_URL=http://localhost:3002
+1 -1
View File
@@ -6,7 +6,7 @@
# In Docker on the same host as Alloy, use http://localhost:4318 (the # In Docker on the same host as Alloy, use http://localhost:4318 (the
# container's perspective of the host). For external deploys, use the # container's perspective of the host). For external deploys, use the
# Alloy's public URL, e.g. https://alloy.example.com. # Alloy's public URL, e.g. https://alloy.example.com.
VITE_FARO_ENDPOINT=http://localhost:4318 VITE_FARO_ENDPOINT=https://grafana.hacecalor.net:4318
# App name shown in Grafana Explore / Faro data source. # App name shown in Grafana Explore / Faro data source.
VITE_FARO_APP_NAME=farmaclic-frontend VITE_FARO_APP_NAME=farmaclic-frontend
+6 -2
View File
@@ -12,6 +12,10 @@ import scraperRouter from './routes/scraper.js';
const app = express(); const app = express();
// Swagger configuration // Swagger configuration
const swaggerServerUrl = process.env.CORS_ORIGIN
? process.env.CORS_ORIGIN.replace(/\/$/, '') // strip trailing slash
: `http://localhost:${config.port}`;
const swaggerOptions = { const swaggerOptions = {
definition: { definition: {
openapi: '3.0.0', openapi: '3.0.0',
@@ -22,8 +26,8 @@ const swaggerOptions = {
}, },
servers: [ servers: [
{ {
url: `http://localhost:${config.port}`, url: swaggerServerUrl,
description: 'Development server', description: process.env.CORS_ORIGIN ? 'Production server' : 'Development server',
}, },
], ],
components: { components: {
+1 -1
View File
@@ -98,7 +98,7 @@ services:
PORT: "3002" PORT: "3002"
NODE_ENV: production NODE_ENV: production
MONGODB_URI: mongodb://mongodb:27017/parapharmacy MONGODB_URI: mongodb://mongodb:27017/parapharmacy
CORS_ORIGIN: http://localhost:4000 CORS_ORIGIN: ${PARAPHARMACY_CORS_ORIGIN:-http://localhost:4000}
depends_on: depends_on:
- mongodb - mongodb