System Architecture¶
CARE-Link is built on a service-oriented architecture that decouples the EHR, messaging, and AI components.
High-Level Components¶
The system consists of three main pillars:
-
User Interfaces
- Clinician Portal: React-based web front-end.
- Patient Interface: WhatsApp chatbot.
-
Backend Services
- EHR Backend: Laravel (PHP) web service handling user management and records.
- Chatbot Service: Python FastAPI application processing WhatsApp messages.
-
Data Storage
- PostgreSQL: Stores patient demographics, vitals, and structured medical records that require relational integrity.
- MongoDB (Azure Cosmos DB): Stores unstructured chat logs and conversation history.
graph TD
A[Patient (WhatsApp)] <-->|Meta Cloud API| B[Chatbot Service (FastAPI)]
B <-->|Queries| C[LLM (OpenAI)]
B <-->|Reads/Writes| D[MongoDB (Chat Logs)]
B <-->|Updates| E[PostgreSQL (Medical Records)]
F[Clinician (Web Dashboard)] <-->|HTTPS| G[EHR Backend (Laravel)]
G <-->|Reads/Writes| E
G <-->|Request Summary| B
Microservices Design¶
- EHR Platform: Deployed as an Azure App Service.
- Chatbot Service: Hosted as an Azure Function for event-driven execution.
- Communication: Secure HTTP/2 channels with TLS encryption.
Extensibility¶
The architecture allows for new agents (e.g., nutrition coach) to be plugged in via standard APIs. The use of widely adopted open-source stacks (React, Laravel, FastAPI) ensures maintainability.