How eugene234466/drugsync works
DrugSync is a FastAPI REST API for AI-generated drug information, pairwise interaction checks, and patient safety analysis. A client submits a request to an API route, which uses typed request/response schemas and obtains an AI result; the drug-information and interaction routes first check the in-memory TTL cache. The safety route validates that at least two drugs were supplied. Shared dependency providers expose the Groq service and cache. README capabilities are represented, though only sampled routes and services are described here; configuration and app wiring are shown from their excerpts.
Main entry points: groq_service.py Groq prompts and client · main.py FastAPI app · drugs.py Drug information · interactions.py Interaction check
Components 11
API layer
- FastAPI app
src/backend/main.py - API schemas
src/backend/models.py
Clinical analyses
- Drug information
src/backend/routers/drugs.py - Interaction check
src/backend/routers/interactions.py - Patient safety
src/backend/routers/safety.py
Shared services
- Dependency providers
src/backend/dependencies.py - Groq prompts and client
src/backend/services/groq_service.py - TTL memory cache
src/backend/services/cache_service.py - Settings
src/backend/config.py
Other components
- API client
- Groq API
Connections 21
- API client → FastAPI app: sends requests
README.md - FastAPI app → Drug information: registers routes
src/backend/main.py - FastAPI app → Interaction check: registers routes
src/backend/main.py - FastAPI app → Patient safety: registers routes
src/backend/main.py - FastAPI app → Settings: configures title
src/backend/main.py - Drug information → API schemas: uses schemas
src/backend/routers/drugs.py - Interaction check → API schemas: uses schemas
src/backend/routers/interactions.py - Patient safety → API schemas: uses schemas
src/backend/routers/safety.py - Drug information → Dependency providers: requests providers
src/backend/routers/drugs.py - Interaction check → Dependency providers: requests providers
src/backend/routers/interactions.py - Patient safety → Dependency providers: requests provider
src/backend/routers/safety.py - Dependency providers → Groq prompts and client: provides service
src/backend/dependencies.py - Dependency providers → TTL memory cache: provides cache
src/backend/dependencies.py - Drug information → TTL memory cache: checks and stores
src/backend/routers/drugs.py - Interaction check → TTL memory cache: checks and stores
src/backend/routers/interactions.py - Drug information → Groq prompts and client: requests drug info
src/backend/routers/drugs.py - Interaction check → Groq prompts and client: checks interaction
src/backend/routers/interactions.py - Patient safety → Groq prompts and client: analyzes safety
src/backend/routers/safety.py - Groq prompts and client → Groq API: sends prompts
src/backend/services/groq_service.py - Groq prompts and client → Settings: reads credentials
src/backend/services/groq_service.py - TTL memory cache → Settings: reads TTL default
src/backend/services/cache_service.py