SmartMedGuard: Modular Innovation for IoT-Based Patient Room Monitoring in Community Health Centers and Regional General Hospitals
Indonesian Title
SmartMedGuard: Inovasi Modular untuk Pemantauan Ruang Rawat Berbasis IoT di Puskesmas dan RSUD
SmartMedGuard is an IoT-based hospital ward monitoring system designed to address the lack of real-time environmental data in community health centers and Class C/D hospitals across Indonesia. The system employs ESP32 microcontrollers equipped with temperature, humidity, and occupancy sensors to continuously monitor ward conditions. Data is transmitted over MQTT to a local Raspberry Pi 5 server, where readings are stored in a PostgreSQL database and streamed to a live web dashboard in real-time, all without requiring internet connectivity.
SmartMedGuard is developed at Kalimantan's Institute of Technology, funded by BIMA and Kemdiktisaintek, and has advanced its Technology Readiness Level from 3 to 4 through validated laboratory testing.
smart-med-guard # IoT hospital ward monitoring system
├── iot-device # ESP32 firmware for sensors and MQTT communication
├── mqtt # MQTT broker (Mosquitto) configuration
├── server # NestJS REST API and WebSocket server with Prisma ORM
├── website # NextJS web dashboard for real-time monitoring
├── mqtt-test # MQTT publish/subscribe testing utilities
└── web-socket-test # WebSocket connection testingEnsure you have the following installed on your system:
Create a .env file in the project root with the required variables:
$ cp .env.example .envConfigure the following variables:
SERVER_URL: Your server API endpointSERVER_WEBSOCKET_URL: Your WebSocket server endpointSERVER_API_KEY: API key for authenticationDATABASE_URL: PostgreSQL connection stringWEBSITE_PORT: Port for the website (default: 3000)
Start all services in development mode with hot-reload enabled:
$ docker-compose --profile development up --buildThis will start:
- MQTT Broker (Mosquitto) on port 1883 and 9001
- Database (PostgreSQL) on port 5432
- Server (NestJS API) on port 3001
- Website (NextJS Dashboard) on port 3000
Build and deploy all services for production:
$ docker-compose --profile production up --buildServices will automatically start with proper networking, data volumes, and health checks configured.
Monitor service logs in real-time:
# All services
$ docker-compose logs -f
# Specific service
$ docker-compose logs -f server
$ docker-compose logs -f website$ docker-compose downTo also remove volumes (warning: data will be deleted):
$ docker-compose down -v