evaldoc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.env.staging.example +19 -0
  2. package/.firebaserc +6 -0
  3. package/.github/workflows/auto-merge-to-main.yml +28 -0
  4. package/.github/workflows/ci.yml +27 -0
  5. package/.github/workflows/npxhub-publish.yml +170 -0
  6. package/.prettierignore +4 -0
  7. package/.prettierrc.json +7 -0
  8. package/README.md +142 -0
  9. package/SRS.md +448 -0
  10. package/apphosting.staging.yaml +48 -0
  11. package/apphosting.yaml +50 -0
  12. package/bin/evaldoc.cjs +105 -0
  13. package/cors.json +8 -0
  14. package/docs/ARCHITECTURE.md +769 -0
  15. package/docs/ARCHITECTURE_SUMMARY.md +323 -0
  16. package/docs/DEPLOYMENT.md +86 -0
  17. package/docs/DEPLOYMENT_STEPS.md +373 -0
  18. package/docs/DEPLOY_FIRESTORE_RULES.md +239 -0
  19. package/docs/DEPLOY_STORAGE_RULES.md +82 -0
  20. package/docs/DOCTOR_TUTORIAL.md +467 -0
  21. package/docs/FIREBASE_STORAGE_CORS_FIX.md +131 -0
  22. package/docs/FIXES_APPLIED.md +128 -0
  23. package/docs/IMPLEMENTATION.md +498 -0
  24. package/docs/IMPLEMENTATION_COMPLETE.md +317 -0
  25. package/docs/LLM-SETUP.md +216 -0
  26. package/docs/MANUAL_TEST_GUIDE.md +327 -0
  27. package/docs/PATIENT_GUIDE.md +451 -0
  28. package/docs/PLATFORM_OVERVIEW.md +194 -0
  29. package/docs/QUICKSTART.md +252 -0
  30. package/docs/QUICK_REFERENCE.md +222 -0
  31. package/docs/READY_TO_TEST.md +383 -0
  32. package/docs/RUN.md +237 -0
  33. package/docs/START_TESTING.md +130 -0
  34. package/docs/STRIPE_CONNECT_SETUP.md +454 -0
  35. package/docs/SYSTEM_READY.md +345 -0
  36. package/docs/THREADS_IMPLEMENTATION_COMPLETE.md +431 -0
  37. package/docs/THREAD_IMPLEMENTATION_GUIDE.md +345 -0
  38. package/docs/firebasefiles.md +21 -0
  39. package/docs/homepage.md +1208 -0
  40. package/docs/payments.md +159 -0
  41. package/eslint.config.js +76 -0
  42. package/firebase.json +27 -0
  43. package/firestore.indexes.json +88 -0
  44. package/firestore.rules +125 -0
  45. package/functions/package-lock.json +2884 -0
  46. package/functions/package.json +20 -0
  47. package/functions/src/analytics.js +101 -0
  48. package/functions/src/audit.js +28 -0
  49. package/functions/src/auth.js +19 -0
  50. package/functions/src/drafts.js +128 -0
  51. package/functions/src/feedback.js +164 -0
  52. package/functions/src/firebase-init.js +29 -0
  53. package/functions/src/i18n.js +134 -0
  54. package/functions/src/limits.js +27 -0
  55. package/functions/src/llm.js +271 -0
  56. package/functions/src/ner.js +162 -0
  57. package/functions/src/notifications.js +273 -0
  58. package/functions/src/orgs.js +127 -0
  59. package/functions/src/patient-api.js +545 -0
  60. package/functions/src/payment.js +830 -0
  61. package/functions/src/safety.js +188 -0
  62. package/functions/src/stripe-config.js +33 -0
  63. package/functions/src/topics.js +94 -0
  64. package/functions/src/triage.js +191 -0
  65. package/functions/src/utils.js +28 -0
  66. package/functions/src/validate.js +177 -0
  67. package/functions/test-firebase.js +36 -0
  68. package/jest.config.js +18 -0
  69. package/package.json +52 -0
  70. package/public/404.html +93 -0
  71. package/public/app/analytics.html +336 -0
  72. package/public/app/analytics.js +177 -0
  73. package/public/app/app.css +1400 -0
  74. package/public/app/app.js +1754 -0
  75. package/public/app/config.js +14 -0
  76. package/public/app/inbox-threads.js +843 -0
  77. package/public/app/inbox.html +598 -0
  78. package/public/app/inbox.js +397 -0
  79. package/public/app/index.html +612 -0
  80. package/public/assets/logo.jpg +0 -0
  81. package/public/chat.html +137 -0
  82. package/public/css/chat.css +870 -0
  83. package/public/css/landing-enhance.css +298 -0
  84. package/public/css/styles.css +1198 -0
  85. package/public/favicon.svg +5 -0
  86. package/public/find-doctor.html +220 -0
  87. package/public/index.html +399 -0
  88. package/public/js/chat-threads.js +513 -0
  89. package/public/js/chat.js +832 -0
  90. package/public/js/search.js +41 -0
  91. package/public/privacy.html +101 -0
  92. package/public/robots.txt +6 -0
  93. package/public/site.webmanifest +12 -0
  94. package/public/terms.html +110 -0
  95. package/scripts/create-test-provider.js +55 -0
  96. package/scripts/deploy-staging.sh +51 -0
  97. package/scripts/fix-provider.js +39 -0
  98. package/scripts/quick-test.sh +37 -0
  99. package/scripts/test-chat.sh +54 -0
  100. package/scripts/test-multi-turn.js +137 -0
  101. package/scripts/test-ner-simple.js +28 -0
  102. package/scripts/test-ner.js +60 -0
  103. package/scripts/test-stripe-connect.js +304 -0
  104. package/scripts/test-webhook-secret.sh +24 -0
  105. package/server.js +3864 -0
  106. package/storage.rules +22 -0
  107. package/test-api.json +1 -0
  108. package/tests/emulator/README.md +38 -0
  109. package/tests/emulator/counters.emulator.test.js +81 -0
  110. package/tests/integration/api-account-selfserve.test.js +312 -0
  111. package/tests/integration/api-admin-digest.test.js +202 -0
  112. package/tests/integration/api-chat-satisfaction.test.js +259 -0
  113. package/tests/integration/api-doctor-drafts.test.js +236 -0
  114. package/tests/integration/api-doctor-inbox.test.js +401 -0
  115. package/tests/integration/api-org.test.js +328 -0
  116. package/tests/integration/api-payment.test.js +664 -0
  117. package/tests/integration/api-provider-settings.test.js +475 -0
  118. package/tests/integration/api-qr.test.js +121 -0
  119. package/tests/integration/api-security.test.js +241 -0
  120. package/tests/integration/api-stripe-search.test.js +303 -0
  121. package/tests/integration/api-webhook-deletion.test.js +231 -0
  122. package/tests/mocks/firebase-admin.js +220 -0
  123. package/tests/unit/analytics.test.js +151 -0
  124. package/tests/unit/audit-bugs.test.js +203 -0
  125. package/tests/unit/chat-ui-logic.test.js +283 -0
  126. package/tests/unit/drafts.test.js +104 -0
  127. package/tests/unit/feedback.test.js +148 -0
  128. package/tests/unit/i18n.test.js +229 -0
  129. package/tests/unit/llm-retry.test.js +122 -0
  130. package/tests/unit/notifications.test.js +155 -0
  131. package/tests/unit/orgs.test.js +328 -0
  132. package/tests/unit/payment.test.js +889 -0
  133. package/tests/unit/safety-edge-cases.test.js +509 -0
  134. package/tests/unit/safety-srs-compliance.test.js +252 -0
  135. package/tests/unit/safety.test.js +291 -0
  136. package/tests/unit/server-helpers.test.js +774 -0
  137. package/tests/unit/topics-limits.test.js +158 -0
  138. package/tests/unit/triage.test.js +152 -0
  139. package/tests/unit/validate.test.js +408 -0
