How eldasoky1/eco-pharma works
Smart Eco-Pharma Hub is a pharmacy operations platform: staff use its dashboard to manage medicines and stock, monitor cold-chain conditions, and assess drug risks; AI agents can query selected information through MCP. The React frontend is served by a FastAPI backend, with domain services and repositories accessing Supabase, while pharmacovigilance uses an external model provider. The README documents the broader capabilities, but several routers and services were not sampled, so their internal call paths are not expanded here.
Main entry points: App.tsx Dashboard app · api.ts Frontend API client · database.py Supabase clients · pv_service.py Pharmacovigilance service
Components 28
Pharmacy dashboard
- Dashboard app
frontend/src/App.tsx - App state
frontend/src/context/AppContext.tsx - Authentication UI
frontend/src/views/AuthView.tsx - Brand identity
frontend/src/components/BrandLogo.tsx - Operations dashboard
frontend/src/views/DashboardView.tsx - Inventory views
frontend/src/views/InventoryCatalogueView.tsx - Interaction tools
frontend/src/views/InteractionCheckerView.tsx - Pharmacovigilance UI
frontend/src/views/AIPharmacovigilanceView.tsx - Sensor monitoring
frontend/src/views/LiveSensorsView.tsx - Frontend API client
frontend/src/api.ts
API and services
- FastAPI application
smart_eco_pharma/main.py - Authentication routes
smart_eco_pharma/routers/auth.py - IoT ingestion routes
smart_eco_pharma/routers/iot_ingestion.py - Inventory service
smart_eco_pharma/services/inventory_service.py - IoT service
smart_eco_pharma/services/iot_service.py - Authentication service
smart_eco_pharma/services/auth_service.py
Data access
- Inventory repository
smart_eco_pharma/repositories/inventory_repository.py - Sensor repository
smart_eco_pharma/repositories/iot_repository.py - Drug repository
smart_eco_pharma/repositories/drug_repository.py - Interaction repository
smart_eco_pharma/repositories/interaction_repository.py - Supabase clients
smart_eco_pharma/database.py
Risk analysis and agents
- Pharmacovigilance service
smart_eco_pharma/services/pv_service.py - MCP server
smart_eco_pharma/mcp_server/server.py
Other components
- Pharmacy staff
- AI agents
- IoT sensors
- Supabase database
- OpenRouter model API
Connections 33
- Pharmacy staff → Dashboard app: uses
README.md - Dashboard app → App state: provides state
frontend/src/App.tsx - Dashboard app → Operations dashboard: renders
frontend/src/App.tsx - Dashboard app → Inventory views: renders
frontend/src/App.tsx - Dashboard app → Interaction tools: renders
frontend/src/App.tsx - Dashboard app → Pharmacovigilance UI: renders
frontend/src/App.tsx - Dashboard app → Sensor monitoring: renders
frontend/src/App.tsx - Dashboard app → Authentication UI: renders
frontend/src/App.tsx - Authentication UI → Frontend API client: requests auth
frontend/src/views/AuthView.tsx - App state → Frontend API client: calls
frontend/src/context/AppContext.tsx - Frontend API client → FastAPI application: calls API
README.md - FastAPI application → Authentication routes: registers
smart_eco_pharma/main.py - FastAPI application → IoT ingestion routes: registers
smart_eco_pharma/main.py - IoT sensors → IoT ingestion routes: sends readings
README.md - IoT ingestion routes → IoT service: invokes
smart_eco_pharma/routers/iot_ingestion.py - IoT service → Sensor repository: uses
smart_eco_pharma/services/iot_service.py - IoT service → Inventory repository: updates stock
smart_eco_pharma/services/iot_service.py - Inventory service → Inventory repository: uses
smart_eco_pharma/services/inventory_service.py - Inventory repository → Supabase clients: uses clients
smart_eco_pharma/repositories/inventory_repository.py - Sensor repository → Supabase clients: uses clients
smart_eco_pharma/repositories/iot_repository.py - Drug repository → Supabase clients: uses clients
smart_eco_pharma/repositories/drug_repository.py - Interaction repository → Supabase clients: uses clients
smart_eco_pharma/repositories/interaction_repository.py - Supabase clients → Supabase database: connects
smart_eco_pharma/database.py - Authentication routes → Authentication service: uses
smart_eco_pharma/routers/auth.py - Authentication service → Supabase database: manages accounts
smart_eco_pharma/services/auth_service.py - Pharmacovigilance UI → Frontend API client: submits analysis
README.md - Frontend API client → Pharmacovigilance service: requests assessment
README.md - Pharmacovigilance service → Drug repository: reads drug data
smart_eco_pharma/services/pv_service.py - Pharmacovigilance service → Interaction repository: reads interactions
smart_eco_pharma/services/pv_service.py - Pharmacovigilance service → OpenRouter model API: requests analysis
README.md - AI agents → MCP server: queries tools
README.md - MCP server → Interaction repository: queries interactions
- MCP server → Inventory repository: queries inventory