How chahmed12/cpharma works
Cpharma is a telemedicine and pharmacy platform spanning professional onboarding, patient consultation, prescription signing and pharmacy dispensing, with consultation payments and real-time video. The user-facing workflow starts in the role-based web app; consultations use WebRTC with WebSocket signaling, and prescriptions are cryptographically verified at the pharmacy. The graph also includes authentication/OTP and financial processing as distinct capabilities. Relationships are limited to those stated in the README or visible in the supplied source index and excerpts; unsampled implementation details are not inferred.
Main entry points: App.tsx Role-based app · accounts/views.py Account API · consultations/views.py Consultation API · prescriptions/views.py Prescription API
Components 21
Web experience
- Role-based app
frontend/src/App.tsx - Doctor dashboard
frontend/src/pages/DoctorDashboard.tsx - Auth client
frontend/src/services/authService.ts
Identity and trust
- Account API
backend/apps/accounts/views.py - OTP service
backend/apps/accounts/services/otp_service.py - Account records
backend/apps/accounts/models.py
Care delivery
- Consultation API
backend/apps/consultations/views.py - Consultation records
backend/apps/consultations/models.py - WebSocket signaling
backend/apps/consultations/consumers.py - Video session
frontend/src/hooks/useWebRTC.ts - Prescription crypto
frontend/src/services/cryptoService.ts - Prescription API
backend/apps/prescriptions/views.py - Prescription records
backend/apps/prescriptions/models.py - Signature viewer
frontend/src/components/prescription/SignatureViewer.tsx - Patient records
backend/apps/patients/models.py
Pharmacy and finance
- Payment API
backend/apps/payments/views.py - Payment records
backend/apps/payments/models.py - Payment client
frontend/src/services/paymentService.ts
Other components
- Patient
- Doctor
- Pharmacist
Connections 21
- Patient → Role-based app: uses
README.md - Doctor → Role-based app: uses
README.md - Pharmacist → Role-based app: uses
README.md - Role-based app → Doctor dashboard: routes to
frontend/src/App.tsx - Role-based app → Auth client: routes to
frontend/src/App.tsx - Auth client → Account API: sends auth requests
frontend/src/services/authService.ts - Account API → OTP service: uses OTP
- Account API → Account records: reads and writes
- Role-based app → Consultation API: routes consultation
- Consultation API → Consultation records: reads and writes
- Role-based app → WebSocket signaling: opens signaling
- WebSocket signaling → Video session: signals session
README.md - Doctor dashboard → Prescription crypto: signs prescription
README.md - Pharmacist → Signature viewer: verifies signature
README.md - Signature viewer → Prescription crypto: verifies cryptographically
README.md - Role-based app → Prescription API: routes prescription
- Prescription API → Prescription records: reads and writes
- Prescription API → Patient records: accesses patient data
- Payment client → Payment API: requests payment
- Payment API → Payment records: reads and writes
- Consultation API → Payment API: settles consultation
README.md