How zisanulhaque/ph-healthcare-backend works
PH Healthcare System is an Express REST backend for patient-doctor care. The README says authentication is the only working feature; appointments, schedules, payments, doctor management, prescriptions, and analytics are planned or unfinished, so their presence in the tree does not establish operational behavior. The intended request flow is client → mounted route → controller → service, with services using shared persistence and integrations. The sampled excerpts confirm auth, authorization, appointment, and doctor behavior; other module links rely on the SOURCE INDEX, not inspected implementations.
Main entry points: app.ts Express app · prisma.ts Prisma client · auth.service.ts Auth service · doctor.service.ts Doctor management
Components 20
API and auth
- Express app
src/app.ts - Auth routes
src/app/module/auth/auth.route.ts - Auth controller
src/app/module/auth/auth.controller.ts - Auth service
src/app/module/auth/auth.service.ts
Healthcare domains
- Appointments
src/app/module/appointment/appointment.service.ts - Doctor management
src/app/module/doctor/doctor.service.ts - Schedules
src/app/module/schedule/schedule.service.ts - Payments
src/app/module/payment/payment.service.ts - Prescriptions
src/app/module/prescription/prescription.service.ts - Analytics
src/app/module/analytics/analytics.service.ts - User profiles
src/app/module/user/user.services.ts
Persistence and integrations
- Prisma client
src/app/lib/prisma.ts - PostgreSQL
- Redis client
src/app/lib/redis.ts - bKash integration
src/app/lib/bkash.ts - Email integration
src/app/lib/nodemailer.ts - Cloudinary integration
src/app/lib/cloudinary.ts
Shared request layer
- JWT role guard
src/app/middleware/checkAuth.ts - JWT helpers
src/app/utils/jwt.ts
Other components
- API client
Connections 28
- API client → Express app: sends requests
README.md - Express app → Auth routes: mounts auth
src/app.ts - Express app → Appointments: mounts appointment API
src/app.ts - Express app → Doctor management: mounts doctor API
src/app.ts - Express app → Schedules: mounts schedule API
src/app.ts - Express app → Payments: mounts payment API
src/app.ts - Express app → Prescriptions: mounts prescription API
src/app.ts - Express app → Analytics: mounts analytics API
src/app.ts - Express app → User profiles: mounts user API
src/app.ts - Auth routes → Auth controller: routes to
src/app/module/auth/auth.route.ts - Auth controller → Auth service: calls
src/app/module/auth/auth.controller.ts - Auth routes → JWT role guard: protects endpoints
src/app/module/auth/auth.route.ts - JWT role guard → JWT helpers: verifies tokens
src/app/middleware/checkAuth.ts - Auth service → Prisma client: reads and writes
src/app/module/auth/auth.service.ts - Auth service → Redis client: uses OTP storage
src/app/module/auth/auth.service.ts - Auth service → Email integration: sends email
src/app/module/auth/auth.service.ts - Appointments → Prisma client: reads and writes
src/app/module/appointment/appointment.service.ts - Appointments → bKash integration: requests payment token
src/app/module/appointment/appointment.service.ts - Doctor management → Prisma client: reads and writes
src/app/module/doctor/doctor.service.ts - Doctor management → Cloudinary integration: uploads resume
src/app/module/doctor/doctor.service.ts - Doctor management → Redis client: checks OTP
src/app/module/doctor/doctor.service.ts - Schedules → Prisma client: reads and writes
src/app/module/schedule/schedule.service.ts - Payments → Prisma client: reads and writes
src/app/module/payment/payment.service.ts - Prescriptions → Prisma client: reads and writes
src/app/module/prescription/prescription.service.ts - Prescriptions → Cloudinary integration: uploads files
src/app/module/prescription/prescription.service.ts - Analytics → Prisma client: queries data
src/app/module/analytics/analytics.service.ts - User profiles → Prisma client: reads and writes
src/app/module/user/user.services.ts - Prisma client → PostgreSQL: connects through adapter
src/app/lib/prisma.ts