How msmrfq/pharmnos-lite works
Pharmnos Lite is a pharmacy-management and financial-records application: users manage inventory, customers, suppliers, purchases, sales and billing, then review reports and exports. The sampled inventory page demonstrates a server-rendered tenant-scoped workflow: establish tenant context, query products, batches and stock movements through repositories, and present results in the dashboard. The tree also shows GST, payments, audit and settings capabilities. Several of those modules were not sampled, so their internal call paths are not asserted; dashed, uncited edges indicate unverified architectural relationships.
Main entry points: index.ts Repository factory · tenant-context.ts Tenant context · prisma.ts Prisma database client · page.tsx Inventory workspace
Components 22
Application experience
- Dashboard shell
src/components/layout/dashboard-layout.tsx - Inventory workspace
src/app/inventory/page.tsx - Sales and billing
src/app/billing/page.tsx - Purchasing
src/app/purchases/page.tsx - Business records
src/app/customers/page.tsx - Reports and exports
src/app/reports/page.tsx - Business settings
src/app/settings/page.tsx
Business workflows
- GST calculations
src/domain/services/gst-calculator.service.ts - Aging reports
src/domain/services/aging-report.service.ts - Financial reconciliation
src/domain/services/financial-reconciliation.service.ts - Exact decimal arithmetic
src/lib/decimal.ts
Tenant data layer
- Ledger storage
src/repositories/ledger.repository.ts - Sales invoice storage
src/repositories/sales-invoice.repository.ts - Payment storage
src/repositories/payment.repository.ts - Repository factory
src/repositories/index.ts - Repository base
src/lib/db/base-repository.ts - Prisma database client
src/lib/db/prisma.ts
Identity and access
- Authentication actions
src/app/auth/_actions/auth.actions.ts - Tenant context
src/lib/db/tenant-context.ts
External services
- Auth adapter
src/adapters/auth/supabase-auth.adapter.ts - PostgreSQL
Other components
- Pharmacy user
Connections 21
- Pharmacy user → Dashboard shell: uses
- Dashboard shell → Authentication actions: signs out via
src/components/layout/dashboard-layout.tsx - Inventory workspace → Tenant context: requires context
src/app/inventory/page.tsx - Inventory workspace → Repository factory: queries inventory
src/app/inventory/page.tsx - Repository factory → Prisma database client: creates repositories
src/repositories/index.ts - Repository factory → Sales invoice storage: creates
src/repositories/index.ts - Repository factory → Payment storage: creates
src/repositories/index.ts - Repository factory → Ledger storage: creates
src/repositories/index.ts - Repository base → Tenant context: validates tenant
src/lib/db/base-repository.ts - Tenant context → Auth adapter: gets session
src/lib/db/tenant-context.ts - Tenant context → Prisma database client: loads membership
src/lib/db/tenant-context.ts - Prisma database client → PostgreSQL: connects
- Sales and billing → Sales invoice storage: records invoices
- Purchasing → GST calculations: uses tax calculations
- Sales and billing → GST calculations: uses tax calculations
- Reports and exports → Aging reports: includes aging
src/app/reports/page.tsx - Reports and exports → Financial reconciliation: supports reconciliation
- Financial reconciliation → Exact decimal arithmetic: uses precise arithmetic
src/domain/services/financial-reconciliation.service.ts - Aging reports → Exact decimal arithmetic: uses precise arithmetic
src/domain/services/aging-report.service.ts - Business records → Repository factory: uses records
- Business settings → Repository factory: uses records
src/app/settings/page.tsx