A production-ready full-stack application for searching and enriching healthcare provider information using the NPPES NPI Registry API and web search capabilities.
- Frontend: React + Vite + TypeScript + Tailwind CSS
- Backend: Python FastAPI with Hugging Face Smolagents framework
- Clean Architecture: Modular design with separation of concerns
- Search healthcare providers using NPPES NPI Registry
- Web enrichment via SearXNG for additional provider information
- Caching for improved performance
- Rate limiting for API protection
- Structured logging
- Modern, responsive UI
- Navigate to the backend directory:
cd backend- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the backend directory (or root) with your configuration:
cp ../.env.example .env
# Edit .env with your API keys- Run the backend server:
uvicorn main:app --reloadThe API will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Run the development server:
npm run devThe frontend will be available at http://localhost:5173
Key environment variables:
GROK_API_KEY: Required for Grok AI functionality (xAI API key)OPENAI_API_KEYorHF_TOKEN: Optional alternative LLM providersSEARXNG_URL: SearXNG instance URL (default: https://searxng.site)NPPES_BASE_URL: NPPES API base URL (default: https://npiregistry.cms.hhs.gov/api)CACHE_TTL_SECONDS: Cache TTL in seconds (default: 300)RATE_LIMIT_PER_MINUTE: Rate limit per IP (default: 60)
GET /api/health- Health checkPOST /api/search/providers- Search for providers
{
"first_name": "John",
"last_name": "Doe",
"city": "New York",
"state": "NY",
"taxonomy": "Internal Medicine",
"limit": 10
}backend/
app/
domain/ # Domain entities
application/ # Use cases
infrastructure/ # External adapters (NPPES, SearXNG, cache, http)
interfaces/ # API routes and schemas
agents/ # Smolagents tools and coordinator
main.py # FastAPI application entry point
frontend/
src/
components/ # Reusable UI components
features/ # Feature-based pages
api/ # API client
types/ # TypeScript type definitions
Backend tests (to be implemented):
cd backend
pytest- Backend uses structured logging via
structlog - Frontend uses React Query for data fetching and caching
- Both frontend and backend support hot reload in development mode
MIT