How hoangnhatlongg/store_mannger works
Store Manager is a grocery-store operations app. Staff manage reference data, capture supplier invoices with OCR, register sales, and review stock and revenue. The central workflows are invoice image → OCR extraction → invoice entry/stock update, and POS sale → sale record/stock update → analytics. README documents broader catalog, customer, settings, and audit capabilities; their detailed wiring is not visible in the sampled source. Page-to-API links below reflect the documented product workflows and route responsibilities, not inspected page implementations.
Main entry points: prisma.ts Prisma client · route.ts OCR processing · auth.ts Session configuration · page.tsx Catalog management
Components 26
Store interface
- Invoice entry
src/app/import/page.tsx - OCR workspace
src/app/ai-ocr/page.tsx - POS sales
src/app/sales/page.tsx - Inventory view
src/app/inventory/page.tsx - Revenue view
src/app/revenue/page.tsx - Dashboard
src/app/page.tsx - Catalog management
src/app/products/page.tsx - Store reference data
src/app/suppliers/page.tsx
Store operations
- OCR processing
src/app/api/ocr/process/route.ts - Import invoices
src/app/api/imports/route.ts - Import adjustments
src/app/api/imports/[id]/route.ts - Sales invoices
src/app/api/sales/route.ts - Product catalog
src/app/api/products/route.ts - Categories
src/app/api/categories/route.ts - Suppliers
src/app/api/suppliers/route.ts - Units
src/app/api/units/route.ts - Product units
src/app/api/product-units/route.ts
Reporting
- Revenue analytics
src/app/api/analytics/revenue/route.ts - Daily sales detail
src/app/api/analytics/revenue-daily/route.ts - Dashboard metrics
src/app/api/analytics/dashboard/route.ts
Identity and data
- Authentication routes
src/app/api/auth/[...nextauth]/route.ts - Session configuration
src/lib/auth.ts - Prisma client
src/lib/prisma.ts
Other components
- Store staff
- OpenRouter models
- PostgreSQL
Connections 42
- Store staff → Invoice entry: enters invoice
- Store staff → OCR workspace: scans receipt
- Store staff → POS sales: records sale
- Store staff → Inventory view: reviews stock
- Store staff → Revenue view: reviews revenue
- Store staff → Dashboard: checks overview
- Store staff → Catalog management: manages products
- Store staff → Store reference data: manages suppliers
- OCR workspace → OCR processing: submits image
- OCR processing → OpenRouter models: requests extraction
- OpenRouter models → OCR processing: returns JSON
- OCR processing → Invoice entry: returns items
- Invoice entry → Import invoices: submits invoice
- Import invoices → Prisma client: creates invoice
- Import invoices → Prisma client: updates stock
- Invoice entry → Import adjustments: edits invoice
- Import adjustments → Prisma client: reads and revises
- POS sales → Sales invoices: submits sale
- Sales invoices → Prisma client: checks stock
- Sales invoices → Prisma client: records sale
- Catalog management → Product catalog: manages products
- Catalog management → Categories: manages categories
- Store reference data → Suppliers: manages suppliers
- Store reference data → Units: manages units
- Catalog management → Product units: manages product units
- Product catalog → Prisma client: reads and writes
- Categories → Prisma client: reads and writes
- Suppliers → Prisma client: reads and writes
- Units → Prisma client: reads and writes
- Product units → Prisma client: reads and writes
- Revenue view → Revenue analytics: requests trends
- Revenue view → Daily sales detail: requests daily detail
- Dashboard → Dashboard metrics: requests metrics
- Revenue analytics → Prisma client: queries sales
- Daily sales detail → Prisma client: queries sales
- Dashboard metrics → Prisma client: queries metrics
- Authentication routes → Session configuration: uses options
- Import invoices → Session configuration: checks session
- Sales invoices → Session configuration: checks session
- Product catalog → Session configuration: checks session
- OCR processing → Session configuration: checks session
- Prisma client → PostgreSQL: queries and persists