How henryharborne/emporium-rewards--frontend works
Emporium Rewards is a customer loyalty frontend: customers look up points by phone, while admins log in, manage customer records and point balances, review/undo logs, and export customer data. The graph follows the shown routing and API calls; the backend is represented only as an external service because its implementation is outside this repository. AdminLogs, ManageCustomers and Supabase helper behavior are represented from the README/tree where excerpts are limited.
Main entry points: Dashboard.tsx Admin dashboard · useUserStore.ts Admin session · Home.tsx Rewards home · AdminLoginModal.tsx Admin login
Components 13
Customer lookup
- Rewards home
src/pages/Home.tsx - Phone lookup
src/components/PhoneLookupForm.tsx
Admin access
- Admin login
src/components/AdminLoginModal.tsx - Admin dashboard
src/pages/Dashboard.tsx - Supabase client helper
src/api/supabase.ts
Customer operations
- Customer search and edit
src/components/SearchCustomers.tsx - Customer add/delete
src/components/ManageCustomers.tsx - Admin logs
src/components/AdminLogs.tsx
App navigation and state
- Routes
src/App.tsx - Admin session
src/store/useUserStore.ts
Other components
- Customer
- Administrator
- Rewards backend API
Connections 24
- Routes → Rewards home: routes to
src/App.tsx - Routes → Admin dashboard: routes to
src/App.tsx - Rewards home → Phone lookup: renders
src/pages/Home.tsx - Rewards home → Admin login: opens
src/pages/Home.tsx - Rewards home → Admin session: reads
src/pages/Home.tsx - Customer → Phone lookup: enters phone
- Phone lookup → Rewards backend API: requests points
src/components/PhoneLookupForm.tsx - Rewards backend API → Phone lookup: returns balance
src/components/PhoneLookupForm.tsx - Administrator → Admin login: submits credentials
- Admin login → Rewards backend API: requests login
src/components/AdminLoginModal.tsx - Admin login → Admin session: stores token
src/components/AdminLoginModal.tsx - Admin dashboard → Rewards backend API: validates token
src/pages/Dashboard.tsx - Admin dashboard → Admin session: reads and updates
src/pages/Dashboard.tsx - Admin dashboard → Customer search and edit: renders
src/pages/Dashboard.tsx - Admin dashboard → Customer add/delete: renders
src/pages/Dashboard.tsx - Admin dashboard → Admin logs: renders
src/pages/Dashboard.tsx - Customer search and edit → Admin session: reads token
src/components/SearchCustomers.tsx - Customer search and edit → Rewards backend API: searches and updates
src/components/SearchCustomers.tsx - Customer add/delete → Admin session: reads token
src/components/ManageCustomers.tsx - Customer add/delete → Rewards backend API: adds and deletes
src/components/ManageCustomers.tsx - Admin logs → Admin session: reads token
src/components/AdminLogs.tsx - Admin logs → Rewards backend API: fetches and undoes
src/components/AdminLogs.tsx - Admin dashboard → Rewards backend API: exports CSV
src/pages/Dashboard.tsx - Admin dashboard → Rewards backend API: pings service
src/pages/Dashboard.tsx