How seshasai7d7-source/mediflow-pharmacy-platform works
MediFlow is a pharmacy platform where customers authenticate, browse medicines and submit prescriptions; pharmacists review prescription details (with AI extraction as an unapproved draft), then manage resulting orders and refills. The frontend routes users to role-specific screens and calls a FastAPI API; backend services apply workflow and inventory rules and persist state in PostgreSQL. Edges reflect sampled imports/calls or README-documented capabilities; unsampled router and page internals are not asserted beyond those documented relationships.
Main entry points: api.ts HTTP API Client · App.tsx Route Application · database.py PostgreSQL Session Layer · order_service.py Order Workflow
Components 26
Customer and Staff UI
- Route Application
frontend/src/App.tsx - Session Context
frontend/src/auth/AuthContext.tsx - Medicine Catalogue
frontend/src/pages/MedicineCataloguePage.tsx - Prescription Submission
frontend/src/pages/MyPrescriptionsPage.tsx - Pharmacist Review
frontend/src/pages/PharmacistReviewPage.tsx - Order Screens
frontend/src/pages/OrderManagementPage.tsx - Refill Screens
frontend/src/pages/CustomerRefillsPage.tsx - Admin Screens
frontend/src/pages/admin/AdminStoresPage.tsx
API and Identity
- HTTP API Client
frontend/src/lib/api.ts - Authentication API
backend/app/api/v1/auth.py - Token and Password Security
backend/app/core/security.py
Prescription Workflow
- Prescription API
backend/app/api/v1/prescriptions.py - Pharmacist API
backend/app/api/v1/pharmacist.py - Gemini Extraction
backend/app/services/gemini_extraction.py - Prescription Document Storage
backend/app/services/prescription_storage.py
Inventory and Orders
- Inventory API
backend/app/api/v1/inventory.py - Inventory Rules
backend/app/services/inventory_service.py - Orders API
backend/app/api/v1/orders.py - Order Workflow
backend/app/services/order_service.py - Refills API
backend/app/api/v1/refills.py - Refill Workflow
backend/app/services/refill_service.py
Persistence and Admin
- Administration API
backend/app/api/v1/admin.py - PostgreSQL Session Layer
backend/app/db/database.py - Domain Models
backend/app/models/__init__.py - Application Configuration
backend/app/core/config.py
Other components
- Customer / Staff
Connections 36
- Customer / Staff → Route Application: uses
README.md - Route Application → Session Context: provides session
frontend/src/App.tsx - Route Application → Prescription Submission: routes to
frontend/src/App.tsx - Route Application → Pharmacist Review: routes to
frontend/src/App.tsx - Route Application → Order Screens: routes to
frontend/src/App.tsx - Route Application → Refill Screens: routes to
frontend/src/App.tsx - Route Application → Admin Screens: routes to
frontend/src/App.tsx - Session Context → HTTP API Client: calls
frontend/src/auth/AuthContext.tsx - Session Context → Authentication API: authenticates via
README.md - Medicine Catalogue → HTTP API Client: requests catalogue
README.md - Prescription Submission → HTTP API Client: submits documents
README.md - Pharmacist Review → HTTP API Client: sends decision
frontend/src/pages/PharmacistReviewPage.tsx - Order Screens → HTTP API Client: manages orders
frontend/src/lib/api.ts - Refill Screens → HTTP API Client: manages refills
frontend/src/lib/api.ts - Admin Screens → HTTP API Client: requests admin data
frontend/src/pages/admin/AdminStoresPage.tsx - HTTP API Client → Prescription API: calls endpoints
README.md - HTTP API Client → Pharmacist API: calls endpoints
README.md - HTTP API Client → Inventory API: calls endpoints
README.md - HTTP API Client → Orders API: calls endpoints
frontend/src/lib/api.ts - HTTP API Client → Refills API: calls endpoints
frontend/src/lib/api.ts - HTTP API Client → Administration API: calls endpoints
frontend/src/lib/api.ts - Authentication API → Token and Password Security: uses hashing and tokens
backend/app/api/v1/auth.py - Authentication API → PostgreSQL Session Layer: queries users
backend/app/api/v1/auth.py - Prescription API → Prescription Document Storage: stores documents
- Prescription API → Gemini Extraction: requests draft extraction
- Pharmacist API → Gemini Extraction: uses draft data
README.md - Inventory API → Inventory Rules: applies inventory rules
- Orders API → Order Workflow: runs order workflow
- Order Workflow → Inventory Rules: calculates distance
backend/app/services/order_service.py - Refills API → Refill Workflow: runs refill workflow
- Order Workflow → PostgreSQL Session Layer: reads and writes
backend/app/services/order_service.py - Inventory Rules → PostgreSQL Session Layer: reads and updates
backend/app/services/inventory_service.py - Refill Workflow → Order Workflow: creates related orders
backend/app/services/refill_service.py - PostgreSQL Session Layer → Application Configuration: gets database settings
backend/app/db/database.py - Administration API → PostgreSQL Session Layer: manages persisted records
- PostgreSQL Session Layer → Domain Models: maps domain records