@@ -0,0 +1,451 @@
1
+ # EvalDoc Patient User Guide
2
+
3
+ ## 👋 Welcome!
4
+
5
+ EvalDoc helps you get quick, safe health information from your doctor's AI assistant - available 24/7 on any device.
6
+
7
+ ---
8
+
9
+ ## 🤔 What is EvalDoc?
10
+
11
+ EvalDoc is your doctor's AI assistant that helps answer routine health questions instantly. Your doctor reviews all conversations and steps in when needed.
12
+
13
+ ### What EvalDoc IS:
14
+ ✅ A way to get quick health information
15
+ ✅ Educational guidance for common questions
16
+ ✅ A bridge to your doctor 24/7
17
+ ✅ Free to use (no app download needed)
18
+
19
+ ### What EvalDoc is NOT:
20
+ ❌ A replacement for seeing your doctor
21
+ ❌ A diagnostic tool
22
+ ❌ A prescription service
23
+ ❌ For medical emergencies
24
+
25
+ ---
26
+
27
+ ## 🚀 Getting Started
28
+
29
+ ### Step 1: Get Your Doctor's Link
30
+
31
+ Your doctor will share a unique link like:
32
+ ```
33
+ evaldoctor.ai/dr-sarah-amina
34
+ ```
35
+
36
+ You might receive it via:
37
+ - WhatsApp message
38
+ - SMS text
39
+ - Email
40
+ - QR code at the clinic
41
+ - Business card
42
+
43
+ ### Step 2: Open the Link
44
+
45
+ Simply click or tap the link - it works on:
46
+ - 📱 Any smartphone (iPhone, Android)
47
+ - đŸ’ģ Computer or laptop
48
+ - 📲 Tablet
49
+ - 🌐 Any web browser
50
+
51
+ **No app download needed!**
52
+
53
+ ### Step 3: Start Chatting
54
+
55
+ The page will open with your doctor's welcome message and available topics.
56
+
57
+ ---
58
+
59
+ ## đŸ’Ŧ How to Use the Chat
60
+
61
+ ### Choosing a Topic
62
+
63
+ Select what your question is about:
64
+
65
+ **💊 Medication Information & Safety**
66
+ - Questions about medications
67
+ - Drug interactions
68
+ - When to take medicines
69
+
70
+ **📅 Appointments & Preparation**
71
+ - How to prepare for visits
72
+ - What to bring
73
+ - Scheduling help
74
+
75
+ **â„šī¸ General Health Information**
76
+ - Common health questions
77
+ - Preventive care tips
78
+ - Healthy living advice
79
+
80
+ **đŸĨ Clinic Services & Hours**
81
+ - Clinic hours
82
+ - Services offered
83
+ - Location and contact info
84
+
85
+ **đŸ’ŗ Insurance & Billing**
86
+ - Insurance questions
87
+ - Payment options
88
+ - Billing inquiries
89
+
90
+ **🩹 Post-Procedure Guidance**
91
+ - Recovery instructions
92
+ - Follow-up care
93
+ - What to expect after treatment
94
+
95
+ ### Asking Your Question
96
+
97
+ 1. Select a topic from the dropdown
98
+ 2. Type your question in the message box
99
+ 3. Click **"Send"**
100
+ 4. AI responds within seconds
101
+
102
+ ### Examples of Good Questions
103
+
104
+ ✅ "What should I do if my child has a fever?"
105
+ ✅ "How do I prepare for my blood test tomorrow?"
106
+ ✅ "What are your clinic hours?"
107
+ ✅ "Is it normal to feel tired after surgery?"
108
+ ✅ "Can I take ibuprofen with my blood pressure medication?"
109
+
110
+ ### Questions to Ask Your Doctor Directly
111
+
112
+ ❌ "What disease do I have?"
113
+ ❌ "Can you prescribe me antibiotics?"
114
+ ❌ "What dose should I take?"
115
+ ❌ "Is this rash cancer?"
116
+
117
+ For these questions, **book an appointment with your doctor**.
118
+
119
+ ---
120
+
121
+ ## 🤖 Understanding AI Responses
122
+
123
+ ### What to Expect
124
+
125
+ The AI will:
126
+ - Give you educational information
127
+ - Explain things in simple language
128
+ - Suggest when to see your doctor
129
+ - Always include safety disclaimers
130
+ - Flag urgent issues automatically
131
+
132
+ ### Example Conversation
133
+
134
+ **You**: "My child has a fever of 37.8°C. What should I do?"
135
+
136
+ **AI**: "For a child with mild fever (37.8°C):
137
+
138
+ **At Home Care:**
139
+ - Keep them comfortable and rested
140
+ - Offer plenty of fluids (water, juice)
141
+ - Use light clothing and blankets
142
+ - Monitor temperature regularly
143
+
144
+ **When to See a Doctor:**
145
+ - Fever above 38.5°C (101.3°F)
146
+ - Lasts more than 3 days
147
+ - Child is very sleepy or irritable
148
+ - Has trouble breathing
149
+ - Shows signs of dehydration
150
+
151
+ **Important**: This is educational information only, not medical advice.
152
+ Your doctor reviews all conversations. For specific medical guidance,
153
+ please contact [Doctor Name] directly.
154
+
155
+ 📞 For emergencies, call your local emergency services immediately."
156
+
157
+ ---
158
+
159
+ ## 🚨 When AI Detects Something Urgent
160
+
161
+ If you mention serious symptoms like:
162
+ - Severe chest pain
163
+ - Difficulty breathing
164
+ - Heavy bleeding
165
+ - Severe injury
166
+ - Thoughts of self-harm
167
+
168
+ The AI will:
169
+ 1. **Immediately alert you** to seek emergency care
170
+ 2. **Notify your doctor** automatically
171
+ 3. **Give emergency guidance** on what to do now
172
+ 4. **NOT provide treatment advice** - you need immediate medical attention
173
+
174
+ ### Urgent Response Example
175
+
176
+ **You**: "I have severe chest pain"
177
+
178
+ **AI**: "🚨 **URGENT: SEEK EMERGENCY CARE NOW**
179
+
180
+ Severe chest pain requires immediate medical attention.
181
+
182
+ **What to do RIGHT NOW:**
183
+ 1. Call emergency services (911 or local emergency number)
184
+ 2. Do NOT drive yourself
185
+ 3. Do NOT wait to see if it improves
186
+ 4. Tell someone near you
187
+
188
+ Your doctor has been notified of this urgent message.
189
+
190
+ **This is a medical emergency. Go to the nearest hospital
191
+ or call emergency services immediately.**"
192
+
193
+ ---
194
+
195
+ ## 🔒 Your Privacy & Safety
196
+
197
+ ### Data Protection
198
+
199
+ - All conversations are secure and private
200
+ - Your doctor can see all messages
201
+ - No data is sold to third parties
202
+ - Conversations are stored securely
203
+
204
+ ### Anonymous Chatting
205
+
206
+ You can chat without providing:
207
+ - Your name
208
+ - Email address
209
+ - Phone number
210
+
211
+ However, providing contact info helps your doctor follow up if needed.
212
+
213
+ ### Optional: Share Your Contact Info
214
+
215
+ If you'd like your doctor to reach you, you can share:
216
+ - Your name
217
+ - Email address
218
+ - Phone number
219
+
220
+ **How to share**: Just mention it in your first message
221
+ ```
222
+ Example: "Hi, this is Sarah Johnson (sarah@email.com)"
223
+ ```
224
+
225
+ ---
226
+
227
+ ## ✅ Best Practices
228
+
229
+ ### DO:
230
+
231
+ ✅ **Use for routine questions**
232
+ - General health information
233
+ - Appointment preparation
234
+ - Medication questions
235
+ - Clinic information
236
+
237
+ ✅ **Be clear and specific**
238
+ - "My 5-year-old has a fever of 38°C" (not just "fever")
239
+ - "I'm preparing for blood work tomorrow" (not just "test")
240
+
241
+ ✅ **Mention all symptoms**
242
+ - The more detail, the better the AI can help
243
+ - Include when symptoms started
244
+ - Describe severity (mild, moderate, severe)
245
+
246
+ ✅ **Follow safety advice**
247
+ - If AI says seek care, do it
248
+ - Don't ignore red flags
249
+ - Call emergency services for emergencies
250
+
251
+ ### DON'T:
252
+
253
+ ❌ **Use for emergencies**
254
+ - Call emergency services instead
255
+ - Don't wait for AI response in emergencies
256
+
257
+ ❌ **Expect diagnoses**
258
+ - AI can't tell you what disease you have
259
+ - Book an appointment for diagnosis
260
+
261
+ ❌ **Request prescriptions**
262
+ - AI can't prescribe medications
263
+ - Your doctor needs to see you for prescriptions
264
+
265
+ ❌ **Share overly personal medical history**
266
+ - Keep to the specific question
267
+ - Share detailed history with your doctor in person
268
+
269
+ ---
270
+
271
+ ## 📱 Tips for Best Experience
272
+
273
+ ### On Mobile Phone
274
+
275
+ - Use in portrait mode for better layout
276
+ - Type short, clear messages
277
+ - Select topic before each question
278
+ - Works on any mobile browser (Safari, Chrome, etc.)
279
+
280
+ ### If Something Goes Wrong
281
+
282
+ **Page won't load?**
283
+ - Check your internet connection
284
+ - Try refreshing the page
285
+ - Verify you have the correct link
286
+
287
+ **Can't send messages?**
288
+ - Check internet connection
289
+ - Try reloading the page
290
+ - Make sure you selected a topic
291
+
292
+ **AI not responding?**
293
+ - Wait a few seconds
294
+ - Check your internet
295
+ - Try sending again
296
+
297
+ **Still having issues?**
298
+ - Contact your doctor directly
299
+ - They can help troubleshoot
300
+
301
+ ---
302
+
303
+ ## ❓ Frequently Asked Questions
304
+
305
+ ### Q: Is this free?
306
+
307
+ A: Your doctor decides pricing. Many doctors offer free basic access. Check with your doctor for details.
308
+
309
+ ### Q: Do I need to create an account?
310
+
311
+ A: No! You can chat immediately without signing up.
312
+
313
+ ### Q: Can I use this instead of visiting my doctor?
314
+
315
+ A: No. This is for educational information only. You still need to see your doctor for:
316
+ - Diagnoses
317
+ - Prescriptions
318
+ - Physical examinations
319
+ - Serious health concerns
320
+
321
+ ### Q: How fast will I get a response?
322
+
323
+ A: The AI responds within seconds. If your doctor replies manually, it may take longer depending on their availability.
324
+
325
+ ### Q: Can my doctor see my messages?
326
+
327
+ A: Yes! Your doctor reviews all conversations. This is a good thing - they can step in if needed.
328
+
329
+ ### Q: Is my conversation private?
330
+
331
+ A: Yes. Only you and your doctor can see your messages. They're stored securely and not shared with anyone else.
332
+
333
+ ### Q: What if I need urgent care?
334
+
335
+ A: The AI will tell you to seek immediate medical attention. Always:
336
+ - Call emergency services for emergencies
337
+ - Go to the nearest hospital
338
+ - Don't wait for online responses
339
+
340
+ ### Q: Can I chat about mental health?
341
+
342
+ A: Yes, but remember:
343
+ - This is not therapy or counseling
344
+ - If you're in crisis, call a suicide hotline
345
+ - The AI will direct you to emergency resources if needed
346
+
347
+ ### Q: Can I use this for my children?
348
+
349
+ A: Yes! You can ask questions about your children's health. The AI is designed to help with pediatric questions too.
350
+
351
+ ### Q: What languages are supported?
352
+
353
+ A: Currently English. More languages coming soon!
354
+
355
+ ### Q: Can I chat from anywhere?
356
+
357
+ A: Yes! As long as you have internet, you can chat from anywhere in the world.
358
+
359
+ ---
360
+
361
+ ## 🆘 Emergency Resources
362
+
363
+ **Remember: EvalDoc is NOT for emergencies**
364
+
365
+ ### When to Call Emergency Services:
366
+
367
+ - Chest pain or pressure
368
+ - Difficulty breathing or shortness of breath
369
+ - Severe bleeding that won't stop
370
+ - Severe burns
371
+ - Possible broken bones
372
+ - Severe allergic reactions
373
+ - Loss of consciousness
374
+ - Seizures
375
+ - Poisoning or overdose
376
+ - Suicidal thoughts or actions
377
+ - Severe injuries from accidents
378
+
379
+ ### In an Emergency
380
+
381
+ **Always call your local emergency number in serious situations!**
382
+
383
+ Common emergency numbers: 911 (US/Canada), 999 (UK), 112 (EU/International).
384
+
385
+ ---
386
+
387
+ ## 📞 Getting More Help
388
+
389
+ ### Can't Find What You Need?
390
+
391
+ 1. **Ask in the chat** - The AI might have the answer
392
+ 2. **Call your doctor's clinic** - For specific questions about your care
393
+ 3. **Book an appointment** - For thorough medical evaluation
394
+
395
+ ### Technical Support
396
+
397
+ If the website isn't working:
398
+ - Contact your doctor's office
399
+ - They can report technical issues
400
+ - Or email: helpme@evaldoctor.ai
401
+
402
+ ---
403
+
404
+ ## 📝 Quick Tips Summary
405
+
406
+ đŸŸĸ **DO USE** for:
407
+ - Routine health questions
408
+ - Medication information
409
+ - Appointment preparation
410
+ - General health education
411
+ - Clinic information
412
+
413
+ 🔴 **DON'T USE** for:
414
+ - Emergencies (call 911/112)
415
+ - Diagnoses
416
+ - Prescriptions
417
+ - Serious symptoms
418
+ - Detailed treatment plans
419
+
420
+ ✅ **REMEMBER**:
421
+ - AI provides education, not medical advice
422
+ - Your doctor reviews all chats
423
+ - Always follow AI safety recommendations
424
+ - Book appointments for proper medical care
425
+ - Call emergency services for emergencies
426
+
427
+ ---
428
+
429
+ ## 🎉 You're Ready!
430
+
431
+ You now know how to use EvalDoc to get quick, safe health information from your doctor's AI assistant.
432
+
433
+ **Remember**:
434
+ - 🤖 AI handles routine questions
435
+ - đŸ‘¨â€âš•ī¸ Your doctor handles medicine
436
+ - 🚨 Emergency services handle emergencies
437
+
438
+ Stay healthy! 💚
439
+
440
+ ---
441
+
442
+ *Your doctor cares about your health. This tool helps them serve you better, faster, and more efficiently.*
443
+
444
+ ---
445
+
446
+ **Questions? Ask in the chat or contact your doctor's clinic directly.**
447
+
448
+ ---
449
+
450
+ *Last Updated: January 2026*
451
+ *Version: 1.0*
@@ -0,0 +1,194 @@
1
+ # EvalDoc Platform Overview
2
+
3
+ ## đŸĨ What is EvalDoc?
4
+
5
+ EvalDoc is an AI-powered medical consultation platform that connects patients with healthcare providers through an intelligent chat interface. The platform helps doctors scale their practice by automating routine questions while maintaining full oversight and control.
6
+
7
+ ## đŸŽ¯ Core Purpose
8
+
9
+ **For Doctors**: Reduce burnout from repetitive questions, serve more patients safely, and focus on complex clinical cases.
10
+
11
+ **For Patients**: Get instant, safe medical guidance 24/7 without waiting for appointments, while maintaining connection to their trusted doctors.
12
+
13
+ ## 🌟 Key Features
14
+
15
+ ### 1. **Link-First Architecture**
16
+ - Each doctor gets a unique shareable link (e.g., `evaldoc.com/dr-amina`)
17
+ - No app downloads required
18
+ - Works on any device with a web browser
19
+ - Perfect for WhatsApp, SMS, or QR code sharing
20
+
21
+ ### 2. **AI-Powered Chat Assistant**
22
+ - **Two AI Models**:
23
+ - **DeepSeek** (Primary): Better quality medical responses
24
+ - **Google Gemini** (Fallback): Backup when DeepSeek is unavailable
25
+ - Provides educational information, not medical diagnosis
26
+ - Automatically detects red flags and escalates to doctor
27
+ - Never prescribes medication or diagnoses conditions
28
+
29
+ ### 3. **Doctor Oversight & Control**
30
+ - **Inbox Dashboard**: View all patient conversations in one place
31
+ - **Full Message History**: See both patient questions and AI responses
32
+ - **Manual Reply Capability**: Doctors can respond directly when needed
33
+ - **Escalation System**: AI flags urgent cases automatically
34
+ - **Analytics Dashboard**: Monitor platform usage and patient volume
35
+
36
+ ### 4. **Safety-First Design**
37
+ - ✅ Educational content only
38
+ - ✅ Red-flag detection (chest pain, breathing issues, etc.)
39
+ - ✅ Automatic escalation for serious symptoms
40
+ - ✅ Clear disclaimers on every interaction
41
+ - ❌ No diagnoses given
42
+ - ❌ No medication prescriptions
43
+ - ❌ No dosing recommendations
44
+
45
+ ### 5. **Topic-Based Conversations**
46
+ Doctors can enable/disable specific topics:
47
+ - 💊 Medication Information & Safety
48
+ - 📅 Appointments & Preparation
49
+ - â„šī¸ General Health Information
50
+ - đŸĨ Clinic Services & Hours
51
+ - đŸ’ŗ Insurance & Billing FAQ
52
+ - 🩹 Post-Procedure Guidance
53
+
54
+ ## 🔄 How It Works
55
+
56
+ ### Patient Journey:
57
+ ```
58
+ 1. Patient receives link from doctor
59
+ ↓
60
+ 2. Opens link in browser (no signup required)
61
+ ↓
62
+ 3. Selects topic of interest
63
+ ↓
64
+ 4. Asks question via chat
65
+ ↓
66
+ 5. AI responds instantly with educational info
67
+ ↓
68
+ 6. If urgent → Doctor gets alert
69
+ ↓
70
+ 7. Doctor reviews and steps in if needed
71
+ ```
72
+
73
+ ### Doctor Journey:
74
+ ```
75
+ 1. Sign up at /app
76
+ ↓
77
+ 2. Complete profile setup
78
+ ↓
79
+ 3. Customize topics and branding
80
+ ↓
81
+ 4. Share unique link with patients
82
+ ↓
83
+ 5. Monitor inbox for conversations
84
+ ↓
85
+ 6. Review AI responses
86
+ ↓
87
+ 7. Reply manually when needed
88
+ ```
89
+
90
+ ## đŸ› ī¸ Technical Highlights
91
+
92
+ - **Frontend**: Vanilla JavaScript (no framework overhead)
93
+ - **Backend**: Node.js with Express
94
+ - **Database**: Firebase Firestore
95
+ - **Authentication**: Firebase Auth
96
+ - **AI Integration**: DeepSeek API + Google Gemini API
97
+ - **Hosting**: Firebase Hosting + Cloud Functions
98
+ - **Design**: Clean, mobile-first UI with accessibility focus
99
+
100
+ ## 📊 Data Architecture
101
+
102
+ ### Collections:
103
+ - **providers**: Doctor profiles and settings
104
+ - **conversations**: Chat sessions between patients and doctors
105
+ - **messages**: Individual messages (subcollection of conversations)
106
+ - **safetyEvents**: Tracked escalations and flags
107
+ - **analytics**: Usage metrics and statistics
108
+
109
+ ### Message Flow:
110
+ ```
111
+ Patient → Chat API → AI Model → Response → Firestore → Doctor Inbox
112
+ ```
113
+
114
+ ## 🌍 Built for Anywhere
115
+
116
+ - **Mobile-First**: Works on any phone
117
+ - **Low Bandwidth**: Optimized for any network condition
118
+ - **Share Anywhere**: WhatsApp, SMS, email, or QR code
119
+ - **Offline Resilience**: Graceful degradation when connectivity is poor
120
+ - **Global Ready**: Designed for real healthcare conditions worldwide
121
+
122
+ ## 💰 Business Model
123
+
124
+ - **Doctor Pricing**: Flexible (per session or subscription)
125
+ - **Patient Pricing**: Set by individual doctors
126
+ - **Platform Fee**: 25% commission on transactions
127
+ - **No Ads**: Healthcare trust comes first
128
+ - **No Data Selling**: Patient privacy is paramount
129
+
130
+ ## 🔐 Security & Privacy
131
+
132
+ - **PII Redaction**: Automatically removes sensitive information
133
+ - **Secure Storage**: All data encrypted in Firebase
134
+ - **Authentication**: Secure token-based auth for doctors
135
+ - **Anonymous Sessions**: Patients can chat without creating accounts
136
+ - **Audit Trails**: All conversations logged for doctor review
137
+
138
+ ## 📈 Current Status
139
+
140
+ ### ✅ Implemented Features:
141
+ - Doctor registration and profile management
142
+ - Unique shareable links per doctor
143
+ - AI chat with DeepSeek and Gemini
144
+ - Safety detection and escalation
145
+ - Doctor inbox with full conversation history
146
+ - Analytics dashboard with doctor metrics
147
+ - Topic customization
148
+ - Manual doctor replies
149
+ - Mobile-responsive design
150
+
151
+ ### 🚧 Future Roadmap:
152
+ - Patient authentication (Google Sign-In)
153
+ - Thread-based conversations (WhatsApp-style)
154
+ - Push notifications
155
+ - Payment integration (Stripe)
156
+ - Multi-language support
157
+ - Voice messages
158
+ - Image sharing
159
+ - Appointment scheduling
160
+
161
+ ## 🎓 Target Users
162
+
163
+ ### Primary: Healthcare Providers
164
+ - Solo practitioners
165
+ - Small clinics
166
+ - Multi-doctor practices
167
+ - Medical specialists
168
+ - Family medicine doctors
169
+
170
+ ### Secondary: Patients
171
+ - Tech-savvy mobile users
172
+ - People seeking quick medical info
173
+ - Patients with routine questions
174
+ - Those preparing for appointments
175
+ - Post-procedure follow-up needs
176
+
177
+ ## 🚀 Competitive Advantages
178
+
179
+ 1. **Link-First**: No app downloads, instant access
180
+ 2. **Doctor-Controlled**: Providers maintain full oversight
181
+ 3. **Global-Ready**: Built for real conditions everywhere
182
+ 4. **Safety-First**: Medical-grade content moderation
183
+ 5. **Scalable**: AI handles routine, doctors handle medicine
184
+ 6. **Affordable**: Lower cost than traditional telemedicine
185
+
186
+ ## 📞 Support & Contact
187
+
188
+ - **Email**: helpme@evaldoctor.ai
189
+ - **Website**: evaldoctor.ai
190
+ - **Company**: Feyti Medical Group, Inc.
191
+ - **Location**: Dover, DE, USA
192
+ ---
193
+
194
+ **Built with care for healthcare providers and patients worldwide**