How kaela122/pharmacy-inventory-recognizer works
PharmaHub combines pharmacy inventory operations with a product-code DFA recognizer. Staff use the React screens to manage medicines, categories, suppliers, purchase orders, stock movements, analytics, and users; medicine creation checks its SKU before saving. The FastAPI backend exposes these capabilities over the API and persists them through SQLAlchemy. The README documents the full automata-construction and theory experience; source excerpts show product validation and application setup, but not most route-to-service wiring, so those links are omitted or marked unverified.
Main entry points: index.ts API client · pages Operations screens · routes API routes · recognizer.py SKU recognizer
Components 21
Staff interface
- React app shell
pharmacy-inventory-recognizer/frontend/src/App.tsx - Operations screens
pharmacy-inventory-recognizer/frontend/src/pages - API client
pharmacy-inventory-recognizer/frontend/src/api/index.ts - Browser auth state
pharmacy-inventory-recognizer/frontend/src/lib/auth.ts
Backend API
- FastAPI app
pharmacy-inventory-recognizer/backend/app/main.py - API routes
pharmacy-inventory-recognizer/backend/app/api/routes - Authentication
pharmacy-inventory-recognizer/backend/app/services/auth_service.py - Token security
pharmacy-inventory-recognizer/backend/app/core/security.py
Inventory domain
- Product management
pharmacy-inventory-recognizer/backend/app/services/product_service.py - Inventory services
pharmacy-inventory-recognizer/backend/app/services - Inventory records
pharmacy-inventory-recognizer/backend/app/models - SQL database
pharmacy-inventory-recognizer/backend/app/db/session.py - Runtime settings
pharmacy-inventory-recognizer/backend/app/core/config.py - Demo data setup
pharmacy-inventory-recognizer/backend/app/db/seed.py
Code recognition
- SKU language
pharmacy-inventory-recognizer/backend/app/automata/definitions.py - DFA construction
pharmacy-inventory-recognizer/backend/app/automata/construction.py - DFA execution
pharmacy-inventory-recognizer/backend/app/automata/dfa.py - SKU recognizer
pharmacy-inventory-recognizer/backend/app/automata/recognizer.py - Theory walkthrough
pharmacy-inventory-recognizer/frontend/src/pages/TheoryPage.tsx - CLI simulator
pharmacy-inventory-recognizer/cli/simulator.py
Other components
- Pharmacy staff
Connections 21
- Pharmacy staff → React app shell: uses
README.md - React app shell → Operations screens: selects
pharmacy-inventory-recognizer/frontend/src/App.tsx - Operations screens → API client: requests
pharmacy-inventory-recognizer/frontend/src/api/index.ts - API client → Browser auth state: loads token
pharmacy-inventory-recognizer/frontend/src/api/index.ts - API client → API routes: calls API
- FastAPI app → API routes: registers
pharmacy-inventory-recognizer/backend/app/main.py - API routes → Authentication: login handler
pharmacy-inventory-recognizer/backend/app/api/routes/auth.py - Authentication → Token security: verifies and signs
pharmacy-inventory-recognizer/backend/app/services/auth_service.py - Product management → SKU recognizer: validates SKU
pharmacy-inventory-recognizer/backend/app/services/product_service.py - Product management → Inventory records: reads and writes
pharmacy-inventory-recognizer/backend/app/services/product_service.py - Inventory services → Inventory records: uses records
pharmacy-inventory-recognizer/backend/app/services/auth_service.py - FastAPI app → Demo data setup: seeds startup
pharmacy-inventory-recognizer/backend/app/main.py - Demo data setup → SQL database: opens session
pharmacy-inventory-recognizer/backend/app/db/seed.py - SQL database → Runtime settings: reads URL
pharmacy-inventory-recognizer/backend/app/db/session.py - DFA construction → SKU language: builds from
pharmacy-inventory-recognizer/backend/app/automata/construction.py - DFA execution → SKU language: uses definition
pharmacy-inventory-recognizer/backend/app/automata/dfa.py - SKU recognizer → DFA execution: runs
pharmacy-inventory-recognizer/backend/app/automata/recognizer.py - Operations screens → Theory walkthrough: opens walkthrough
- Theory walkthrough → API client: fetches theory
pharmacy-inventory-recognizer/frontend/src/api/index.ts - CLI simulator → DFA construction: demonstrates build
pharmacy-inventory-recognizer/cli/simulator.py - CLI simulator → SKU recognizer: simulates codes
pharmacy-inventory-recognizer/cli/simulator.py