Modern web application for real-time monitoring of patient medical parameters.
- Real-time dashboard with medical metrics
- Patient management with RFID tracking
- Parameter monitoring (temperature, heart rate, SpO2, weight)
- Automatic alerts for critical values
- Responsive and accessible interface
- Secure authentication
- Frontend: React 18, Vite, Tailwind CSS, Lucide Icons
- Backend: PHP 8+, MySQL
- API Server: Node.js/Express (ESP32 data collection)
- Security: JWT, CORS, Security Headers
- Performance: useReducer, useMemo, Optimized Polling
- Node.js 18+
- PHP 8.0+
- MySQL 8.0+
- Web server (Apache/Nginx)
For Windows users, ensure the following are installed:
- Download PHP from php.net
- Download MySQL from mysql.com
- Use
cmd.exeor PowerShell for commands - Replace
sudowith Administrator privileges (right-click and "Run as administrator") - Use backslashes
\for file paths or double slashes\\
Standard Unix commands apply. Use sudo for system-level operations.
If you're using XAMPP (includes Apache, PHP, and MySQL), follow these simplified steps:
- Open XAMPP Control Panel
- Start: Apache, MySQL, and PHP (if available)
- Open MySQL Admin to configure the database
-- In phpMyAdmin or MySQL command line
CREATE DATABASE robot_medical;
CREATE USER 'dark-linux'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON robot_medical.* TO 'dark-linux'@'localhost';
FLUSH PRIVILEGES;
-- Import the schema
-- Upload backend/databases/robot_medical.sql through phpMyAdmin
-- Or use: mysql -u dark-linux -p robot_medical < backend/databases/robot_medical.sqlcp .env.example .envEdit .env:
VITE_API_BASE_URL=http://localhost:8000
DB_HOST=localhost
DB_USER=dark-linux
DB_PASS=password
DB_NAME=robot_medical
Option A - Separate terminals:
Terminal 1 - Frontend:
npm install
npm run devTerminal 2 - Backend (if not using Apache):
php -S 0.0.0.0:8000Terminal 3 - API Server:
cd robot-api
npm install
npm startOption B - All in one npm command:
Update package.json scripts to:
{
"scripts": {
"dev": "concurrently \"npm run dev:frontend\" \"npm run dev:backend\" \"npm run dev:api\"",
"dev:frontend": "vite",
"dev:backend": "php -S 0.0.0.0:8000",
"dev:api": "cd robot-api && npm start"
}
}Then install concurrently:
npm install --save-dev concurrentlyAnd run:
npm run devThis will start all three services in parallel.
Linux/macOS:
# Create the database
sudo mysql -e "CREATE DATABASE IF NOT EXISTS robot_medical;"
# Create the user
sudo mysql -e "CREATE USER IF NOT EXISTS 'dark-linux'@'localhost'; GRANT ALL PRIVILEGES ON robot_medical.* TO 'dark-linux'@'localhost'; FLUSH PRIVILEGES;"
# Import the schema
sudo mysql robot_medical < backend/databases/robot_medical.sqlWindows (PowerShell or CMD as Administrator):
# Open MySQL and run commands
mysql -u root -p
# In MySQL prompt:
CREATE DATABASE IF NOT EXISTS robot_medical;
CREATE USER IF NOT EXISTS 'dark-linux'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON robot_medical.* TO 'dark-linux'@'localhost';
FLUSH PRIVILEGES;
# Exit MySQL
EXIT;
# Import the schema
mysql -u dark-linux -p robot_medical < backend\databases\robot_medical.sql# Copy environment file
cp .env.example .env
# Edit configuration
nano .env# Install dependencies
npm install
# Start development server
npm run devFrontend will be available at http://localhost:5173
Linux/macOS:
# Start PHP built-in server (from root directory)
php -S 0.0.0.0:8000Windows (PowerShell or CMD):
# Navigate to root directory if not already there
cd path\to\robot-medical
# Start PHP built-in server
php -S 0.0.0.0:8000Backend will be available at http://localhost:8000
# Navigate to API server
cd robot-api
# Install dependencies
npm install
# Start the server
npm startAPI Server will be available at http://localhost:3001
# Build the application
npm run build
# Preview production build
npm run preview| Variable | Description | Default |
|---|---|---|
VITE_API_BASE_URL |
Backend URL | http://localhost:8000 |
DB_HOST |
MySQL host | localhost |
DB_NAME |
Database name | robot_medical |
DB_USER |
MySQL user | dark-linux |
JWT_SECRET |
JWT secret key | (to be defined) |
- Frontend: 5173 (development)
- Backend: 8000 (PHP server)
- API Server: 3001 (Express server)
- Database: 3306 (MySQL)
- Access the application at
http://localhost:5173 - View real-time metrics on the dashboard
- Manage patient records
- Monitor medical measurements
- Check critical value alerts
- JWT authentication
- CORS security headers
- Data validation
- SQL injection protection
- Rate limiting (to be implemented)
The application is optimized for:
- Desktop (1024px+)
- Tablet (768px - 1023px)
- Mobile (< 768px)
-
CORS Error
- Verify backend is listening on the correct port
- Check CORS headers in
backend/config/cors.php
-
MySQL Connection Failed
- Verify
dark-linuxuser exists - Confirm permissions on
robot_medicaldatabase
- Verify
-
Frontend Won't Load
- Verify Node.js 18+ is installed
- Run
npm installto install dependencies
- Frontend: Browser console
- Backend: File specified in
LOG_FILE - Database: MySQL logs
The application includes:
- Performance metrics
- Structured logging
- Automatic alerts
- Loading skeletons
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is under the MIT License. See the LICENSE file for details.
For questions or issues:
- Check the documentation
- Review error logs
- Open an issue on GitHub