The VITALIS project employs a robust microservices architecture designed to facilitate real-time health monitoring and data management. This architecture ensures efficient data collection, processing, and storage across multiple integrated components.
+-------------------+ +-------------+ +-------------------+
| Wearable Devices +------>+ MQTT Broker +------>+ Spring Boot Backend|
+-------------------+ +-------------+ +---------+---------+
| |
v v
+---------+---------+ +---------+---------+
+ InfluxDB | | MySQL Database |
+-------------------+ +---------+---------+
- Wearable devices send health metrics to MQTT Broker
- MQTT Broker forwards messages to Spring Boot Backend
- Backend processes and validates incoming data
- Relational data stored in MySQL
- Time-series health metrics stored in InfluxDB
- Frontend can retrieve and display data via RESTful API
To set up and run the VITALIS project, ensure you have the following software installed:
- Java Development Kit (JDK) 17 or later
- Maven 3.8+
- Docker and Docker Compose
- MQTT Broker (Mosquitto recommended)
- Operating System: Linux, macOS, or Windows with WSL2
- Minimum RAM: 16GB
- Recommended IDE: IntelliJ IDEA or Visual Studio Code with Java extensions
Clone the VITALIS project repository using Git:
git clone https://github.com/your-org/vitalis.git
cd vitalisPrepare your environment configuration:
cp .env.example .env
# Edit .env file with your specific credentialsKey configurations to review:
- Database connection strings
- MQTT broker settings
- JWT secret key
- Service ports
Build the application and start services using Docker Compose:
mvn clean package
docker-compose up --build -dThis command will:
- Compile the Java application
- Build Docker images
- Start all required services
- Run database migrations
- Initialize MQTT broker
After successful deployment, you can access the following services:
- Main API:
http://localhost:8080 - InfluxDB Web UI:
http://localhost:8086 - MySQL Database:
localhost:3306/vitalis
| Endpoint | Method | Description |
|---|---|---|
/auth/login |
POST | Obtain JWT authentication token |
/auth/register |
POST | Create a new user account |
| Endpoint | Method | Description |
|---|---|---|
/api/patients |
GET | Retrieve list of all patients |
/api/patients/{id} |
GET | Get details for a specific patient |
/api/patients |
POST | Create a new patient record |
| Endpoint | Method | Description |
|---|---|---|
/metrics/patient/{patientId} |
GET | Retrieve historical health metrics |
/metrics/realtime |
WebSocket | Real-time health metric streaming |
Authenticate and receive a JWT token:
curl -X POST http://localhost:8080/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"staff1", "password":"securePass123"}'Add a patient to the system:
curl -X POST http://localhost:8080/api/patients \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"age": 42,
"gender": "MALE",
"admissionDate": "2024-02-15"
}'-
Database Connection Failures
- Verify credentials in
.envfile - Check network connectivity
- Ensure Docker networks are correctly configured
- Verify credentials in
-
MQTT Connection Timeouts
- Confirm broker is running on port 1883
- Check firewall settings
- Validate broker credentials
-
JWT Authentication Problems
- Tokens expire after 24 hours by default
- Regenerate token if expired
- Verify token generation process
To view backend service logs:
docker-compose logs -f backendThis command provides real-time log streaming for diagnostic purposes.
- Monitor system resources using Docker stats
- Use InfluxDB's built-in monitoring capabilities
- Implement application-level logging for detailed insights