How pharmastudents/website works
Pharma Compass is a B.Pharm learning storefront and student platform with academic resource discovery, purchases, authenticated student access, and separate administration. The main journey is browsing the year/semester/subject catalogue, selecting materials, checking out, then using purchased resources through the student area and viewer. Admin capabilities include managing the academic catalogue, materials, students, orders, reports, and settings. Several route implementations were not sampled, so documented product relationships are shown without asserting unsampled call details.
Main entry points: index.tsx Admin Dashboard · store.tsx Application Store · academicService.ts Academic Service · client.ts Supabase Client
Components 29
Site and Discovery
- Public Site
src/routes/index.tsx - B.Pharm Catalogue
src/routes/bpharm.tsx
Student Learning
- Resource Catalogue
src/routes/resources/index.tsx - Resource Detail
src/routes/resources/$materialId.tsx - Purchase Records
supabase/functions/get-my-purchases/index.ts - Student Dashboard
src/routes/dashboard/index.tsx - Student Navigation
src/components/student/StudentLayout.tsx - Material Viewer
src/routes/viewer/$materialId.tsx
Administration
- Admin Dashboard
src/routes/admin/index.tsx - Admin Navigation
src/components/admin/AdminLayout.tsx - Academic Management
src/routes/admin/subjects - Material Management
src/routes/admin/materials - Student Management
src/routes/admin/students - Order Management
src/routes/admin/orders/index.tsx - Reports
src/routes/admin/reports/index.tsx - Settings
src/routes/admin/settings
Application Services
- Academic Service
src/lib/academicService.ts - Application Store
src/lib/store.tsx - Supabase Client
src/integrations/supabase/client.ts - Payment Helpers
supabase/functions/_shared/razorpay.ts
Payments
- Cart
src/routes/cart.tsx - Checkout
src/routes/checkout.tsx - Payment Service
src/lib/paymentService.ts - Order Creation
supabase/functions/create-order/index.ts - Razorpay Order
supabase/functions/create-razorpay-order/index.ts - Payment Verification
supabase/functions/verify-payment/index.ts - Payment Webhook
supabase/functions/razorpay-webhook/index.ts
Other components
- Student
- Razorpay
Connections 40
- Student → Public Site: explores
- Student → B.Pharm Catalogue: browses
- Student → Resource Catalogue: finds materials
- Public Site → B.Pharm Catalogue: links to
src/routes/index.tsx - B.Pharm Catalogue → Checkout: buys subject
- Resource Catalogue → Academic Service: loads catalogue
src/routes/resources/index.tsx - Resource Catalogue → Application Store: reads ownership
src/routes/resources/index.tsx - Resource Catalogue → Resource Detail: opens resource
- Resource Detail → Cart: starts purchase
- Student → Checkout: checks out
- Checkout → Payment Service: requests payment
- Payment Service → Supabase Client: uses client
src/lib/paymentService.ts - Order Creation → Payment Helpers: uses helpers
supabase/functions/create-order/index.ts - Razorpay Order → Payment Helpers: uses helpers
supabase/functions/create-razorpay-order/index.ts - Payment Verification → Payment Helpers: uses helpers
supabase/functions/verify-payment/index.ts - Payment Webhook → Payment Helpers: uses helpers
supabase/functions/razorpay-webhook/index.ts - Order Creation → Razorpay: creates order
- Razorpay Order → Razorpay: creates order
- Payment Webhook → Purchase Records: records purchase
- Student → Student Dashboard: opens dashboard
- Student Dashboard → Student Navigation: renders within
src/routes/dashboard/index.tsx - Student Dashboard → Application Store: reads student data
src/routes/dashboard/index.tsx - Student Navigation → Application Store: uses session
src/components/student/StudentLayout.tsx - Student → Material Viewer: opens unlocked material
- Student → Admin Dashboard: administers platform
- Admin Dashboard → Admin Navigation: renders within
src/routes/admin/index.tsx - Admin Dashboard → Application Store: reads admin data
src/routes/admin/index.tsx - Admin Dashboard → Supabase Client: queries backend
src/routes/admin/index.tsx - Admin Navigation → Supabase Client: loads notifications
src/components/admin/AdminLayout.tsx - Academic Management → Academic Service: manages academics
- Material Management → Academic Service: manages materials
- Student Management → Admin Dashboard: supports operations
- Order Management → Academic Service: loads order data
src/routes/admin/orders/index.tsx - Order Management → Application Store: reads order data
src/routes/admin/orders/index.tsx - Order Management → Supabase Client: queries backend
src/routes/admin/orders/index.tsx - Reports → Admin Dashboard: reports activity
- Settings → Admin Dashboard: configures platform
- Academic Service → Supabase Client: queries backend
src/lib/academicService.ts - Application Store → Supabase Client: uses client
src/lib/store.tsx - Application Store → Academic Service: uses academic data
src/lib/store.tsx