How tinashe2023/shalom-medical-center works
Shalom Medical Center is a role-based healthcare appointment and records system. Patients register, verify accounts, find doctors, book appointments, and access histories and prescriptions; doctors manage schedules, appointments, records, and prescriptions; administrators oversee users, appointments, departments, and analytics. The React application selects role-specific dashboards and communicates with an Express API backed by PostgreSQL. The README documents email notifications and a local, database-aware AI assistant. Sampled source confirms app routing, server dispatch, authentication/database access, appointment UI API use, and AI database/model integration; other feature wiring is represented only where documented.
Main entry points: server.js Express server · db.js PostgreSQL · api.ts API client · App.tsx Role-based app
Components 28
Web application
- Role-based app
src/App.tsx - Patient dashboard
src/components/PatientDashboard.tsx - Appointment booking
src/components/PatientBooking.tsx - Patient history
src/components/PatientMedicalHistory.tsx - Doctor dashboard
src/components/DoctorDashboard.tsx - Doctor schedule
src/components/DoctorSchedule.tsx - Prescription workflow
src/components/DoctorPatientHistory.tsx - Admin dashboard
src/components/AdminDashboard.tsx - Appointment oversight
src/components/AppointmentManager.tsx - AI chat
src/components/AIAssistant.tsx - API client
src/lib/api.ts
API and workflows
- Express server
src/backend/server.js - Authentication
src/backend/routes/auth.js - Appointment routes
src/backend/routes/appointments.js - Patient routes
src/backend/routes/patients.js - Doctor routes
src/backend/routes/doctors.js - Medical record routes
src/backend/routes/medical-records.js - Analytics routes
src/backend/routes/stats.js - User routes
src/backend/routes/users.js - AI routes
src/backend/routes/ai.js
Records and services
- PostgreSQL
src/backend/db.js - AI context service
src/backend/ai-service.js - Email service
src/backend/email-service.js
External services
- SMTP email
- LMStudio
Other components
- Patient
- Doctor
- Administrator
Connections 40
- Patient → Role-based app: uses
- Doctor → Role-based app: uses
- Administrator → Role-based app: uses
- Role-based app → Patient dashboard: routes by role
- Role-based app → Doctor dashboard: routes by role
- Role-based app → Admin dashboard: routes by role
- Patient dashboard → Appointment booking: offers booking
- Patient dashboard → Patient history: shows records
- Doctor dashboard → Doctor schedule: manages availability
- Doctor dashboard → Prescription workflow: manages care
- Admin dashboard → Appointment oversight: manages appointments
- Appointment booking → API client: requests appointments
- Appointment oversight → API client: deletes appointments
- Patient history → API client: requests records
- Doctor schedule → API client: requests schedules
- Prescription workflow → API client: submits prescriptions
- AI chat → API client: sends questions
- API client → Express server: sends API requests
- Express server → Authentication: dispatches auth
- Express server → Appointment routes: dispatches appointments
- Express server → Patient routes: dispatches patients
- Express server → Doctor routes: dispatches doctors
- Express server → Medical record routes: dispatches records
- Express server → Analytics routes: dispatches analytics
- Express server → User routes: dispatches users
- Express server → AI routes: dispatches AI
- Authentication → PostgreSQL: reads and writes
- Appointment routes → PostgreSQL: reads and writes
- Patient routes → PostgreSQL: reads and writes
- Doctor routes → PostgreSQL: reads and writes
- Medical record routes → PostgreSQL: reads and writes
- Analytics routes → PostgreSQL: queries statistics
- User routes → PostgreSQL: reads and writes
- AI routes → AI context service: invokes assistant
- AI context service → PostgreSQL: queries context
- AI context service → LMStudio: sends prompts
- Email service → SMTP email: sends notifications
- Authentication → Email service: sends account mail
- Appointment routes → Email service: sends appointment mail
- Medical record routes → Email service: sends prescriptions