How t06546666-maker/ae works
RewardHub is a multi-role rewards platform: customers discover merchants and offers, earn or redeem rewards, while merchants handle QR checkout and customer orders and administrators manage the network and reporting. The React app routes role-specific workspaces through a shared API to an Express backend and Supabase. The backend also supports campaign notifications and a distinct affiliate settlement engine. Main server internals and unsampled page/API wiring are only partially evidenced, so uncertain relationships are omitted; optional email is documented but not verified in source.
Main entry points: server.js Express API · redemptions/index.js Redemptions · rewards/index.js Reward ledger · audit/index.js Audit trail
Components 22
User applications
- Admins and merchants
src/App.tsx - Customer app
src/App.tsx
Merchant and admin operations
- Admin workspace
src/pages/AdminDashboard.tsx - Merchant workspace
src/pages/MerchantOverview.tsx - QR checkout
src/components/QrScanner.tsx - Field visits
src/pages/FieldManager.tsx
Customer rewards
- Explore and offers
src/pages/customer/Explore.tsx - Customer account
src/pages/customer/Profile.tsx - Rewards and activity
src/hooks/useCustomerData.ts
Backend services
- API client
src/api.ts - Express API
server.js - Supabase
- WhatsApp Cloud API
- Resend email
Affiliate settlement
- Affiliate networks
src/modules/affiliate/networks/index.js - Reward ledger
src/modules/affiliate/rewards/index.js - Redemptions
src/modules/affiliate/redemptions/index.js - Settlements
src/modules/affiliate/settlements/index.js - Payment provider
src/modules/affiliate/payments/MockPaymentProvider.js - Audit trail
src/modules/affiliate/audit/index.js - Affiliate data client
src/modules/affiliate/common/db.js - Money conversion
src/modules/affiliate/common/money.js
Connections 31
- Admins and merchants → Admin workspace: routes to
src/App.tsx - Admins and merchants → Merchant workspace: routes to
src/App.tsx - Admins and merchants → Field visits: routes to
src/App.tsx - Customer app → Explore and offers: routes to
src/App.tsx - Customer app → Customer account: routes to
src/App.tsx - Customer app → Rewards and activity: uses
- Merchant workspace → QR checkout: uses
- Admins and merchants → API client: calls
src/App.tsx - Rewards and activity → API client: fetches from
src/hooks/useCustomerData.ts - API client → Express API: sends requests
README.md - Express API → Supabase: reads and writes
README.md - Express API → WhatsApp Cloud API: sends notifications
README.md - Express API → Resend email: sends email
README.md - Express API → Affiliate networks: mounts
server.js - Express API → Reward ledger: mounts
server.js - Express API → Redemptions: mounts
server.js - Express API → Settlements: mounts
server.js - Redemptions → Reward ledger: checks entitlement
src/modules/affiliate/redemptions/index.js - Redemptions → Payment provider: creates payment
src/modules/affiliate/redemptions/index.js - Settlements → Payment provider: uses
src/modules/affiliate/settlements/index.js - Affiliate networks → Affiliate data client: queries
src/modules/affiliate/networks/index.js - Reward ledger → Affiliate data client: writes ledger
src/modules/affiliate/rewards/index.js - Redemptions → Affiliate data client: reads and writes
src/modules/affiliate/redemptions/index.js - Settlements → Affiliate data client: reads and writes
src/modules/affiliate/settlements/index.js - Reward ledger → Money conversion: converts amounts
src/modules/affiliate/rewards/index.js - Redemptions → Money conversion: converts amounts
src/modules/affiliate/redemptions/index.js - Affiliate networks → Audit trail: records actions
src/modules/affiliate/networks/index.js - Reward ledger → Audit trail: records actions
src/modules/affiliate/rewards/index.js - Redemptions → Audit trail: records actions
src/modules/affiliate/redemptions/index.js - Settlements → Audit trail: records actions
src/modules/affiliate/settlements/index.js - Audit trail → Affiliate data client: writes audit logs
src/modules/affiliate/audit/index.js