How work-aditya/kush works
CoachKush is an online coaching storefront and administration portal. Trainees discover coaching plans, authenticate, and proceed through checkout; server-side Supabase Edge Functions create and verify Razorpay payments and activate enrollments. Administrators manage plans, coupons, users, orders, messages, settings, and CMS pages. The graph follows documented routes and the sampled imports/calls; database schema details and several page/service implementations were not included, so their finer relationships are omitted.
Main entry points: supabaseClient.js Supabase client · pages Public pages · App.jsx Route application · authService.js Auth service
Components 22
Trainee experience
- Route application
frontend/src/App.jsx - Public pages
frontend/src/pages - Contact form
frontend/src/pages/ContactPage.jsx - Contact service
frontend/src/services/contactService.js
Identity and state
- Auth hook
frontend/src/hooks/useAuth.js - Auth service
frontend/src/services/authService.js
Plans and payments
- Plan catalog
frontend/src/services/productService.js - Checkout modal
frontend/src/components/checkout/CheckoutModal.jsx - Order service
frontend/src/services/orderService.js - Payment client
frontend/src/services/paymentService.js - Create payment order
supabase/functions/create-razorpay-order/index.ts - Verify payment
supabase/functions/verify-razorpay-payment/index.ts - Payment webhook
supabase/functions/razorpay-webhook/index.ts - Razorpay
Administration
- Admin portal
frontend/src/pages/admin - Admin service
frontend/src/services/adminService.js - Settings service
frontend/src/services/settingsService.js
Supabase platform
- Supabase client
frontend/src/lib/supabaseClient.js - Supabase Auth
- PostgreSQL
- Supabase Storage
Other components
- Trainee
Connections 29
- Trainee → Route application: browses
frontend/src/App.jsx - Route application → Public pages: routes to
frontend/src/App.jsx - Public pages → Plan catalog: loads plans
frontend/src/pages/HomePage.jsx - Public pages → Auth hook: uses auth
frontend/src/pages/HomePage.jsx - Public pages → Checkout modal: opens checkout
frontend/src/pages/PricingPage.jsx - Contact form → Contact service: submits to
frontend/src/pages/ContactPage.jsx - Auth hook → Auth service: calls
frontend/src/hooks/useAuth.js - Auth service → Supabase client: uses
frontend/src/services/authService.js - Supabase client → Supabase Auth: authenticates with
README.md - Auth service → PostgreSQL: reads profiles
frontend/src/services/authService.js - Plan catalog → Supabase client: queries
frontend/src/services/productService.js - Checkout modal → Order service: starts order
frontend/src/components/checkout/CheckoutModal.jsx - Order service → Payment client: requests payment
frontend/src/services/orderService.js - Payment client → Create payment order: invokes function
README.md - Payment client → Verify payment: invokes function
README.md - Create payment order → PostgreSQL: reads price
README.md - Create payment order → Razorpay: creates payment
README.md - Verify payment → Razorpay: verifies signature
README.md - Verify payment → PostgreSQL: updates enrollment
README.md - Razorpay → Payment webhook: sends events
README.md - Payment webhook → PostgreSQL: records events
README.md - Route application → Admin portal: routes protected
frontend/src/App.jsx - Admin portal → Admin service: manages records
frontend/src/pages/admin/AdminCoupons.jsx - Admin portal → Settings service: loads settings
frontend/src/pages/admin/AdminSettings.jsx - Admin service → Supabase client: uses
frontend/src/services/adminService.js - Settings service → Supabase client: uses
frontend/src/services/settingsService.js - Admin service → PostgreSQL: reads and writes
frontend/src/services/adminService.js - Settings service → PostgreSQL: reads and writes
frontend/src/services/settingsService.js - PostgreSQL → Supabase Storage: stores media
README.md