Complete Developer Documentation - Set Up Guide for New Development Teams
The Remote Medical Care Platform is a comprehensive telemedicine solution that connects patients with healthcare professionals through a web application and mobile apps. The system enables virtual consultations, medical test management, patient monitoring, and comprehensive health record management.
The platform supports five distinct user roles, each with specific functionalities and permissions. Below is a comprehensive overview of each role.
| Role | Primary Functions | Key Capabilities |
|---|---|---|
| Super Admin | Platform-wide management and oversight |
• Manage all clinics, doctors, and patients • Manage user roles • Assign permissions to roles • View system-wide dashboards and statistics • Manage specializations and health conditions • Other system administration tasks |
| Clinic Admin | Clinic-level management and operations |
• Manage clinic information and settings • Oversee all doctors in the clinic • Oversee all patients registered with the clinic • Monitor clinic-specific appointments • View clinic dashboards and analytics • Manage clinic doctors, patients, and assistants |
| Doctor | Patient care, appointments, and test management |
• View assigned patients • Schedule and manage appointments • Create examination plans with tests • Assign tests to patients • Review test results • Provide assessments • Manage it's assistants • Access patient medical history and documents • Create Examination Plan • Setup his availability • Enable/Disable Diabtest Diary for the Patient. • Do video consulation with the patient. • Setup his profile and specialization |
| Patient | Personal health management and consultation |
• Book appointments with doctors • Perform assigned tests via mobile app • Perform Self Examination with devices via mobile app • Upload and share documents • Use AI Assistant for appointment booking • Use AI for Meal Analysis • Use Bolus Insulin Calultor in mobile app • View test results • Access medical history • Manage health information (allergies, medications, etc.) • Download and export documents • Use mobile app for synchronization for medical data from Apple Health and Google Health • Perform tests for the assigned examination plan. • Receive reminders for tests and appointments. • Other functions related health management |
| Doctor Assistant | Support for doctor operations and patient care |
• Assist doctors with patient management • Help with appointment scheduling • Access specific permissions assigned by doctor |
Patients interact with the platform primarily through the mobile application, which is available for both iOS and Android platforms.
| Platform | Status | Server | Details |
|---|---|---|---|
| Apple App Store | Production | Clinic Server | Release for the purpose of testing of plateform for some specific clinics. Do not have latest developements. |
| Apple TestFlight | Testing | Care Server | Latest features and updates |
| Android APK | Available | Both Servers | Direct APK download from Login page for Android devices |
The mobile app supports integration with various medical devices that can capture health metrics. Patients can use these devices to record health data, which is then submitted through the mobile app to the platform.
The mobile app supports synchronization with popular health platforms:
The system allows for the creation and management of devices through the Devices API. Each device can be linked to clinics through the DeviceClinic endpoint, enabling clinic-specific device configurations.
POST /api/add_new_device - Add new deviceGET /api/devices/get_all - Get all available devicesGET /api/devices/{device_id} - Get device detailsPOST /api/device_clinics/register - Register device with clinicThe Remote Medical Care Platform follows a modern REST API architecture with separated concerns between the frontend and backend.
/api/
Mobile App / Web Browser
↓
HTTP/HTTPS
↓
REST API Layer (/api/*)
↓
Controllers (app/Controllers/Api/)
↓
Models (app/Models/)
↓
MySQL Database
↓
External Services (Agora, PDF.co, OpenAI)
| Directory | Purpose |
|---|---|
app/Controllers/ |
Web application controllers (for web views) |
app/Controllers/Api/ |
API controllers handling all REST endpoints |
app/Models/ |
Data models managing database interactions |
app/Views/ |
Web application views (HTML templates) |
app/Config/ |
Configuration files (Routes, Database, Services, etc.) |
app/Database/ |
Migrations and seeds for database schema |
app/Traits/ |
Reusable trait classes |
app/Helpers/ |
Helper functions and utilities |
app/Enum/ |
Enumeration classes for constants |
public/ |
Public assets, uploads, and entry point |
writable/ |
Writable directories (logs, cache, uploads) |
Accounts.php - User authentication and account managementAppointment.php - Appointment booking, scheduling, and managementPatient.php - Patient data, tests, diary, and health informationDoctor.php - Doctor operations, assistants, and patient managementDashboard.php - Dashboard data for different user rolesAgora.php - Video call tokens and communication featuresTest.php - Medical test management and resultsClinic.php - Clinic managementDocuments.php - Medical document managementAiAssistant.php - AI-powered health guidanceThe platform supports 4 languages: English (en), German (de), Spanish (es), and Arabic (ar). Language files are organized in app/Language/ directory. Configure in app/Config/App.php:
public string $defaultLocale = 'en';
public array $supportedLocales = ['en', 'de', 'es', 'ar'];
<?= my_lang('Appointments') ?>lang('app.allAppointments') or my_lang('All Appointments')Add new key-value pairs to language files in app/Language/{language}/app.php for each supported language and use my_lang('key') in views or controllers.
The platform integrates with several external services to provide comprehensive features. Below is a complete guide to configuring these services in the .env file.
Agora.io provides real-time video call capabilities for doctor-patient consultations and communication.
# Agora App Credentials
appID = "YOUR_AGORA_APP_ID"
appCertificate = "YOUR_AGORA_APP_CERTIFICATE"
agoraChatHost = "a71.chat.agora.io"
agoraChatAppName = "YOUR_AGORA_CHAT_APP_NAME"
agoraChatOrgName = "YOUR_AGORA_ORG_NAME"
POST /api/agora/get_token - Generate video meeting tokenGET /api/agora/get_chat_app_token - Generate chat app tokenPOST /api/agora/register_user - Register user in AgoraGET /api/agora/get_chat_user_token/{user_id} - Get chat token for userPOST /api/agora/update_appointment_status/{appointment_id} - Update meeting statusPDF.co is used for processing uploaded medical documents (PDF files) by converting them to images and extracting information. When patients upload medical documents or lab reports as PDFs, the system uses PDF.co to convert these files to images, which can then be processed for information extraction and display.
# PDF.co API Key
pdfCoKey = "YOUR_PDFCO_API_KEY"
POST /api/extract_file_info - Extract information from uploaded documentsPOST /api/add_document - Upload and process medical documentsChatGPT powers the intelligent appointment booking system. When a patient wants to book an appointment, they enter their symptoms. These symptoms are sent to ChatGPT, which asks targeted diagnostic questions (max 10) to understand the patient's condition. Based on the answers to these questions, ChatGPT makes a diagnosis, and the system then shows appropriate doctors who are specialized in treating that diagnosed condition. The patient can then book an appointment with one of these recommended doctors.
Additionally, GPT Vision API analyzes meal images to extract nutritional information including dish name, ingredients, and carbohydrate content for dietary tracking.
openaiKey = "sk-YOUR_OPENAI_API_KEY"
https://platform.openai.comPOST /api/talk_to_ai_assistant - Send symptoms and receive diagnostic questionsPOST /api/get_specializations_against_diagnosis - Get specializations for diagnosed conditionPOST /api/get_doctors_by_specializations - Get doctors for recommended specializationPOST /api/extract_meal_information - Analyze meal image (uses GPT Vision)| Service | Configuration Key | Documentation |
|---|---|---|
| Agora | appID, appCertificate, agoraChatHost, agoraChatAppName, agoraChatOrgName | Agora Docs |
| PDF.co | pdfCoKey | PDF.co Docs |
| OpenAI | openaiKey | OpenAI Docs |
The platform operates on two distinct servers to manage development cycles and production deployment separately.
| Server | URL | Environment | Purpose |
|---|---|---|---|
| Care Server | http://care.remotemedtech.com/ |
Development/Testing |
✓ Latest development features ✓ TestFlight iOS app uses this ✓ Internal testing environment ✓ New features developed here |
| Clinic Server | https://clinic.remotemedtech.com/ |
Production |
✓ Stable, production-ready code ✓ Public App Store iOS app uses this ✓ For specific clinic deployments |
The Remote Medical Care Platform provides a comprehensive suite of features for healthcare delivery and patient management.
intl - Internationalizationmbstring - Multi-byte string functionsjson - JSON processing (usually enabled by default)mysqlnd - MySQL native drivercurl - HTTP requestsCopy the provided env file to .env and configure the following sections:
app.baseURL = 'http://localhost/rmc' # Your local development URL
apiURL = 'http://localhost/rmc/api/' # API base URL
# Mobile app download links
apkURL = "http://localhost/rmc/public/assets/files/REC.care.apk"
iosURL = "https://testflight.apple.com/join/cEYQsFL7"
database.default.hostname = 'localhost'
database.default.database = 'rmc'
database.default.username = 'root'
database.default.password = ''
database.default.DBDriver = 'MySQLi'
database.default.port = 3306
# Agora Configuration
appID = "YOUR_AGORA_APP_ID"
appCertificate = "YOUR_AGORA_CERTIFICATE"
agoraChatHost = "a71.chat.agora.io"
agoraChatAppName = "YOUR_CHAT_APP_NAME"
agoraChatOrgName = "YOUR_ORG_NAME"
# PDF.co Configuration
pdfCoKey = "YOUR_PDF_CO_API_KEY"
# OpenAI Configuration
openaiKey = "YOUR_OPENAI_API_KEY"
git clone [repository-url]cd RemoteMedicalCare-Webcomposer installcp env .envCREATE DATABASE rmc;php spark migratephp spark db:seed SeedNamephp spark serveEnsure the writable directory has proper permissions:
chmod -R 755 writable/
To deploy the website to production, you need server credentials from NetCup hosting provider.
/var/www/html or similar)vendor/, .env, and writable/).env file on the server with production database and API credentialscomposer install --no-dev on the server to install dependenciesphp spark migratechmod -R 755 writable/