How dweenmd/pharmadaily works
PharmaDaily is a multi-branch pharmacy management PWA. Staff sign in, work within a branch, and complete operational tasks such as selling medicines, receiving purchases, managing stock, and transferring inventory; those records feed cash, customer/supplier balances, dashboards, and reports. The README documents database-enforced branch isolation and transactional sale, purchase, adjustment, and transfer behavior. The source index shows key page-to-feature and client-to-action/query links; unsampled subsystems are represented at their existing feature paths, without assuming internal call wiring.
Main entry points: page.tsx Dashboard · pos-terminal.tsx Point of sale · queries.ts Supplier accounts · expenses-client.tsx Expenses
Components 26
Access and shell
- Sign in
src/app/(auth)/login/page.tsx - Protected workspace
src/app/(protected)/layout.tsx - Authentication
src/features/auth/actions.ts - Staff and permissions
src/features/staff - Branch settings
src/features/settings - Shared UI primitives
src/components/ui/button.tsx - Branch management
src/features/branches/queries.ts
Pharmacy operations
- Medicine catalog
src/features/medicines - Point of sale
src/features/sales/components/pos-terminal.tsx - Sales processing
src/features/sales/actions.ts - Purchasing
src/features/purchases - Stock management
src/features/stock/queries.ts - Branch transfers
src/features/transfers - Customer accounts
src/features/customers - Supplier accounts
src/features/suppliers/queries.ts
Finance and insight
- Dashboard
src/app/(protected)/dashboard/page.tsx - Till and cash
src/features/cash - Expenses
src/features/expenses/components/expenses-client.tsx - Reports
src/features/reports
Data and resilience
- Audit trail
src/features/audit - Notifications
src/features/notifications - Offline queue and sync
src/lib/offline/db.ts - Supabase database
- Cookie-bound server client
src/lib/supabase/server.ts - Database types
src/types/database.types.ts
Other components
- Pharmacy staff
Connections 27
- Pharmacy staff → Sign in: signs in
src/app/(auth)/login/page.tsx - Sign in → Authentication: uses form
src/app/(auth)/login/page.tsx - Pharmacy staff → Protected workspace: uses
- Protected workspace → Dashboard: opens
- Dashboard → Stock management: reads
src/app/(protected)/dashboard/page.tsx - Dashboard → Reports: reads
src/app/(protected)/dashboard/page.tsx - Dashboard → Branch management: reads
src/app/(protected)/dashboard/page.tsx - Point of sale → Sales processing: submits sale
- Sales processing → Supabase database: records transaction
README.md - Purchasing → Supabase database: records purchase
README.md - Stock management → Supabase database: adjusts stock
README.md - Branch transfers → Supabase database: moves stock
README.md - Customer accounts → Supabase database: stores accounts
- Supplier accounts → Supabase database: stores balances
- Till and cash → Supabase database: reads till data
- Expenses → Supabase database: records expenses
- Reports → Supabase database: queries metrics
- Staff and permissions → Supabase database: manages staff
- Branch settings → Supabase database: stores settings
- Audit trail → Supabase database: reads audit log
- Notifications → Supabase database: reads notifications
- Cookie-bound server client → Supabase database: queries as user
src/lib/supabase/server.ts - Cookie-bound server client → Database types: types client
src/lib/supabase/server.ts - Offline queue and sync → Supabase database: syncs queued work
README.md - Point of sale → Medicine catalog: selects medicines
- Expenses → Supabase database: creates expense
src/features/expenses/components/expenses-client.tsx - Supplier accounts → Customer accounts: reuses payment dialog
src/features/suppliers/components/suppliers-client.tsx