The main idea of the application is a simulating IoT platform based on microservices for managing patients health. Application contains the set of services to simulate the collection & transmission of medical telemetry data, set of services for data processing and single-page web application provided user interface for managing patients health. Each application microservice implements simple CRUD operations.
To run the application, type the following commands from the app root directory:
> docker-compose build
> docker-compose up
For Mac Os or Linux systems, use sudo
for command above.
To know more about docker-compose, please visit docker official site.
To configure Data source microservice for generating telemetry data, see DataSource documentation.
To deploy web UI application, see documentation.
Use Swagger UI service for more information on the microservice API. For example, to analyze API of DataSource microservice, use the following URL:
http://localhost:3010/swagger
Use Jaeger tracing service to verify that the generated data is sent to microservices through Gateway.API. This service is convenient for analyzing the path of interservice requests.
http://localhost:16686
JWT authentication is used to managed access to application resources. For login/register, use iCare UI interface or the following POST requests:
http://localhost:3000/accounts/login
http://localhost:3000/accounts/register
For more details, see documentation of Identity microservice.
The reference application is cross-platform and can run on Windows, Linux or macOS. A microservice-oriented architecture with multiple standalone microservices (simple CRUD) is used.
The Http protocol is used for communication between web application and microservices. Communication across multiple microservices is based on the Event Bus with commands & events. The reference application uses the MassTransit event bus with RabbitMQ message broker.
Each microservice is completely independent and doesn't know about existence of other microservices.
iCare application consists of the following microservices:
- iCare Web App - A single-page web application (based on Angular), that provides user interface for managing patient health.
- DataSource - Number of services (currently 2) for modeling the acquisition & transmission of telemetry data (temperature/acoustic) to a specific API.
- Identity.API - Microservice for managing user access to application (producer of JW tokens).
- Profile.API - Microsrvice for store and managing patients profiles.
- API Gateway - An entry point for the application, used only for routing.
- Sensor.API - Microservice for store and managing telemetry sensors (DataSource) & data records (temperature/acoustic).
- DataProcessor.API - Number of microservices (currently 2) for processing telemetry data and creating health reports.
- Report.API - Microservice for store and managing health reports.
- Event Bus - Microservice used for communication between microservices (allows microservices to send commands & events to each other).
Each microservice has a separate database to store the list of entities. The figure below briefly describes the relationship between microservices at the database level.
The iCare application has an event-driven architecture, therefore, each CRUD action on the application entities (account, profile, sensor, record, report, etc.) will produce a chain of commands and events between microservices. The figure bolow briefly describes the events chain for the following user actions:
- Register new telemetry data;
- Delete account/profile;
- Delete sensor.
For more details, see documentation of Event Bus microservice.
A separate Docker container is used for each microservice. Brief information on used docker containers is presented below.
# | Service | Container name | Port |
---|---|---|---|
1 | DataSource | datasource_1.api | 3010:80 |
2 | DataSource | datasource_2.api | 3011:80 |
3 | Gateway.API | gateway.api | 3000:80 |
4 | Sensor.API | sensor.api | 3001:80 |
5 | Report.API | report.api | 3002:80 |
6 | Profile.API | profile.api | 3003:80 |
7 | Identity.API | identity.api | 3004:80 |
8 | DataProcessor.API | dataprocessor_1.api | 3005:80 |
9 | DataProcessor.API | dataprocessor_2.api | 3006:80 |
10 | SQL Server | sqldata | 1433:1433 |
11 | Event Bus (Rabbit MQ) | event_bus | 15672:15672 |
12 | Tracing service | jaeger | 16686:16686 |
- ASP.NET Core 3.1
- Microservices (CRUD)
- Clean architecture
- REST API with Swagger
- Docker
- Entity Framework Core for SQL Server
- Automapper
- Health check
- Unit tests with xUnit & Moq
- Logging with Serilog
- Event bus based on MassTransit and RabbitMQ
- Open Tracing with Jaeger
- API Gateway with Ocelot
Yury Aslamov - Software Developer, Ph.D.
This project is under the MIT License - see the LICENSE.md file for details.