You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User login after client key: JWT in Authorization: Bearer <access_token>. Both web and mobile get it by signing in with Supabase Auth and then calling POST /api/auth/supabase.
Infrastructure & deploy (not in app runtime)
Secret / setting
Used for
AZURE_CREDENTIALS (GitHub)
Backend deploy workflow
AZURE_SWA_DEPLOYMENT_TOKEN (GitHub)
Frontend deploy to Static Web Apps
ACR admin password
Pull acrmedscan.azurecr.io/medscan-api on App Service
DATABASE_URL
PostgreSQL connection string (production)
CORS_ORIGINS
Allowed web origins (SWA URL)
REDIS_URL
Optional cache / queues
MEDSCAN_SMTP_*
Email reminders
SCRAPER_PROXY_URL
Optional pharmacy scrape proxy
HTTP headers
Header
When
X-Medscan-Api-Key
Required on most /api/* routes when MEDSCAN_CLIENT_API_KEYS is set
# Generate client API key
cd medscan\backend
.\venv\Scripts\python.exe scripts\generate_client_api_key.py
# Check backend config (no secrets printed)
.\venv\Scripts\python.exe scripts\check_setup.py
# Mobile (production)
cd medscan\mobile
flutter run --dart-define=API_BASE_URL=https://medscan-api.azurewebsites.net --dart-define=MEDSCAN_API_KEY=<from API_KEYS.local.md># Web production build
cd medscan\frontend
$env:VITE_API_URL="https://medscan-api.azurewebsites.net"$env:VITE_MEDSCAN_API_KEY="<from API_KEYS.local.md>"
npm run build
Azure CLI — set backend app settings
# Client API key
az webapp config appsettings set -g rg-medscan -n medscan-api --settings `
MEDSCAN_CLIENT_API_KEYS="<your-client-key>"# Option C — Azure OpenAI medicine filter (paste your key; do not commit)
az webapp config appsettings set -g rg-medscan -n medscan-api --settings `
MEDSCAN_LLM_MEDICINE_FILTER=1`
MEDSCAN_LLM_PROVIDER=azure `
MEDSCAN_LLM_MEDICINE_MODE=merge `
AZURE_OPENAI_API_BASE="https://medmxlabs-openai.openai.azure.com/openai/deployments/gpt-4.1-mini"`
AZURE_OPENAI_API_KEY="<your-azure-openai-key>"`
AZURE_OPENAI_MODEL=gpt-4.1-mini `
AZURE_OPENAI_API_VERSION=2024-08-01-preview
File map
medscan/
├── .env # Root secrets (optional; backend loads this too)
├── backend/.env # Primary backend secrets
├── frontend/.env # Vite secrets (VITE_*)
├── docs/
│ ├── API_KEYS.md # This file (safe to commit)
│ ├── API_KEYS.local.md # YOUR values (gitignored)
│ └── API_KEYS.local.md.example # Template to copy
└── mobile/ # No .env — use dart-define