Intelligent Pharmacist API
Let's make it happen, Dr. Mostafa Abd-el-Kader πΌπ
PharmaIntel API is a production-ready RESTful service providing pharmaceutical intelligence including drug interactions, FDA recalls, and WHO health articles. Built with security best practices and ready for deployment to Google Cloud Run.
- π Security-First: Helmet, CORS, rate limiting
- π Drug Interactions: Check interactions using DrugBank API
- π¨ FDA Recalls: Query drug recalls from OpenFDA
- π WHO Articles: Fetch WHO Global Health Observatory articles
- β Health Monitoring: Built-in health check endpoint
- π³ Docker Ready: Containerized for easy deployment
- βοΈ Cloud Native: CI/CD pipeline for Google Cloud Run
# Configure npm to use GitHub Packages for @ELMOURABEA scope
echo "@elmourabea:registry=https://npm.pkg.github.com" >> .npmrc
# Install the package (requires GitHub authentication)
npm install @elmourabea/pharmaintel-api# Pull the latest image
docker pull ghcr.io/elmourabea/pharmaintel-api:latest
# Run the container
docker run -p 3000:3000 -e DRUGBANK_API_KEY=your_key ghcr.io/elmourabea/pharmaintel-api:latest-
Install dependencies
npm install
-
Set up environment
cp .env.example .env # Edit .env and add your DRUGBANK_API_KEY -
Start the server
npm start # or for development with auto-reload npm run dev
The API will be available at http://localhost:3000
# Build and run with Docker Compose
docker-compose up -d
# Or build and run manually
docker build -t pharmaintel-api .
docker run -p 3000:3000 -e DRUGBANK_API_KEY=your_key pharmaintel-apiGET /healthReturns service status and version information.
POST /api/interactions
Content-Type: application/json
{
"drugs": ["drugA", "drugB"]
}Checks drug interactions using DrugBank API.
GET /api/recalls?ingredient=ibuprofenRetrieves FDA drug recall information.
GET /api/whoFetches WHO Global Health Observatory articles.
This API is ready to publish to market! See NEXT_STEPS.md for a quick start guide.
For detailed information on publishing to package registries and marketplaces, see PUBLISHING.md.
This repository includes automated deployment to Google Cloud Run via GitHub Actions.
- Create a Google Cloud project
- Enable Cloud Run, Artifact Registry, Secret Manager
- Create an Artifact Registry repository named "pharmaintel"
- Add DRUGBANK_API_KEY to Secret Manager
- Create a service account with permissions:
- Cloud Run Admin
- Artifact Registry Writer
- Secret Manager Secret Accessor
Configure these secrets in your GitHub repository:
GCP_PROJECT_ID: Your GCP project IDGCP_REGION: Deployment region (e.g., europe-west1)GCP_SA_KEY: Service account JSON key (full JSON credentials file content)
Push a version tag to trigger deployment:
git tag v1.0.0
git push origin v1.0.0Or manually trigger via GitHub Actions.
| Variable | Required | Description |
|---|---|---|
PORT |
No | Server port (default: 3000) |
DRUGBANK_API_KEY |
Yes | DrugBank API authentication key |
# Run tests
npm test
# Test health endpoint
BASE_URL=http://localhost:3000 npm test- Helmet: Sets secure HTTP headers
- CORS: Configured for public access (adjust as needed)
- Rate Limiting: 60 requests per minute per IP
- Input Validation: All endpoints validate inputs
- Error Handling: No sensitive data in error responses
origin: '*' for public API access. Restrict this in production if needed.
pharmaintel-api/
βββ app.js # Main application
βββ routes/
β βββ interactions.js # Drug interactions endpoint
β βββ recalls.js # FDA recalls endpoint
β βββ who.js # WHO articles endpoint
βββ services/
β βββ drugBankService.js # DrugBank API integration
β βββ openFdaService.js # OpenFDA API integration
β βββ whoService.js # WHO API integration
βββ tests/
β βββ health.test.js # Health endpoint tests
βββ .github/workflows/
β βββ deploy-cloudrun.yml # CI/CD pipeline
βββ Dockerfile # Container definition
βββ docker-compose.yml # Local development
βββ .env.example # Environment template
Copyright 2025 @ DR. Mostafa ELMOURABEA
(Full thanks to ALLAH)
Powered by COPILOT TO ACHIEVE β DR / MOSTAFA ABD-EL-KADER β IDEA @2025
Pharmacy AI-BOT by Mostafa Elmourabea is marked CC0 1.0