WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

ELMOURABEA/pharmaintel-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PharmaIntel API

Intelligent Pharmacist API
Let's make it happen, Dr. Mostafa Abd-el-Kader πŸ’ΌπŸ’Š

Overview

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.

Features

  • πŸ”’ 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

Installation

Via GitHub Packages (NPM)

# 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

Via Docker (GitHub Container Registry)

# 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

Quick Start

Local Development

  1. Install dependencies

    npm install
  2. Set up environment

    cp .env.example .env
    # Edit .env and add your DRUGBANK_API_KEY
  3. Start the server

    npm start
    # or for development with auto-reload
    npm run dev

The API will be available at http://localhost:3000

Docker

# 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-api

API Endpoints

Health Check

GET /health

Returns service status and version information.

Drug Interactions

POST /api/interactions
Content-Type: application/json

{
  "drugs": ["drugA", "drugB"]
}

Checks drug interactions using DrugBank API.

FDA Recalls

GET /api/recalls?ingredient=ibuprofen

Retrieves FDA drug recall information.

WHO Articles

GET /api/who

Fetches WHO Global Health Observatory articles.

Publishing

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.

Deployment

Google Cloud Run

This repository includes automated deployment to Google Cloud Run via GitHub Actions.

Prerequisites

  1. Create a Google Cloud project
  2. Enable Cloud Run, Artifact Registry, Secret Manager
  3. Create an Artifact Registry repository named "pharmaintel"
  4. Add DRUGBANK_API_KEY to Secret Manager
  5. Create a service account with permissions:
    • Cloud Run Admin
    • Artifact Registry Writer
    • Secret Manager Secret Accessor

GitHub Secrets

Configure these secrets in your GitHub repository:

  • GCP_PROJECT_ID: Your GCP project ID
  • GCP_REGION: Deployment region (e.g., europe-west1)
  • GCP_SA_KEY: Service account JSON key (full JSON credentials file content)

Deploy

Push a version tag to trigger deployment:

git tag v1.0.0
git push origin v1.0.0

Or manually trigger via GitHub Actions.

Environment Variables

Variable Required Description
PORT No Server port (default: 3000)
DRUGBANK_API_KEY Yes DrugBank API authentication key

Testing

# Run tests
npm test

# Test health endpoint
BASE_URL=http://localhost:3000 npm test

Security

  • 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

⚠️ Note: CORS is set to origin: '*' for public API access. Restrict this in production if needed.

Project Structure

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

License & Credits

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

About

Intelligent pharmacist

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •