How hadiissa1/nahel works
Nahel is a bilingual honey and beekeeping shop with a public storefront and an owner/staff admin. The main customer path is browsing the catalog, building a cart, and recording an order; the README documents live stock checks, promo codes, delivery-area selection, and WhatsApp follow-up. Separate branches cover in-person sales, finance and visitor reporting, traceability, reviews, articles, and subscriber offers. The graph uses README statements and SOURCE INDEX references for links; many implementation details were not sampled, so those links are documentation-backed rather than claims of inspected call flow.
Main entry points: actions.ts Admin actions · orders.ts Order processing · products.ts Product and stock · db.ts SQLite database
Components 25
Storefront
- Shop and catalog
components/Shop.tsx - Product pages
app/(shop)/product/[id]/page.tsx - Tips and articles
lib/articles.ts
Commerce
- Cart and checkout
components/Cart.tsx - Order actions
app/orders/actions.ts - Order processing
lib/orders.ts - Delivery areas
lib/delivery.ts - Promo codes
lib/promo.ts - Product and stock
lib/products.ts - Lot traceability
lib/lots.ts - Customer reviews
lib/reviews.ts
Store management
- In-person till
components/admin/PosTerminal.tsx - Admin pages
app/admin/page.tsx - Admin actions
app/admin/actions.ts - Admin and staff access
lib/auth.ts - Staff accounts
lib/staff.ts - Finance reports
lib/finance.ts - Stock alerts
lib/stock-alerts.ts
Store services
- SQLite database
lib/db.ts - Visitor analytics
lib/analytics.ts - Offers subscribers
lib/subscribers.ts - Email delivery
lib/mail.ts
Other components
- Customer
- Owner or staff
Connections 42
- Customer → Shop and catalog: browses
README.md - Customer → Cart and checkout: adds items
README.md - Cart and checkout → Product and stock: checks stock
README.md - Cart and checkout → Promo codes: applies code
README.md - Cart and checkout → Delivery areas: selects area
README.md - Cart and checkout → Order actions: submits order
README.md - Order actions → Order processing: records order
- Order processing → Product and stock: updates stock
README.md - Order processing → WhatsApp: sends order
README.md - Customer → Product pages: views product
README.md - Product pages → Product and stock: loads product
app/(shop)/product/[id]/page.tsx - Product pages → Customer reviews: loads ratings
app/(shop)/product/[id]/page.tsx - Owner or staff → Admin pages: manages store
README.md - Admin pages → Admin and staff access: checks access
app/admin/page.tsx - Admin pages → Product and stock: manages products
app/admin/page.tsx - Admin pages → Admin actions: submits changes
- Admin actions → Admin and staff access: requires access
app/admin/actions.ts - Admin actions → Product and stock: saves products
app/admin/actions.ts - Admin actions → Customer reviews: moderates reviews
app/admin/actions.ts - Admin actions → Tips and articles: saves articles
app/admin/actions.ts - Admin actions → Offers subscribers: sends promotions
app/admin/actions.ts - Admin actions → Lot traceability: manages lots
app/admin/actions.ts - Owner or staff → In-person till: rings up sale
README.md - In-person till → Order processing: records sale
README.md - Owner or staff → Finance reports: reviews reports
README.md - Finance reports → Order processing: reports sales
README.md - Finance reports → Visitor analytics: reports visitors
README.md - Product and stock → SQLite database: reads and writes
lib/products.ts - Order processing → SQLite database: persists orders
- Tips and articles → SQLite database: reads and writes
lib/articles.ts - Customer reviews → SQLite database: reads and writes
lib/reviews.ts - Offers subscribers → SQLite database: reads and writes
lib/subscribers.ts - Offers subscribers → Email delivery: sends confirmations
lib/subscribers.ts - Owner or staff → Stock alerts: configures alerts
README.md - Stock alerts → Email delivery: emails low stock
README.md - Customer → Tips and articles: reads tips
- Customer → Customer reviews: submits review
- Customer → Offers subscribers: signs up
README.md - Customer → WhatsApp: contacts shop
README.md - Owner or staff → Staff accounts: manages accounts
README.md - Owner or staff → Lot traceability: records harvest lots
README.md - Lot traceability → SQLite database: stores records