diff --git a/API/index.js b/API/index.js index 126d467..0ef4324 100644 --- a/API/index.js +++ b/API/index.js @@ -1,5 +1,5 @@ /** - * FarmaFinder external pharmacy sources (OpenStreetMap, Google Places, open-data URLs). + * FarmaClic external pharmacy sources (OpenStreetMap, Google Places, open-data URLs). * Used by the backend admin import; OSM does not require n8n. */ diff --git a/API/open-data.js b/API/open-data.js index ca87821..c7fcbf3 100644 --- a/API/open-data.js +++ b/API/open-data.js @@ -83,7 +83,7 @@ export async function fetchPharmaciesFromOpenDataUrl(openDataUrl) { const res = await fetch(u, { headers: { Accept: 'application/json', - 'User-Agent': 'FarmaFinder/1.0 (open-data pharmacy import)', + 'User-Agent': 'FarmaClic/1.0 (open-data pharmacy import)', }, }); const text = await res.text(); diff --git a/API/opening-hours-osm.js b/API/opening-hours-osm.js index e721dd1..d56389d 100644 --- a/API/opening-hours-osm.js +++ b/API/opening-hours-osm.js @@ -1,5 +1,5 @@ /** - * Parse a subset of the OSM opening_hours format into FarmaFinder's internal + * Parse a subset of the OSM opening_hours format into FarmaClic's internal * shape: { mon: ["09:00", "21:00"], ..., sun: null }. * * Supports the patterns commonly seen on amenity=pharmacy nodes: diff --git a/API/osm-overpass.js b/API/osm-overpass.js index de48c76..02f44f2 100644 --- a/API/osm-overpass.js +++ b/API/osm-overpass.js @@ -35,7 +35,7 @@ async function fetchOverpass(endpoint, body) { headers: { 'Content-Type': 'application/x-www-form-urlencoded', Accept: 'application/json', - 'User-Agent': 'FarmaFinder/1.0 (OSM pharmacy import; local admin)', + 'User-Agent': 'FarmaClic/1.0 (OSM pharmacy import; local admin)', }, body, }); diff --git a/API/package.json b/API/package.json index db28e6a..c9a6f64 100644 --- a/API/package.json +++ b/API/package.json @@ -1,5 +1,5 @@ { - "name": "farma-finder-api-sources", + "name": "farma-clic-api-sources", "private": true, "type": "module" } diff --git a/backend/.env.example b/backend/.env.example index bf65dcd..8cbdf78 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -7,7 +7,7 @@ REDIS_PORT=6379 REDIS_PASSWORD= # PostgreSQL for user accounts (leave unset to fallback to SQLite — dev/test only) -PG_URL=postgresql://farmafinder:change-me@localhost:5432/farmafinder +PG_URL=postgresql://farmaclic:change-me@localhost:5432/farmaclic PG_PASSWORD=change-me # Web Push (VAPID). Generate with: diff --git a/backend/farmacias-webhook-import.js b/backend/farmacias-webhook-import.js index e4bbb17..3979f56 100644 --- a/backend/farmacias-webhook-import.js +++ b/backend/farmacias-webhook-import.js @@ -1,5 +1,5 @@ /** - * Fetch pharmacy lists from an n8n (or any) HTTP webhook and map into FarmaFinder rows. + * Fetch pharmacy lists from an n8n (or any) HTTP webhook and map into FarmaClic rows. * Default URL: FARMACIAS_WEBHOOK_URL env or the project webhook. */ diff --git a/backend/package.json b/backend/package.json index 9f00bb2..43c6ef2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,7 +1,7 @@ { - "name": "farma-finder-backend", + "name": "farma-clic-backend", "version": "1.0.0", - "description": "Backend API for FarmaFinder", + "description": "Backend API for FarmaClic", "main": "server.js", "type": "module", "scripts": { diff --git a/backend/reset-db.sh b/backend/reset-db.sh index 14e40c0..711dab7 100644 --- a/backend/reset-db.sh +++ b/backend/reset-db.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "🔄 FarmaFinder - Quick Database Reset" +echo "🔄 FarmaClic - Quick Database Reset" echo "====================================" echo "" echo "Este script eliminará la base de datos actual y creará una nueva." diff --git a/backend/server.js b/backend/server.js index 20daef9..1f52395 100644 --- a/backend/server.js +++ b/backend/server.js @@ -30,7 +30,7 @@ const PORT = process.env.PORT || 3001; // span_id to every log line so they can be correlated in Grafana. const logger = pino({ level: process.env.LOG_LEVEL || 'info', - base: { service: process.env.OTEL_SERVICE_NAME || 'farmafinder-backend' }, + base: { service: process.env.OTEL_SERVICE_NAME || 'farmaclic-backend' }, }); // Trust the reverse proxy in front of us (Docker/Traefik/nginx/Cloudflare) so @@ -61,7 +61,7 @@ if (PG_URL) { } const sessionConfig = { - secret: process.env.SESSION_SECRET || 'farma-finder-secret-key-change-in-production', + secret: process.env.SESSION_SECRET || 'farma-clic-secret-key-change-in-production', resave: false, saveUninitialized: false, cookie: { @@ -703,7 +703,7 @@ async function nominatimSearchFirstHit(originalQuery) { Accept: 'application/json', 'Accept-Language': 'es,en', 'User-Agent': - 'FarmaFinder/1.0 (pharmacy admin; geocoding; https://github.com/)', + 'FarmaClic/1.0 (pharmacy admin; geocoding; https://github.com/)', }, }); const text = await nomRes.text(); diff --git a/backend/src/tracing.js b/backend/src/tracing.js index 7bb567c..f07a24e 100644 --- a/backend/src/tracing.js +++ b/backend/src/tracing.js @@ -1,8 +1,8 @@ -// OpenTelemetry Node SDK bootstrap for FarmaFinder backend. +// OpenTelemetry Node SDK bootstrap for FarmaClic backend. // Started as a side-effect import from server.js (ESM). // // Env vars (set by docker-compose): -// OTEL_SERVICE_NAME — default: farmafinder-backend +// OTEL_SERVICE_NAME — default: farmaclic-backend // OTEL_EXPORTER_OTLP_ENDPOINT — OTLP gRPC endpoint (e.g. http://alloy:4317) // // Exports traces to the shared Grafana Alloy collector, where they are @@ -15,17 +15,17 @@ import * as resources from '@opentelemetry/resources'; import { ATTR_SERVICE_NAME, ATTR_SERVICE_NAMESPACE } from '@opentelemetry/semantic-conventions'; import { PinoInstrumentation } from '@opentelemetry/instrumentation-pino'; -const serviceName = process.env.OTEL_SERVICE_NAME || 'farmafinder-backend'; +const serviceName = process.env.OTEL_SERVICE_NAME || 'farmaclic-backend'; const otlpEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4317'; const resource = typeof resources.resourceFromAttributes === 'function' ? resources.resourceFromAttributes({ [ATTR_SERVICE_NAME]: serviceName, - [ATTR_SERVICE_NAMESPACE]: 'farmafinder', + [ATTR_SERVICE_NAMESPACE]: 'farmaclic', }) : new resources.Resource({ [ATTR_SERVICE_NAME]: serviceName, - [ATTR_SERVICE_NAMESPACE]: 'farmafinder', + [ATTR_SERVICE_NAMESPACE]: 'farmaclic', }); const sdk = new NodeSDK({ diff --git a/capacitor.config.json b/capacitor.config.json index 81b52aa..de77975 100644 --- a/capacitor.config.json +++ b/capacitor.config.json @@ -1,6 +1,6 @@ { - "appId": "net.hacecalor.farmafinder", - "appName": "FarmaFinder", + "appId": "net.hacecalor.farmaclic", + "appName": "FarmaClic", "webDir": "frontend/dist", "server": { "androidScheme": "https" diff --git a/docker-compose.yml b/docker-compose.yml index d47bca8..bc5e24e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,14 +7,14 @@ services: image: postgres:16-alpine restart: unless-stopped environment: - POSTGRES_DB: farmafinder - POSTGRES_USER: farmafinder + POSTGRES_DB: farmaclic + POSTGRES_USER: farmaclic POSTGRES_PASSWORD: ${PG_PASSWORD:-change-me-in-production} volumes: - postgres_data:/var/lib/postgresql/data backend: - image: git.hacecalor.net/ichitux/farmafinder-backend:latest + image: git.hacecalor.net/ichitux/farmaclic-backend:latest build: context: . dockerfile: backend/Dockerfile @@ -25,19 +25,19 @@ services: PORT: "3001" NODE_ENV: production SESSION_SECRET: ${SESSION_SECRET:-change-me-in-production} - CORS_ORIGIN: http://localhost:3000 + CORS_ORIGIN: http://localhost:4000 REDIS_HOST: redis REDIS_PORT: "6379" REDIS_PASSWORD: ${REDIS_PASSWORD:-} DATABASE_PATH: /app/data/database.sqlite FARMACIAS_WEBHOOK_URL: ${FARMACIAS_WEBHOOK_URL:-} - PG_URL: postgresql://farmafinder:${PG_PASSWORD:-change-me-in-production}@postgres:5432/farmafinder + PG_URL: postgresql://farmaclic:${PG_PASSWORD:-change-me-in-production}@postgres:5432/farmaclic # OpenTelemetry — exported via OTLP gRPC to the shared Alloy collector - OTEL_SERVICE_NAME: farmafinder-backend + OTEL_SERVICE_NAME: farmaclic-backend OTEL_EXPORTER_OTLP_ENDPOINT: http://host.docker.internal:4317 OTEL_TRACES_EXPORTER: otlp OTEL_LOGS_EXPORTER: otlp - OTEL_RESOURCE_ATTRIBUTES: service.namespace=farmafinder + OTEL_RESOURCE_ATTRIBUTES: service.namespace=farmaclic volumes: - backend_data:/app/data depends_on: @@ -45,17 +45,17 @@ services: - postgres frontend: - image: git.hacecalor.net/ichitux/farmafinder-frontend:latest + image: git.hacecalor.net/ichitux/farmaclic-frontend:latest build: context: ./frontend args: VITE_FARO_ENDPOINT: ${VITE_FARO_ENDPOINT:-http://localhost:4318} - VITE_FARO_APP_NAME: ${VITE_FARO_APP_NAME:-farmafinder-frontend} + VITE_FARO_APP_NAME: ${VITE_FARO_APP_NAME:-farmaclic-frontend} VITE_FARO_ENV: ${VITE_FARO_ENV:-production} VITE_FARO_APP_VERSION: ${VITE_FARO_APP_VERSION:-1.0.0} restart: unless-stopped ports: - - "3000:80" + - "4000:80" depends_on: - backend diff --git a/frontend/.env.example b/frontend/.env.example index a62779f..d6309f0 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -9,7 +9,7 @@ VITE_FARO_ENDPOINT=http://localhost:4318 # App name shown in Grafana Explore / Faro data source. -VITE_FARO_APP_NAME=farmafinder-frontend +VITE_FARO_APP_NAME=farmaclic-frontend # Environment label (production | staging | development). VITE_FARO_ENV=production diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 4dfa479..5cf0ec9 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,6 +1,6 @@ FROM node:20-alpine AS build ARG VITE_FARO_ENDPOINT -ARG VITE_FARO_APP_NAME=farmafinder-frontend +ARG VITE_FARO_APP_NAME=farmaclic-frontend ARG VITE_FARO_ENV=production ARG VITE_FARO_APP_VERSION=1.0.0 ENV VITE_FARO_ENDPOINT=$VITE_FARO_ENDPOINT diff --git a/frontend/index.html b/frontend/index.html index 2ecce58..f3a88e2 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ -
{isRegister - ? 'Save your address and get notified when medicines arrive.' - : 'Sign in to manage your profile and notifications.'} + ? 'Guarda tu dirección y recibe notificaciones cuando lleguen medicamentos.' + : 'Inicia sesión para gestionar tu perfil y notificaciones.'}
diff --git a/frontend/src/components/MedicineResults.jsx b/frontend/src/components/MedicineResults.jsx index 6efacc5..5c28627 100644 --- a/frontend/src/components/MedicineResults.jsx +++ b/frontend/src/components/MedicineResults.jsx @@ -11,7 +11,7 @@ function MedicineResults({ medicines, onSelect, query, currentUser, onLoginReque if (medicines.length === 0 && query.length >= 2) { return (No medicines found matching "{query}"
+No se encontraron medicamentos para "{query}"
Active Ingredient: {medicine.active_ingredient}
-Dosage: {medicine.dosage} • Form: {medicine.form}
+Principio Activo: {medicine.active_ingredient}
+Dosis: {medicine.dosage} • Forma: {medicine.form}
{error &&e.stopPropagation()}>{error}
}Loading pharmacies...
+Cargando farmacias...
No pharmacies found selling this medicine
+No se encontraron farmacias con este medicamento
Loading…
} + {loading &&Cargando…
} {!loading && error &&{error}
} {!loading && !error && items.length === 0 && (- No saved notifications yet. Tap the 🔕 bell on an out-of-stock pharmacy to get notified when it's restocked. + Aún no hay notificaciones guardadas. Toca la campana 🔕 en una farmacia sin stock para recibir notificaciones cuando se reponga.
)} {!loading && !error && items.length > 0 && ( @@ -77,7 +77,7 @@ function SavedNotifications({ onClose }) { {item.scope === 'pharmacy' ? ( <> - 🏥 {item.pharmacy_name || `Pharmacy #${item.pharmacy_id}`} + 🏥 {item.pharmacy_name || `Farmacia #${item.pharmacy_id}`} {item.pharmacy_address && ( {item.pharmacy_address} @@ -85,7 +85,7 @@ function SavedNotifications({ onClose }) { > ) : ( - Any pharmacy + Cualquier farmacia )}
+
)}
Please enter your credentials to access the admin panel
+Introduce tus credenciales para acceder al panel de administración