How niranjanmkiran-crypto/hemapulse-ai works
HemaPulse AI is a hospital blood-inventory and demand decision-support platform. Hospital staff use the web app to review stock, forecasts, shortage/expiry risks, alerts and recommendations, then perform inventory or emergency actions through the API. The backend routes coordinate forecasting and decision engines over seeded in-memory operational data. The README documents additional scenario simulation, explainable recommendations and FEFO workflows; unsampled implementations are represented only where the tree and documented capabilities support them. Some UI-to-API links are evidenced by the sampled client endpoints and component references; deeper behavior of unsampled routes is not inferred.
Main entry points: App.tsx App Shell · routes.py API Routes · client.ts API Client · seed_data.py In-Memory Store
Components 22
Staff Web App
- App Shell
frontend/src/App.tsx - Decision Overview
frontend/src/components/dashboard/DecisionOverview.tsx - Demand Forecast
frontend/src/components/forecast/DemandForecastView.tsx - Inventory FEFO
frontend/src/components/inventory/InventoryFefoView.tsx - Shortage Radar
frontend/src/components/shortage/ShortageExpiryRadar.tsx - Emergency Center
frontend/src/components/emergency/EmergencyCenter.tsx - Recommendations
frontend/src/components/recommendations/RecommendationsView.tsx - Alerts
frontend/src/components/alerts/AlertsView.tsx - Reports
frontend/src/components/reports/ReportsView.tsx
API & Contracts
- API Client
frontend/src/api/client.ts - FastAPI App
backend/app/main.py - API Routes
backend/app/api/routes.py - API Schemas
backend/app/models/schemas.py
Decision Engines
- ML Forecasting
backend/app/services/ml_forecasting.py - Shortage Engine
backend/app/services/shortage_engine.py - Emergency & Anomaly
backend/app/services/emergency_engine.py - Expiry & FEFO
backend/app/services/expiry_engine.py - Recommendation Engine
backend/app/services/recommendation_engine.py
Domain & State
- Blood Domain
backend/app/models/domain.py - In-Memory Store
backend/app/services/seed_data.py - App Configuration
backend/app/core/config.py
Other components
- Hospital Staff
Connections 36
- Hospital Staff → App Shell: uses
README.md - App Shell → Decision Overview: renders
frontend/src/App.tsx - App Shell → Demand Forecast: renders
frontend/src/App.tsx - App Shell → Inventory FEFO: renders
frontend/src/App.tsx - App Shell → Shortage Radar: renders
frontend/src/App.tsx - App Shell → Emergency Center: renders
frontend/src/App.tsx - App Shell → Recommendations: renders
frontend/src/App.tsx - App Shell → Alerts: renders
frontend/src/App.tsx - App Shell → Reports: renders
frontend/src/App.tsx - App Shell → API Client: loads overview
frontend/src/App.tsx - Demand Forecast → API Client: requests forecast
frontend/src/components/forecast/DemandForecastView.tsx - Inventory FEFO → API Client: requests inventory
frontend/src/components/inventory/InventoryFefoView.tsx - Shortage Radar → API Client: requests risks
frontend/src/components/shortage/ShortageExpiryRadar.tsx - Emergency Center → API Client: declares incident
frontend/src/components/emergency/EmergencyCenter.tsx - Recommendations → API Client: requests actions
frontend/src/components/recommendations/RecommendationsView.tsx - Alerts → API Client: requests alerts
frontend/src/components/alerts/AlertsView.tsx - Reports → API Client: requests reports
frontend/src/components/reports/ReportsView.tsx - API Client → API Routes: calls API
frontend/src/api/client.ts - FastAPI App → API Routes: mounts routes
backend/app/main.py - FastAPI App → In-Memory Store: initializes data
backend/app/main.py - FastAPI App → ML Forecasting: warms model
backend/app/main.py - FastAPI App → App Configuration: reads settings
backend/app/main.py - API Routes → In-Memory Store: reads and writes
backend/app/api/routes.py - API Routes → ML Forecasting: requests forecasts
backend/app/api/routes.py - API Routes → Shortage Engine: evaluates shortage
backend/app/api/routes.py - API Routes → Emergency & Anomaly: handles incidents
backend/app/api/routes.py - API Routes → Expiry & FEFO: gets expiry status
backend/app/api/routes.py - API Routes → Recommendation Engine: gets and executes
backend/app/api/routes.py - ML Forecasting → In-Memory Store: reads demand data
backend/app/services/ml_forecasting.py - Shortage Engine → In-Memory Store: reads inventory
backend/app/services/shortage_engine.py - Emergency & Anomaly → In-Memory Store: updates incident state
backend/app/services/emergency_engine.py - Expiry & FEFO → In-Memory Store: ranks expiring stock
backend/app/services/expiry_engine.py - Recommendation Engine → In-Memory Store: records actions
backend/app/services/recommendation_engine.py - API Schemas → Blood Domain: uses types
backend/app/models/schemas.py - In-Memory Store → Blood Domain: seeds domain data
backend/app/services/seed_data.py - API Routes → API Schemas: validates responses
backend/app/api/routes.py