How cyrusemma/fast-datahub works
DataHUB is a Ghana-focused data-reseller platform for customers, resellers, agents and administrators. Users sign in, enter role-specific dashboards, and can buy data or airtime, manage wallets and review transactions; the README also documents top-ups, bills, referrals and bulk sales. Pricing is a distinct shared capability, with role-based configuration and margin forecasting. The graph focuses on evidenced routing, purchase, pricing and backend boundaries; unsampled role pages and payment integrations are represented at their supported directory or function paths.
Main entry points: pages Role dashboards · CustomerBuyData.jsx Customer data purchase · App.jsx Route and role access · bundles.api.js Bundle catalog
Components 26
App and access
- Route and role access
src/App.jsx - Sign-in and registration
src/pages/auth - Session state
src/store/authStore.js - Role dashboards
src/pages
Commerce and accounts
- Customer data purchase
src/pages/customer/CustomerBuyData.jsx - Customer services
src/pages/customer - Agent bulk sales
src/pages/agent/AgentBuyBulk.jsx - Reseller sales
src/pages/reseller/ResellerSellData.jsx - Wallet operations
src/api/wallet.api.js - Wallet state
src/store/walletStore.js - Transaction records
src/api/transactions.api.js - Bundle catalog
src/api/bundles.api.js
Pricing operations
- Pricing consoles
src/pages/admin/AdminPricingEngine.jsx - Agent pricing console
src/pages/agent/AgentPricingEngine.jsx - Reseller pricing console
src/pages/reseller/ResellerPricingEngine.jsx - Pricing engine
src/services/pricingEngine.js - Administration
src/pages/admin
Backend services
- Supabase client
src/api/supabase.js - Data purchase function
supabase/functions/buy-data/index.ts - Top-up verification
supabase/functions/topup-verify/index.ts - Fraud check
supabase/functions/fraud-check/index.ts - Reseller invitations
supabase/functions/invite-reseller/index.ts - Payment webhook
supabase/functions/paystack-webhook/index.ts
Other components
- Platform user
- Paystack
- Supabase project
Connections 26
- Platform user → Route and role access: opens
src/App.jsx - Route and role access → Sign-in and registration: routes to
src/App.jsx - Sign-in and registration → Session state: updates session
src/pages/auth/Register.jsx - Route and role access → Session state: initializes auth
src/App.jsx - Route and role access → Role dashboards: routes by role
src/App.jsx - Platform user → Customer data purchase: buys data
- Customer data purchase → Bundle catalog: loads bundles
src/pages/customer/CustomerBuyData.jsx - Customer data purchase → Wallet operations: uses wallet
src/pages/customer/CustomerBuyData.jsx - Customer data purchase → Transaction records: uses transactions
src/pages/customer/CustomerBuyData.jsx - Customer data purchase → Wallet state: uses wallet state
src/pages/customer/CustomerBuyData.jsx - Role dashboards → Customer services: routes customer services
src/App.jsx - Role dashboards → Agent bulk sales: routes agent sales
src/App.jsx - Role dashboards → Reseller sales: routes reseller sales
- Role dashboards → Administration: routes administration
src/App.jsx - Pricing consoles → Bundle catalog: updates bundles
src/pages/admin/AdminPricingEngine.jsx - Pricing consoles → Pricing engine: configures pricing
src/pages/admin/AdminPricingEngine.jsx - Agent pricing console → Pricing engine: reads and saves prices
src/pages/agent/AgentPricingEngine.jsx - Reseller pricing console → Pricing engine: reads and saves prices
src/pages/reseller/ResellerPricingEngine.jsx - Bundle catalog → Pricing engine: uses pricing rules
src/api/bundles.api.js - Wallet operations → Supabase client: uses client
src/api/wallet.api.js - Bundle catalog → Supabase client: uses client
src/api/bundles.api.js - Transaction records → Supabase client: uses client
- Supabase client → Supabase project: connects to
src/api/supabase.js - Wallet operations → Data purchase function: may invoke
- Paystack → Payment webhook: sends events
- Paystack → Top-up verification: funds wallet